715 Commits

Author SHA1 Message Date
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
Lasse Collin
5fbce0b8d9 Update NEWS for 5.0.1. 2011-01-28 20:16:57 +02:00
Lasse Collin
03ebd1bbb3 xz: Fix --force on setuid/setgid/sticky and multi-hardlink files.
xz didn't compress setuid/setgid/sticky files and files
with multiple hard links even with --force. This bug was
introduced in 23ac2c44c3.

Thanks to Charles Wilson.
2011-01-26 12:19:08 +02:00
Lasse Collin
7bd0a5e7cc Updated THANKS. 2011-01-18 21:25:24 +02:00
Lasse Collin
f71c4e16e9 Add alloc_size and malloc attributes to a few functions.
Thanks to Cristian Rodríguez for the original patch.
2011-01-18 21:23:50 +02:00
Lasse Collin
316cbe2446 Scripts: Fix gzip and bzip2 support in xzdiff. 2010-12-13 16:36:33 +02:00
Lasse Collin
9311774c49 Build: Enable ASM on DJGPP by default. 2010-12-12 21:23:55 +02:00
Lasse Collin
4a42aaee28 Updated THANKS. 2010-12-12 16:09:42 +02:00
Lasse Collin
ce56f63c41 Add missing PRIx32 and PRIx64 compatibility definitions.
This fixes portability to systems that lack C99 inttypes.h.

Thanks to Juan Manuel Guerrero.
2010-12-12 16:07:11 +02:00
Lasse Collin
e6baedddcf DOS-like: Treat \ and : as directory separators in addition to /.
Juan Manuel Guerrero had fixed this in his XZ Utils port
to DOS/DJGPP. The bug affects also Windows and OS/2.
2010-12-12 14:50:04 +02:00
Lasse Collin
b7afd3e22a Translations: Fix Czech translation of "sparse file".
Thanks to Petr Hubený and Marek Černocký.
2010-12-07 18:52:04 +02:00
Lasse Collin
3e564704bc liblzma: Document the return value of lzma_lzma_preset(). 2010-11-15 14:28:26 +02:00
Jonathan Nieder
2964d8d691 Simplify paths in generated API docs
Currently the file list generated by Doxygen has src/ at the
beginning of each path.  Paths like common/sysdefs.h and
liblzma/api/lzma.h are easier to read without such a prefix.

Builds from a separate build directory with

	mkdir build
	cd build
	../configure
	doxygen Doxyfile

include an even longer prefix /home/someone/src/xz/src; this
patch has the nice side-effect of eliminating that prefix, too.

Fixes: http://bugs.debian.org/572273
2010-11-13 14:36:28 +02:00
Lasse Collin
37c25658ef Build: Copy the example programs to $docdir/examples.
The example programs by Daniel Mealha Cabrita were included
in the git repository, but I had forgot to add them to
Makefile.am. Thus, they didn't get included in the source
package at all by "make dist".
2010-10-26 15:48:48 +03:00
Lasse Collin
e45929260c Build: Fix mydist rule when .git doesn't exist. 2010-10-23 17:25:52 +03:00
Lasse Collin
6e1326fcdf Add NEWS for 5.0.0. 2010-10-23 14:15:35 +03:00
Lasse Collin
b667a3ef63 Bump version to 5.0.0 and liblzma version-info to 5:0:0. 2010-10-23 14:02:53 +03:00
Lasse Collin
8c947e9291 liblzma: Make lzma_code() check the reserved members in lzma_stream.
If any of the reserved members in lzma_stream are non-zero
or non-NULL, LZMA_OPTIONS_ERROR is returned. It is possible
that a new feature in the future is indicated by just setting
a reserved member to some other value, so the old liblzma
version need to catch it as an unsupported feature.
2010-10-23 12:30:54 +03:00
Lasse Collin
e61d85e082 Windows: Use MinGW's stdio functions.
The non-standard ones from msvcrt.dll appear to work
most of the time with XZ Utils, but there are some
corner cases where things may go very wrong. So it's
good to use the better replacements provided by
MinGW(-w64) runtime.
2010-10-23 12:26:33 +03:00
Lasse Collin
23e23f1dc0 liblzma: Use 512 as INDEX_GROUP_SIZE.
This lets compiler use shifting instead of 64-bit division.
2010-10-23 12:21:32 +03:00
Lasse Collin
613939fc82 liblzma: A few ABI tweaks to reserve space in structures. 2010-10-23 12:20:11 +03:00
Lasse Collin
68b83f252d xz: Make sure that message_strm() can never return NULL. 2010-10-21 23:16:11 +03:00
Lasse Collin
d09c5753e3 liblzma: Update the comments in the API headers.
Adding support for LZMA_FINISH for Index encoding and
decoding needed tiny additions to the relevant .c files too.
2010-10-21 23:06:31 +03:00
Lasse Collin
33c1c0e102 Update INSTALL.generic. 2010-10-19 12:08:30 +03:00
Lasse Collin
0076e03641 Clean up a few FIXMEs and TODOs.
lzma_chunk_size() was commented out because it is
currently useless.
2010-10-19 11:44:37 +03:00
Lasse Collin
ce34ec4f54 Update docs. 2010-10-19 10:21:08 +03:00
Lasse Collin
f0fa880d24 xz: Avoid raise() also on OpenVMS.
This is similar to DOS/DJGPP that killing the program
with a signal will print a backtrace or a similar message.
2010-10-12 15:13:30 +03:00
Lasse Collin
ac462b1c47 xz: Avoid SA_RESTART for portability reasons.
SA_RESTART is not as portable as I had hoped. It's missing
at least from OpenVMS, QNX, and DJGPP). Luckily we can do
fine without SA_RESTART.
2010-10-11 21:26:19 +03:00
Lasse Collin
d52b411716 xz: Use "%"PRIu32 instead of "%d" in a format string. 2010-10-10 17:58:58 +03:00
Lasse Collin
ae74d1bdeb test_files.sh: Fix the first line.
For some reason this prevented running the test only
on OS/2 and even on that it broke only recently.

Thanks to Elbert Pol.
2010-10-10 17:43:26 +03:00
Lasse Collin
d492b80ddd lzmainfo: Use "%"PRIu32 instead of "%u" for uint32_t. 2010-10-10 16:49:01 +03:00
Lasse Collin
825e859a90 lzmainfo: Use fileno(stdin) instead of STDIN_FILENO. 2010-10-10 16:47:01 +03:00
Lasse Collin
acbc4cdecb lzmainfo: Use setmode() on DOS-like systems. 2010-10-09 23:20:51 +03:00
Lasse Collin
ef364d3abc OS/2 and DOS: Be less verbose on signals.
Calling raise() to kill xz when user has pressed C-c
is a bit verbose on OS/2 and DOS/DJGPP. Instead of
calling raise(), set only the exit status to 1.
2010-10-09 21:51:03 +03:00
Lasse Collin
5629c4be07 DOS: Update the Makefile, config.h and README.
This is now simpler and builds only xz.exe.
2010-10-09 19:28:49 +03:00
Lasse Collin
f25a77e6b9 Windows: Put some license info into README-Windows.txt. 2010-10-09 18:57:55 +03:00
Lasse Collin
e75100f549 Windows: Fix a diagnostics bug in build.bash. 2010-10-09 18:57:04 +03:00
Lasse Collin
efeb998a2b lzmainfo: Add Windows resource file. 2010-10-09 13:02:15 +03:00
Lasse Collin
389d418445 Add missing public domain notice to lzmadec_w32res.rc. 2010-10-09 12:57:25 +03:00
Lasse Collin
6389c773a4 Windows: Update common_w32res.rc. 2010-10-09 12:52:12 +03:00
Lasse Collin
71275457ca Windows: Make build.bash prefer MinGW-w32 over MinGW.
This is simply for licensing reasons. The 64-bit version
will be built with MinGW-w64 anyway (at least for now),
so using it also for 32-bit build allows using the same
copyright notice about the MinGW-w64/w32 runtime.

Note that using MinGW would require a copyright notice too,
because its runtime is not in the public domain either even
though MinGW's home page claims that it is public domain.
See <http://marc.info/?l=mingw-users&m=126489506214078>.
2010-10-09 12:27:08 +03:00
Lasse Collin
3ac35719d8 Windows: Copy COPYING-Windows.txt (if it exists) to the package.
Also, put README-Windows.txt to the doc directory like
the other documentation files.
2010-10-09 11:33:21 +03:00
Lasse Collin
7b5db576fd Windows: Fix build.bash again.
630a8beda3 wasn't good.
2010-10-08 21:42:37 +03:00
Lasse Collin
d3cd7abe85 Use LZMA_VERSION_STRING instead of PACKAGE_VERSION.
Those are the same thing, and the former makes it a bit
easier to build the code with other build systems, because
one doesn't need to update the version number into custom
config.h.

This change affects only lzmainfo. Other tools were already
using LZMA_VERSION_STRING.
2010-10-08 16:53:20 +03:00
Lasse Collin
084c60d318 configure.ac: Remove two unused defines. 2010-10-08 15:59:25 +03:00
Lasse Collin
11f51b6714 Make tests accommodate missing xz or xzdec. 2010-10-08 15:32:29 +03:00
Lasse Collin
b1c7368f95 Build: Add options to disable individual command line tools. 2010-10-08 15:25:45 +03:00
Lasse Collin
630a8beda3 Windows: Make build.bash work without --enable-dynamic=no. 2010-10-07 00:44:53 +03:00
Lasse Collin
f9907503f8 Build: Remove the static/dynamic tricks.
Most distros want xz linked against shared liblzma, so
it doesn't help much to require --enable-dynamic for that.
Those who want to avoid PIC on x86-32 to get better
performance, can still do it e.g. by using --disable-shared
to compile xz and then another pass to compile shared liblzma.

Part of these static/dynamic tricks were needed for Windows
in the past. Nowadays we rely on GCC and binutils to do the
right thing with auto-import. If the Autotooled build system
needs to support some other toolchain on Windows in the future,
this may need some rethinking.
2010-10-05 14:13:16 +03:00
Lasse Collin
fda4724d81 configure.ac: Silence a warning from Autoconf 2.68. 2010-10-05 12:18:58 +03:00
Lasse Collin
80b5675fa6 A few more languages files to the xz man page.
Thanks to Jonathan Nieder.
2010-10-04 19:43:01 +03:00
Lasse Collin
f9722dbeca Update the FAQ. 2010-10-02 12:07:33 +03:00
Lasse Collin
61ae593661 liblzma: Small fixes to comments in the API headers. 2010-10-02 11:38:20 +03:00
Lasse Collin
9166682dc6 Create the PDF versions of the man pages better. 2010-09-28 11:40:12 +03:00
Lasse Collin
17d3c61edd Move version.sh to build-aux. 2010-09-28 10:59:53 +03:00
Lasse Collin
84af9d8770 Update .gitignore. 2010-09-28 10:53:02 +03:00
Lasse Collin
31575a449a Fix accomodate -> accommodate on the xz man page. 2010-09-28 01:17:14 +03:00
Lasse Collin
cec0ddc8ec Major man page updates.
Lots of content was updated on the xz man page.

Technical improvements:
  - Start a new sentence on a new line.
  - Use fairly short lines.
  - Use constant-width font for examples (where supported).
  - Some minor cleanups.

Thanks to Jonathan Nieder for some language fixes.
2010-09-27 23:29:34 +03:00
Lasse Collin
075257ab04 Fix the preset -3e.
depth=0 was missing.
2010-09-26 18:10:31 +03:00
Lasse Collin
2577da9ebd Add translations.bash and translation notes to README.
translations.bash prints some messages from xz, which
hopefully makes it a bit easier to test translations.
2010-09-23 14:03:10 +03:00
Lasse Collin
a3c5997c57 xz: Update the Czech translation.
Thanks to Marek Černocký.
2010-09-17 22:14:30 +03:00
Lasse Collin
a1766af582 xz: Add Italian translation.
Thanks to Milo Casagrande and Lorenzo De Liso.
2010-09-16 23:40:41 +03:00
Lasse Collin
2108801855 xz: Edit a translators comment. 2010-09-15 00:34:13 +03:00
Lasse Collin
be16e28ece xz: Add German translation.
Thanks to Andre Noll.
2010-09-14 22:47:14 +03:00
Lasse Collin
e23ea74f32 Updated README. 2010-09-10 14:30:25 +03:00
Lasse Collin
8dad2fd693 Updated INSTALL. 2010-09-10 14:30:07 +03:00
Lasse Collin
0b5f07fe37 Updated the git repository address in ChangeLog. 2010-09-10 14:26:20 +03:00
Lasse Collin
a8760203f9 xz: Add a comment to translators about "literal context bits". 2010-09-10 14:09:33 +03:00
Lasse Collin
bb0b1004f8 xz: Multiple fixes.
The code assumed that printing numbers with thousand separators
and decimal points would always produce only US-ASCII characters.
This was used for buffer sizes (with snprintf(), no overflows)
and aligning columns of the progress indicator and --list. That
assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so
multibyte character support was added in this commit. The old
way is used if the operating system doesn't have enough multibyte
support (e.g. lacks wcwidth()).

The sizes of buffers were increased to accomodate multibyte
characters. I don't know how big they should be exactly, but
they aren't used for anything critical, so it's not too bad.
If they still aren't big enough, I hopefully get a bug report.
snprintf() takes care of avoiding buffer overflows.

Some static buffers were replaced with buffers allocated on
stack. double_to_str() was removed. uint64_to_str() and
uint64_to_nicestr() now share the static buffer and test
for thousand separator support.

Integrity check names "None" and "Unknown-N" (2 <= N <= 15)
were marked to be translated. I had forgot these, plus they
wouldn't have worked correctly anyway before this commit,
because printing tables with multibyte strings didn't work.

Thanks to Marek Černocký for reporting the bug about
misaligned table columns in --list output.
2010-09-10 10:30:33 +03:00
Lasse Collin
639f8e2af3 Update the Czech translation.
Thanks to Marek Černocký.
2010-09-08 08:49:22 +03:00
Lasse Collin
41bc9956eb xz: Add a note to translators. 2010-09-07 12:31:40 +03:00
Lasse Collin
77a7746616 Fix use of N_() and ngettext().
I had somehow thought that N_() is usually used
as shorthand for ngettext().

This also fixes a missing \n from a call to ngettext().
2010-09-07 10:42:13 +03:00
Lasse Collin
e6ad393358 Add missing files to POTFILES.in. 2010-09-06 19:43:12 +03:00
Lasse Collin
58f5513182 xz: Improve a comment. 2010-09-06 10:16:24 +03:00
Lasse Collin
bcb1b89834 xz: Update the comment about NetBSD in file_io.c.
Thanks to Joerg Sonnenberger.
2010-09-05 21:34:29 +03:00
Lasse Collin
da014d5597 xz: Use an array instead of pointer for stdin_filename.
Thanks Joerg Sonnenberger.
2010-09-05 21:11:33 +03:00
Lasse Collin
8c7d3d1a07 xz: Hopefully ease translating the messages in list.c. 2010-09-05 12:16:17 +03:00
Lasse Collin
ef840950ad xz: Fix grammar. 2010-09-04 23:14:44 +03:00
Lasse Collin
c46afd6edc xz: Use lzma_lzma_preset() to initialize the options structure. 2010-09-04 23:12:20 +03:00
Lasse Collin
8fd3ac046d Don't set lc=4 with --extreme.
This should reduce the cases where --extreme makes
compression worse. On the other hand, some other
files may now benefit slightly less from --extreme.
2010-09-04 22:16:28 +03:00
Lasse Collin
474bac0c33 xz: Minor improvements to --help and --long-help. 2010-09-04 22:10:32 +03:00
Jonathan Nieder
373ee26f95 Adjust memory limits in test_compress.sh
Testing compression at level -4 now requires 48 MiB of free store at
compression time and 5 MiB at decompression time.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2010-09-04 00:56:14 +03:00
Lasse Collin
2fce9312f3 xz: Make -vv show also decompressor memory usage. 2010-09-03 15:54:40 +03:00
Lasse Collin
b4b1cbcb53 Tweak the compression presets -0 .. -5.
"Extreme" mode might need some further tweaking still.
Docs were not updated yet.
2010-09-03 15:13:12 +03:00
Lasse Collin
77fe5954cd liblzma: Adjust default depth calculation for HC3 and HC4.
It was 8 + nice_len / 4, now it is 4 + nice_len / 4.
This allows faster settings at lower nice_len values,
even though it seems that I won't use automatic depth
calcuation with HC3 and HC4 in the presets.
2010-09-03 12:28:41 +03:00
Lasse Collin
fce69059cf xz: Make --help two lines shorter.
At least for now, the --help option doesn't list any
options that take arguments, so "Mandatory arguments to..."
can be omitted.
2010-09-03 11:11:25 +03:00
Lasse Collin
a848e47ced xz: Make setting a preset override a custom filter chain.
This is more logical behavior than ignoring preset level
options once a custom filter chain has been specified.
2010-09-02 19:22:35 +03:00
Lasse Collin
b3ff7ba044 xz: Always warn if adjusting dictionary size due to memlimit. 2010-09-02 19:09:57 +03:00
Lasse Collin
d5653ba8a1 Fix test_compress.sh.
It broke when --memory option was removed from xzdec.

Thanks to Jonathan Nieder.
2010-08-10 11:04:30 +03:00
Lasse Collin
792331bdee Disable the memory usage limiter by default.
For several people, the limiter causes bigger problems that
it solves, so it is better to have it disabled by default.
Those who want to have a limiter by default need to enable
it via the environment variable XZ_DEFAULTS.

Support for environment variable XZ_DEFAULTS was added. It is
parsed before XZ_OPT and technically identical with it. The
intended uses differ quite a bit though; see the man page.

The memory usage limit can now be set separately for
compression and decompression using --memlimit-compress and
--memlimit-decompress. To set both at once, -M or --memlimit
can be used. --memory was retained as a legacy alias for
--memlimit for backwards compatibility.

The semantics of --info-memory were changed in backwards
incompatible way. Compatibility wasn't meaningful due to
changes in the memory usage limiter functionality.

The memory usage limiter info is no longer shown at the
bottom of xz --long -help.

The memory usage limiter support for removed completely from xzdec.

xz's man page was updated to match the above changes. Various
unrelated fixes were also made to the man page.
2010-08-07 20:45:18 +03:00
Lasse Collin
4a45dd4c39 Add missing const to a global constant in xz. 2010-08-06 20:22:16 +03:00
Lasse Collin
01aa4869cb Language fixes for man pages.
Thanks to A. Costa and Jonathan Nieder.
2010-07-28 11:44:55 +03:00
Lasse Collin
ce1f0deafe Windows: Add a note about building a Git repository snapshot 2010-07-27 20:47:12 +03:00
Lasse Collin
507a4a4dea Windows: build.sh is a bash script so name it correctly. 2010-07-27 20:45:03 +03:00
Lasse Collin
b1cbfd40f0 Windows: Don't strip liblzma.a too much. 2010-07-27 20:27:32 +03:00
Lasse Collin
a540198ffb Updated THANKS. 2010-07-13 20:07:26 +03:00
Lasse Collin
bab0f01ed9 Add two simple example programs.
Hopefully these help a bit when learning the basics
of liblzma API. I plan to write detailed examples about
both basic and advanced features with lots of comments,
but these two examples are good have right now.

The examples were written by Daniel Mealha Cabrita. Thanks.
2010-07-13 19:55:50 +03:00
Lasse Collin
c15c42abb3 Add --no-adjust. 2010-06-15 14:06:29 +03:00
Lasse Collin
2130926dd1 Updated THANKS. 2010-06-11 21:51:32 +03:00
Lasse Collin
bc612d0e0c Clarify the description of the default memlimit in the man page.
Thanks to Denis Excoffier.
2010-06-11 21:48:32 +03:00
Lasse Collin
e1b6935d60 Fix string to uint64_t conversion.
Thanks to Denis Excoffier for the bug report.
2010-06-11 21:43:28 +03:00
Lasse Collin
3e49c8acb0 Put the git commit to the filename in mydist rule. 2010-06-11 10:40:28 +03:00
Lasse Collin
d8b41eedce Fix compiling with -Werror. 2010-06-02 23:13:55 +03:00
Lasse Collin
b5fbab6123 Silence a bogus Valgrind warning.
When using -O2 with GCC, it liked to swap two comparisons
in one "if" statement. It's otherwise fine except that
the latter part, which is seemingly never executed, got
executed (nothing wrong with that) and then triggered
warning in Valgrind about conditional jump depending on
uninitialized variable. A few people find this annoying
so do things a bit differently to avoid the warning.
2010-06-02 23:09:22 +03:00
Lasse Collin
29a7b250e6 Fix a Windows-specific FIXME in signal handling code. 2010-06-02 21:32:12 +03:00
Lasse Collin
e89d987056 Adjust SA_RESTART workaround.
I want to get a bug report if something else than
DJGPP lacks SA_RESTART.
2010-06-02 17:46:58 +03:00
Lasse Collin
e243145c84 xz man page updates.
- Concatenating .xz files and padding
- List mode
- Robot mode
- A few examples (but many more are needed)
2010-06-01 16:02:30 +03:00
Lasse Collin
ce6dc3c0a8 Major update to xz --list. 2010-06-01 15:51:44 +03:00
Lasse Collin
905e54804a Rename message_filters_get() to message_filters_to_str(). 2010-06-01 14:13:03 +03:00
Lasse Collin
4b346ae8af Fix a comment. 2010-06-01 14:09:12 +03:00
Lasse Collin
07dc34f6da Fix lzma_block_compressed_size(). 2010-05-27 16:17:42 +03:00
Lasse Collin
44d70cb154 Take Cygwin into account in some #if lines.
This change is no-op, but good to have just in case
for the future.
2010-05-27 14:32:51 +03:00
Lasse Collin
a334348dc0 Remove references to the Subblock filter in xz and tests.
Thanks to Jonathan Nieder.
2010-05-27 13:42:44 +03:00
Lasse Collin
70e5e2f6a7 Remove unused chunk_size.c.
Thanks to Jonathan Nieder for the reminder.
2010-05-27 13:35:36 +03:00
Jonathan Nieder
01a414eaf4 Use my_min() instead of MIN() in src/xz/list.c
This should have been done in
920a69a8d8.
2010-05-27 13:30:48 +03:00
Lasse Collin
920a69a8d8 Rename MIN() and MAX() to my_min() and my_max().
This should avoid some minor portability issues.
2010-05-26 10:36:46 +03:00
Lasse Collin
019ae27c24 Fix compilation of debug/known_sizes.c. 2010-05-26 10:30:20 +03:00
Lasse Collin
98a4856a6e Remove references to Subblock filter in debug/sync_flush.c. 2010-05-26 10:28:54 +03:00
Lasse Collin
703d2c33c0 Better #error message. 2010-05-26 10:16:57 +03:00
Lasse Collin
d8a55c48b3 Remove the Subblock filter code for now.
The spec isn't finished and the code didn't compile anymore.
It won't be included in XZ Utils 5.0.0. It's easy to get it
back once the spec is done.
2010-05-26 09:55:47 +03:00
Lasse Collin
b6377fc990 Split message_filters().
message_filters_to_str() converts the filter chain to
a string. message_filters_show() replaces the original
message_filters().

uint32_to_optstr() was also added to show the dictionary
size in nicer format when possible.
2010-05-16 18:42:22 +03:00
Lasse Collin
d9986db782 Omit lzma_restrict from the API headers.
It isn't really useful so omitting it makes things
shorter and slightly more readable.
2010-05-14 23:17:20 +03:00
Lasse Collin
0d3489efca Updated INSTALL. 2010-05-10 19:57:24 +03:00
Lasse Collin
3fb3d594a2 Updated THANKS. 2010-05-10 19:54:52 +03:00
Lasse Collin
6548e30465 Updates to tuklib_physmem and tuklib_cpucores.
Don't use #error to generate compile error, because some
compilers actually don't take it as an error. This fixes
tuklib_physmem on IRIX.

Fix incorrect error check for sysconf() return values.

Add AIX, HP-UX, and Tru64 specific code to detect the
amount RAM.

Add HP-UX specific code to detect the number of CPU cores.

Thanks a lot to Peter O'Gorman for initial patches,
testing, and debugging these fixes.
2010-05-10 19:54:15 +03:00
Lasse Collin
a290cfee3e Show both elapsed time and estimated remaining time in xz -v.
The extra space for showing both has been taken from the
sizes field. If the sizes grow big, bigger units than MiB
will be used. It makes it slightly difficult to see that
progress is still happening with huge files, but it should
be OK in practice.

Thanks to Trent W. Buck for <http://bugs.debian.org/574583>
and Jonathan Nieder for suggestions how to fix it.
2010-04-12 21:55:56 +03:00
Lasse Collin
a1f7a986b8 Add a simple tip to faq.txt about tar and xz.
Thanks to Gilles Espinasse.
2010-03-31 16:47:25 +03:00
Lasse Collin
c737eec91d Updated THANKS. 2010-03-22 21:03:03 +02:00
Lasse Collin
f4b2b52624 Fix xzgrep to not break if filenames have spaces or quotes.
Thanks to someone who reported the bug on IRC.
2010-03-07 19:52:25 +02:00
Lasse Collin
cf38da00a1 Treat all integer multiplier suffixes as base-2.
Originally both base-2 and base-10 were supported, but since
there seems to be little need for base-10 in XZ Utils, treat
everything as base-2 and also be more relaxed about the case
of the first letter of the suffix. Now xz will accept e.g.
KiB, Ki, k, K, kB, and KB, and interpret them all as 1024. The
recommended spelling of the suffixes are still KiB, MiB, and GiB.
2010-03-07 13:59:32 +02:00
Lasse Collin
00fc1211ae Consistently round up the memory usage limit in messages.
It still feels a bit wrong to round 1 byte to 1 MiB but
at least it is now done consistently so that the same
byte value is always rounded the same way to MiB.
2010-03-07 13:50:23 +02:00
Lasse Collin
9886d436ff Change the default of --enable-assume-ram from 32 to 128 MiB.
This is to allow files created with "xz -9" to be decompressed
if the amount of RAM cannot be determined.
2010-03-07 13:34:34 +02:00
Lasse Collin
2672bcc9f8 Increase the default memory usage limit on "low-memory" systems.
Previously the default limit was always 40 % of RAM. The
new limit is a little bit more complex:

  - If 40 % of RAM is at least 80 MiB, 40 % of RAM is used
    as the limit.

  - If 80 % of RAM is over 80 MiB, 80 MiB is used as the limit.

  - Otherwise 80 % of RAM is used as the limit.

This should make it possible to decompress files created with
"xz -9" on more systems. Swapping is generally more expected
on systems with less RAM, so higher default limit on them
shouldn't cause too bad surprises in terms of heavy swapping.
Instead, the higher default limit should reduce the number of
bad surprises when it used to prevent decompression of files
created with "xz -9". The DoS prevention system shouldn't be
a DoS itself.

Note that even with the new default limit, a system with 64 MiB
RAM cannot decompress files created with "xz -9" without user
overriding the limit. This should be OK, because if xz is going
to need more memory than the system has RAM, it will run very
very slowly and thus it's good that user has to override the limit
in that case.
2010-03-07 13:29:28 +02:00
Lasse Collin
5527b7269a Updated THANKS. 2010-03-06 21:36:19 +02:00
Lasse Collin
d0d1c51aea Fix missing initialization in lzma_strm_init().
With bad luck, lzma_code() could return LZMA_BUF_ERROR
when it shouldn't.

This has been here since the early days of liblzma.
It got triggered by the modifications made to the xz
tool in commit 18c10c30d2
but only when decompressing .lzma files. Somehow I managed
to miss testing that with Valgrind earlier.

This fixes <http://bugs.gentoo.org/show_bug.cgi?id=305591>.
Thanks to Rafał Mużyło for helping to debug it on IRC.
2010-03-06 21:17:20 +02:00
Lasse Collin
eb7d51a3fa Collection of language fixes to comments and docs.
Thanks to Jonathan Nieder.
2010-02-12 13:16:15 +02:00
Lasse Collin
4785f2021a Fix jl -> jb in ASM files. 2010-02-12 12:41:20 +02:00
Lasse Collin
6b50c9429b Use __APPLE__ instead of __MACH__ in ASM files.
This allows the files to work on HURD.

Thanks to Jonathan Nieder.
2010-02-12 12:31:22 +02:00
Lasse Collin
6503fde658 Subtle change to liblzma Block handling API.
lzma_block.version has to be initialized even for
lzma_block_header_decode(). This way a future version
of liblzma won't allocate memory in a way that an old
application doesn't know how to free it.

The subtlety of this change is that all current apps
using lzma_block_header_decode() will keep working for
now, because the only possible version value is zero,
and lzma_block_header_decode() unconditionally sets the
version to zero even now. Unless fixed, these apps will
break in the future if a new version of the Block options
is ever needed.
2010-02-07 19:48:06 +02:00
Lasse Collin
dd7c3841ff Fix wrong assertion.
This was added in 455e68c030.
2010-02-02 11:50:11 +02:00
Lasse Collin
9d67588c15 Updated TODO. 2010-02-01 22:48:42 +02:00
Lasse Collin
fef6333f52 Fix typos in comments. 2010-02-01 22:47:54 +02:00
Lasse Collin
455e68c030 Fix signal handling for --list. 2010-02-01 22:46:56 +02:00
Lasse Collin
82220a1490 Fix compression of symlinks with --force.
xz --force accepted symlinks, but didn't remove
them after successful compression. Instead, an error
message was displayed.
2010-02-01 11:44:45 +02:00
Lasse Collin
d4da177d5b Fix a comment. 2010-02-01 10:20:57 +02:00
Lasse Collin
f9dd797a42 Updated THANKS. 2010-01-31 23:43:54 +02:00
Lasse Collin
ee5ddb8b28 Updated TODO. 2010-01-31 23:41:29 +02:00
Lasse Collin
11936ad3f5 Mention TODO in README. 2010-01-31 23:35:04 +02:00
Lasse Collin
2901a8e7e8 Updated INSTALL. 2010-01-31 23:31:14 +02:00
Lasse Collin
8884e16864 Revise the Windows build files.
The old Makefile + config.h was deleted, because it
becomes outdated too easily and building with the
Autotools based build system works fine even on Windows.

windows/build.sh hasn't got much testing, but it should
work to build 32-bit x86 and x86-64 versions of XZ Utils
using MSYS, MinGW or MinGW-w32, and MinGW-w64.

windows/INSTALL-Windows.txt describes what packages are
needed and how to install them.

windows/README-Windows.txt is a readme file for the binary
package that build.sh hopefully builds.

There are no instructions about using Autotools for now,
so those using a git snapshot may want to run
"autoreconf -fi && ./configure && make mydist" on a UN*X
box and then copy the resulting .tar.gz to a Windows.
2010-01-31 23:28:51 +02:00
Lasse Collin
34eb5e201d Select the default integrity check type at runtime.
Previously it was set statically to CRC64 or CRC32
depending on options passed to the configure script.
2010-01-31 19:52:38 +02:00
Lasse Collin
96a4f840e3 Improve displaying of the memory usage limit. 2010-01-31 18:17:50 +02:00
Lasse Collin
b3cc4d8edd Don't use uninitialized sigset_t.
If signal handlers haven't been established, then it's
useless to try to block them, especially since the sigset_t
used for blocking hasn't been initialized yet.
2010-01-31 12:53:56 +02:00
Lasse Collin
231c3c7098 Delay opening the destionation file and other fixes.
The opening of the destination file is now delayed a little.
The coder is initialized, and if decompressing, the memory
usage of the first Block compared against the memory
usage limit before the destination file is opened. This
means that if --force was used, the old "target" file won't
be deleted so easily when something goes wrong very early.
Thanks to Mark K for the bug report.

The above fix required some changes to progress message
handling. Now there is a separate function for setting and
printing the filename. It is used also in list.c.

list_file() now handles stdin correctly (gives an error).

A useless check for user_abort was removed from file_io.c.
2010-01-31 12:01:54 +02:00
Lasse Collin
0dbd0641db Add list.h to src/xz/Makefile.am.
This should have been already in
0bc9eab243.
2010-01-29 22:48:04 +02:00
Lasse Collin
b4b1a56e0c Add lzmainfo.1 to manfiles list to convert to .txt and .pdf. 2010-01-29 13:24:27 +02:00
Lasse Collin
5574d64e03 Silence two compiler warnings on DOS-like systems. 2010-01-27 16:42:11 +02:00
Lasse Collin
b063cc34a3 Use PACKAGE_URL instead of custom PACKAGE_HOMEPAGE. 2010-01-27 13:31:03 +02:00
Lasse Collin
38b8035b5c Add a missing space to an error message.
Thanks to Robert Readman.
2010-01-26 23:37:46 +02:00
Lasse Collin
e5496f9628 Use past tense in error message in io_unlink().
Added a note to translators too.

Thanks to Robert Readman.
2010-01-26 22:53:37 +02:00
Lasse Collin
d9a9800597 Fix too small static buffer in util.c.
This was introduced in
0dd6d00766 two days ago.
2010-01-26 15:42:24 +02:00
Lasse Collin
d0b4bbf5da Minor comment fix. 2010-01-26 14:46:43 +02:00
Lasse Collin
0bc9eab243 Add initial version of xz --list.
This is a bit rough but should be useful for basic things.
Ideas (with detailed examples) about the output format are
welcome.

The output of --robot --list is not necessarily stable yet,
although I don't currently have any plans about changing it.

The man page hasn't been updated yet.
2010-01-24 23:50:54 +02:00
Lasse Collin
df254ce03b Add io_pread().
It will be used by --list.
2010-01-24 22:46:11 +02:00
Lasse Collin
ef68dd4a92 Set LC_NUMERIC=C when --robot is used.
It is to ensure that floating point numbers
will always have a dot as the decimal separator.
2010-01-24 22:45:14 +02:00
Lasse Collin
0dd6d00766 Some improvements to printing sizes in xz. 2010-01-24 16:57:40 +02:00
Lasse Collin
2a98fdffd6 Fix a typo in README.
Thanks to R. Bijker.
2010-01-20 22:02:35 +02:00
Lasse Collin
07a11dad44 Updated windows/Makefile.
Thanks to Dan Shechter for the patch.

It is likely that windows/Makefile will be removed
completely, because Autotols based build nowadays
works well with both 32-bit and 64-bit MinGW (I
just need to update the docs).
2010-01-17 11:59:54 +02:00
Lasse Collin
37f31ead9d Update the xz man page to match the previous two commits. 2010-01-15 11:05:11 +02:00
Lasse Collin
3ffd5d81a4 Don't read compressed data from a terminal or write it
to a terminal even if --force is specified.

It just seems more reasonable this way.

The new behavior matches bzip2. The old one matched gzip.
2010-01-13 19:10:25 +02:00
Lasse Collin
23ac2c44c3 Don't compress or decompress special files unless writing
to stdout even if --force is used.

--force will still enable compression of symlinks, but only
in case they point to a regular file.

The new way simply seems more reasonable. It matches gzip's
behavior while the old one matched bzip2's behavior.
2010-01-13 18:12:40 +02:00
Lasse Collin
cee12aa852 Updated THANKS. 2010-01-12 16:30:33 +02:00
Lasse Collin
153c7740c5 Add IRIX-specific code to tuklib_physmem and tuklib_cpucores.
This is untested but it will get tested soon and, if needed,
fixed before 5.0.0.

Thanks to Stuart Shelton.
2010-01-12 16:18:14 +02:00
Lasse Collin
8ea8dc754a Fix _memconfig() functions.
This affects lzma_memusage() and lzma_memlimit_get().
2010-01-01 00:29:10 +02:00
Lasse Collin
1a7ec87c8e Revised the Index handling code.
This breaks API and ABI but most apps are not affected
since most apps don't use this part of the API. You will
get a compile error if you are using anything that got
broken.

Summary of changes:

  - Ability to store Stream Flags, which are needed
    for random-access reading in multi-Stream files.

  - Separate function to set size of Stream Padding.

  - Iterator structure makes it possible to read the same
    lzma_index from multiple threads at the same time.

  - A lot faster code to locate Blocks.

  - Removed lzma_index_equal() without adding anything
    to replace it. I don't know what it should do exactly
    with the new features and what actually needs this
    function in the first place other than test_index.c,
    which now has its own code to compare lzma_indexes.
2009-12-31 22:45:53 +02:00
Lasse Collin
f29997a846 Remove c-format tag in cs.po.
It was fixed in the C code earlier.
2009-12-31 21:13:25 +02:00
Lasse Collin
097bad0003 Add missing lzma_nothrow in filter.h. 2009-12-31 21:11:05 +02:00
Lasse Collin
b56cb1fc31 Remove redefinition of _(msgid) macro from lzmainfo.c. 2009-12-09 18:13:44 +02:00
Jonathan Nieder
171b03febf update po/.gitignore
Since the *.gmo files are deleted by the maintainer-clean target,
I assume they are not meant to be tracked.

Also add the other files listed in the Makefile’s clean targets
(stamp-poT, xz.po, xz.[12].po, *.new.po, xz.mo) to make sure they
are not accidentally tracked.  Most of these are intermediate
files that would not appear unless a build is interrupted or
fails.

Split the list of untracked files by origin to make it easier to
tell if files are missing in the future.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2009-12-09 10:56:43 +02:00
Lasse Collin
f7e44c6c11 Always rely on GCC's auto-import on Windows.
I understood that this is nicer, because then people
don't need to worry about the LZMA_API_STATIC macro.

Thanks to Charles Wilson and Keith Marshall.
2009-12-09 00:38:55 +02:00
Lasse Collin
7b76a3e233 Fix file_io.c on DOS-like systems.
The problem was introduced when adding sparse file
support in 465d1b0d65.

Thanks to Charles Wilson.
2009-12-07 21:46:53 +02:00
Lasse Collin
0696f5d268 Add Czech translation.
Thanks to Marek Černocký.

Other people planning to translate xz: Note that the
messages are a little bit in flux still. Translations
are still welcome, just be prepared to some extra work
in case there are changes.
2009-12-07 20:54:21 +02:00
Lasse Collin
5e817a50d2 Add a note for translators to add a bug reporting address
for translation bugs.
2009-12-07 20:32:08 +02:00
Lasse Collin
6db1c35be9 Prevent xgettext from taking one regular string as a C format string.
Thanks to Marek Černocký.
2009-12-07 20:07:02 +02:00
Lasse Collin
e0c2776b6f Remove duplicate code in io_open_dest().
Fix a missing _() in the error message too.
2009-11-28 17:45:22 +02:00
Lasse Collin
f057a33c6f Typo fix to sysdefs.h.
Thanks to Jonathan Nieder.
2009-11-26 10:11:23 +02:00
Lasse Collin
8767b41534 Fix a memory leak in test_index.c.
This was introduced in
bd13b04e20.

Thanks to Jim Meyering for noticing it.
2009-11-26 10:10:36 +02:00
Lasse Collin
919fbaff86 Add missing error check to coder.c.
With bad luck this could cause a segfault due to
reading (but not writing) past the end of the buffer.
2009-11-25 14:22:19 +02:00
Lasse Collin
bd13b04e20 Fix bugs in lzma_index_read() and lzma_index_cat().
lzma_index_read() didn't skip over Stream Padding
if it was the first record in the Index.

lzma_index_cat() didn't combine small Indexes correctly.

The test suite was updated to check for these bugs.

These bugs didn't affect the xz command line tool or
most users of liblzma in any way.
2009-11-25 13:04:10 +02:00
Lasse Collin
1f19690914 Index decoder fixes.
The Index decoder code didn't perfectly match the API docs,
which said that *i will be set to point to the decoded Index
only after decoding has succeeded. The docs were a bit unclear
too.

Now the decoder will initially set *i to NULL. *i will be set
to point to the decoded Index once decoding has succeeded.
This simplifies applications too, since it avoids dangling
pointers.
2009-11-25 12:52:56 +02:00
Lasse Collin
465d1b0d65 Create sparse files by default when decompressing into
a regular file.

Sparse file creation can be disabled with --no-sparse.
I don't promise yet that the name of this option won't
change before 5.0.0. It's possible that the code, that
checks when it is safe to use sparse output on stdout,
is not good enough, and a more flexible command line
option is needed to configure sparse file handling.
2009-11-25 11:19:20 +02:00
Lasse Collin
37de544414 Updated THANKS. 2009-11-22 12:43:06 +02:00
Lasse Collin
f1a28b96c9 Add missing consts to pointer casts. 2009-11-22 12:05:33 +02:00
Lasse Collin
b9b5c54cd4 Enable assembler code only if it is known to work
on that operating system.

I'm too lazy to think how to make a good Autoconf test
for this and it's not that important anyway.

No longer define HAVE_ASM_X86 or HAVE_ASM_X86_64.
Inline assembler (if any) is used if a macro like
__i386__ or __x86_64__ is defined.
2009-11-22 12:00:30 +02:00
Lasse Collin
0733f4c999 Make fastpos.h use tuklib_integer.h instead of bsr.h
when --enable-small has been specified.
2009-11-22 11:55:03 +02:00
Lasse Collin
7ac3985d89 Update tuklib_integer.h with bit scan functions.
Thanks to Joachim Henke for the original patch.
2009-11-22 11:52:30 +02:00
Lasse Collin
c74c132f7f Update tuklib_cpucores.m4 and tuklib_physmem.m4 from tuklib,
which now use AC_CACHE_CHECK. Using the cache variable,
configure now warns if there is no method to detect the amount
of RAM and recommends using --enable-assume-ram.
2009-11-20 12:51:19 +02:00
Lasse Collin
d315ca4930 Add support for --info-memory and --robot to xz.
Currently --robot works only with --info-memory and
--version. --help and --long-help work too, but --robot
has no effect on them.

Thanks to Jonathan Nieder for the original patches.
2009-11-16 18:16:45 +02:00
Lasse Collin
e330fb7e6b Fix wrong indentation caused by incorrect settings
in the text editor.
2009-11-15 12:54:45 +02:00
Lasse Collin
93e418562c Add lzma_physmem().
I had hoped to keep liblzma as purely a compression
library as possible (e.g. file I/O will go into
a different library), but it seems that applications
linking agaisnt liblzma need some way to determine
the memory usage limit, and knowing the amount of RAM
is one reasonable way to help making such decisions.

Thanks to Jonathan Nieder for the original patch.
2009-11-15 12:40:17 +02:00
Lasse Collin
cf39faca59 Updated THANKS. 2009-11-14 20:21:19 +02:00
Lasse Collin
2ddcae247c Some updates to xz man page. 2009-11-14 20:20:03 +02:00
Lasse Collin
19b2674f07 Fix description of --memory in --long-help. 2009-11-14 19:51:03 +02:00
Lasse Collin
2291346f0c Update the debug programs so that they compile again. 2009-11-14 19:45:39 +02:00
Lasse Collin
418d64a32e Fix a design error in liblzma API.
Originally the idea was that using LZMA_FULL_FLUSH
with Stream encoder would read the filter chain
from the same array that was used to intialize the
Stream encoder. Since most apps wouldn't use
LZMA_FULL_FLUSH, most apps wouldn't need to keep
the filter chain available after initializing the
Stream encoder. However, due to my mistake, it
actually required keeping the array always available.

Since setting the new filter chain via the array
used at initialization time is not a nice way to do
it for a couple of reasons, this commit ditches it
and introduces lzma_filters_update(). This new function
replaces also the "persistent" flag used by LZMA2
(and to-be-designed Subblock filter), which was also
an ugly thing to do.

Thanks to Alexey Tourbin for reminding me about the problem
that Stream encoder used to require keeping the filter
chain allocated.
2009-11-14 18:59:19 +02:00
Lasse Collin
f0bf7634b7 Fix wrong function name in the previous commit.
It was meant to be lzma_filters_copy(), not lzma_filters_dup().
2009-10-17 11:11:58 +03:00
Lasse Collin
6d118a0b9d Add lzma_filters_copy().
This will be needed internally by liblzma once I fix
a design mistake in the encoder API. This function may
be useful to applications too so it's good to export it.
2009-10-17 01:47:07 +03:00
Jonathan Nieder
78e92c1847 Escape dashes in xzmore.1
A minus sign is larger, easier to see in a printout, and more
likely to use the same glyph as ASCII hyphen-minus in a terminal
than a hyphen.  Since broken manual pagers do not find hyphens
when the user searches for a hyphen-minus, minus signs are also
easier to search for.  So use minus signs instead of hyphens to
render sample terminal output.
2009-10-16 20:39:24 +03:00
Lasse Collin
7b7fe902d9 Mention --check=none in --long-help. It was already in
the man page though.

Thanks to Jim Meyering for noticing this.
2009-10-16 20:35:39 +03:00
Lasse Collin
ebfb2c5e1f Use a tuklib module for integer handling.
This replaces bswap.h and integer.h.

The tuklib module uses <byteswap.h> on GNU,
<sys/endian.h> on *BSDs and <sys/byteorder.h>
on Solaris, which may contain optimized code
like inline assembly.
2009-10-04 22:57:12 +03:00
Lasse Collin
29fd321033 Add support for --enable-assume-ram=SIZE. 2009-10-02 14:35:56 +03:00
Lasse Collin
3782b3fee4 Use unaligned access (if possible) on both endiannesses
in lz_encoder_hash.h.
2009-10-02 11:28:17 +03:00
Lasse Collin
c5f68b5cc7 Make liblzma produce the same output on both endiannesses.
Seems that it is a problem in some cases if the same
version of XZ Utils produces different output on different
endiannesses, so this commit fixes that problem. The output
will still vary between different XZ Utils versions, but I
cannot avoid that for now.

This commit bloatens the code on big endian systems by 1 KiB,
which should be OK since liblzma is bloated already. ;-)
2009-10-02 11:03:26 +03:00
Mike Frysinger
4a84d1adfd add lzmainfo to gitignore
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-27 11:53:48 +03:00
Lasse Collin
188a1dcd0c Updated THANKS. 2009-09-27 11:53:36 +03:00
Lasse Collin
db9119b918 Work around a bug in Interix header files.
Thanks to Markus Duft for the patch.
2009-09-27 11:48:54 +03:00
Lasse Collin
b3d105e697 Fix an error in OpenVMS-specific code.
Thanks to Jouk Jansen.
2009-09-24 17:50:17 +03:00
Lasse Collin
5e000ff00d Added OpenVMS-specific information to INSTALL. 2009-09-22 18:59:56 +03:00
Lasse Collin
932b2e2044 Better fixes for OpenVMS support.
Thanks to Jouk Jansen.
2009-09-22 14:03:02 +03:00
Lasse Collin
4c3630ec41 Avoid non-standard preprocessor construct.
Thanks to Jouk Jansen.
2009-09-22 13:40:19 +03:00
Lasse Collin
0deb1bb60a Make sure that TUKLIB_DOSLIKE doesn't get defined on Cygwin.
Thanks to Charles Wilson.
2009-09-21 19:50:09 +03:00
Lasse Collin
e599bba421 Various changes.
Separate a few reusable components from XZ Utils specific
code. The reusable code is now in "tuklib" modules. A few
more could be separated still, e.g. bswap.h.

Fix some bugs in lzmainfo.

Fix physmem and cpucores code on OS/2. Thanks to Elbert Pol
for help.

Add OpenVMS support into physmem. Add a few #ifdefs to ease
building XZ Utils on OpenVMS. Thanks to Jouk Jansen for the
original patch.
2009-09-19 09:47:30 +03:00
Lasse Collin
49cfc8d392 Fix incorrect use of "restrict". 2009-09-15 21:07:23 +03:00
Lasse Collin
15ffd675ab Fix GCC version check for nothrow attribute. 2009-09-12 14:09:17 +03:00
Lasse Collin
6bfdd3a88a Updated THANKS. 2009-09-12 14:08:15 +03:00
Lasse Collin
4ab7b16b95 A few grammar fixes.
Thanks to Christian Weisgerber for pointing out some of these.
2009-09-12 14:07:36 +03:00
Lasse Collin
8905a33daa Updated THANKS. 2009-09-11 17:08:15 +03:00
Lasse Collin
68059334ff Add PACKAGE_HOMEPAGE to {windows,dos}/config.h to fix build errors. 2009-09-11 17:06:32 +03:00
Lasse Collin
221be761f4 Use $(LN_EXEEXT) in symlinks to executables.
This fixes "make install" on operating systems using
a suffix for executables.

Cygwin is treated specially. The symlink names won't have
.exe suffix even though the executables themselves have.
Thanks to Charles Wilson.
2009-09-11 10:24:09 +03:00
Lasse Collin
18a4233a53 Fix a couple of warnings. 2009-09-11 09:25:09 +03:00
Lasse Collin
429910b2ba Add OS/2-specific code to physmem.h.
Also move DJGPP-specific code near the code meant
for other DOS-like systems.
2009-09-05 18:39:21 +03:00
Lasse Collin
7aca7b3174 Updated THANKS. 2009-09-05 01:21:15 +03:00
Lasse Collin
60ccb80c9c Use sysctl() != -1 instead of !sysctl() to check if
the function call succeeded.

NetBSD 4.0 returns positive values on success, but
NetBSD Current and FreeBSD return zero. OpenBSD's
man page doesn't tell what sysctl() returns on
success. All these BSDs return -1 on error.

Thanks to Robert Elz and Thomas Klausner.
2009-09-05 01:20:29 +03:00
Lasse Collin
173368911c Mention in INSTALL that --enable-small doesn't modify CFLAGS. 2009-09-02 09:43:51 +03:00
Lasse Collin
319a0fd7d7 Refactored option parsing. 2009-09-01 20:40:01 +03:00
Lasse Collin
25adaaa56e Fix options parsing bug in xz.
xz used to reject "xz --lzma2=pb=2," while
"xz --lzma2=pb=2,," worked. Now both work.
2009-09-01 20:23:30 +03:00
Lasse Collin
5f6dddc6c9 Updated TODO. 2009-09-01 20:20:19 +03:00
Lasse Collin
655457b9ad Revert 43f44160b1
and use a fix that works on all systems using
GNU assembler.

Maybe the assembler code is used e.g. on Solaris x86
but let's worry about it if this doesn't work on it.
2009-08-31 21:59:25 +03:00
Lasse Collin
162189c347 Updated THANKS. 2009-08-30 17:29:19 +03:00
Lasse Collin
2331f5f97a Add more OS/2 specific info to INSTALL. 2009-08-30 17:28:52 +03:00
Lasse Collin
94c66b3297 Use even more hackish way to support thousand separators.
Seems that in addition on Windows and DOS, also OpenBSD
lacks support for %'d style printf() format strings.
So far that is the only modern POSIX-like system I know
with this problem, but after this hack, the thousand
separator shouldn't be a problem on any system.

Maybe testing if a format string like %'d produces
reasonable output is invoking undefined behavior on some
systems, but so far all the problematic systems I've tried
just print the raw format string (e.g. %'d prints 'd).

Maybe Autoconf test would have been better, but this
hack works also for cross-compilation, and avoids
recompilation in case the system libc starts to support
the thousand separator.
2009-08-29 14:43:52 +03:00
Lasse Collin
3432e9c6aa Updated THANKS. 2009-08-29 13:42:56 +03:00
Lasse Collin
27414daadf Fix sysctl() usage.
This fixes build on *BSDs and Darwin.

Thanks to Jukka Salmi for the patches.
Richard Koch reported the problem too.
2009-08-29 13:39:21 +03:00
Lasse Collin
43f44160b1 Fix x86 assembler on GCC 3.
Thanks to Karl Berry.
2009-08-29 13:35:23 +03:00
Lasse Collin
682efdc1f9 "make dist" fixes 2009-08-27 18:36:59 +03:00
Lasse Collin
c8c184db1c Update xz man page date. 2009-08-27 17:08:33 +03:00
Lasse Collin
9756fce565 Fix the debug directory.
6a2eb54092 and
71f18e8a06 required
some changes that weren't applied in debug.
2009-08-27 17:00:22 +03:00
Lasse Collin
77007a7fb2 Add missing files to EXTRA_DIST. 2009-08-27 16:36:40 +03:00
Lasse Collin
04dcbfdeb9 Bumped version to 4.999.9beta. 2009-08-27 16:21:22 +03:00
Lasse Collin
fd7618611a Updated THANKS. 2009-08-27 16:17:47 +03:00
Lasse Collin
c29e76c0f9 .xz file format specification 1.0.4 (probably).
Thanks to Christian von Roques, Peter Lawler,
and Jim Meyering for the fixes.
2009-08-27 16:12:52 +03:00
Lasse Collin
696d7ee395 Require GNU libtool 2.2. 2009-08-27 15:43:54 +03:00
Lasse Collin
4c3558aa83 Add "dos" to EXTRA_DIST. 2009-08-27 15:34:45 +03:00
Lasse Collin
35b29e4424 Updated TODO. 2009-08-27 15:23:27 +03:00
Lasse Collin
2341437719 Some xz man page improvements. 2009-08-27 15:17:00 +03:00
Lasse Collin
371b04e19f Removed doc/bugs.txt. 2009-08-27 10:41:01 +03:00
Lasse Collin
d88c4072b3 Updated README.
It now includes bug reporting instructions/tips.
2009-08-27 10:40:25 +03:00
Lasse Collin
92e536d8b8 Fix a typo in FAQ.
Thanks to Jim Meyering.

(From now on, I try to always remember to put
the relevant thanks to commit messages.)
2009-08-27 10:21:18 +03:00
Lasse Collin
3e2ba8b585 Updates to liblzma API headers.
Added lzma_nothrow for every function. It adds
throw() when the header is used in C++ code.

Some lzma_attrs were added or removed.

Lots of comments were improved.
2009-08-27 10:13:46 +03:00
Lasse Collin
8e8ebc17c5 Install faq.txt. 2009-08-18 00:30:09 +03:00
Lasse Collin
b198e770a1 Updated faq.txt.
Some questions worth answering were removed, because I
currently don't have good up to date answers to them.
2009-08-18 00:26:48 +03:00
Lasse Collin
fe111a25cd Some xz man changes. 2009-08-17 22:45:50 +03:00
Lasse Collin
10242a21e9 Updated THANKS. 2009-08-16 22:15:42 +03:00
Lasse Collin
3ce1916c83 Fix data corruption in LZ/LZMA2 encoder.
Thanks to Jonathan Stott for the bug report.
2009-08-16 22:15:13 +03:00
Lasse Collin
66da129c8e Updated INSTALL and PACKAGERS to match the changes
made in --enable-dynamic.
2009-08-13 15:15:37 +03:00
Lasse Collin
8238c4b240 Link lzmainfo against shared liblzma by default. 2009-08-13 15:03:46 +03:00
Lasse Collin
71f18e8a06 Make --enable-dynamic a tristate option.
Some programs will by default be linked against static
liblzma and some against shared liblzma. --enable-dynamic
now allows overriding the default to both directions
(all dynamic or all static) even when building both
shared and static liblzma.

This is quite messy compared to how simple thing it is supposed
to be. The complexity is mostly due to Windows support.
2009-08-13 15:00:21 +03:00
Lasse Collin
5aa4678b23 Fix xz Makefile.am for the man page.
install-exec-hook -> install-data-hook
2009-08-13 12:56:47 +03:00
Lasse Collin
e51b4e49e8 Add lzmainfo for backward compatibility with LZMA Utils.
lzmainfo now links against static liblzma. In contrast
to other command line tools in XZ Utils, linking lzmainfo
against static liblzma by default is dumb. This will be
fixed once I have fixed some related issues in configure.ac.
2009-08-13 12:55:45 +03:00
Lasse Collin
a4165d0584 Sync some error messages from xz to xzdec.
Make xz error message translation usable outside
xz (at least in upcoming lzmainfo).
2009-08-13 12:42:36 +03:00
Lasse Collin
df636eb4e0 Add xz man page to manfiles in toplevel Makefile.am. 2009-08-13 09:37:21 +03:00
Lasse Collin
180bdf58ea Fix first line of xz man page. 2009-08-13 09:37:01 +03:00
Lasse Collin
e1ce2291e7 Added a rough version of the xz man page. 2009-08-10 11:22:31 +03:00
Jonathan Nieder
e71903fc61 “xzdiff a.xz b.xz” always fails
Attempts to compare two compressed files result in no output and
exit status 2.

Instead of going to standard output, ‘diff’ output is being
captured in the xz_status variable along with the exit status from
the decompression commands.  Later, when this variable is examined
for nonzero status codes, numerals from dates in the ‘diff’ output
make it appear as though decompression failed.

So let the ‘diff’ output leak to standard output with another file
descriptor.  (This trick is used in all similar contexts elsewhere
in xzdiff and in the analogous context in gzip’s zdiff script.)
2009-08-09 22:55:19 +03:00
Jonathan Nieder
1d314b81aa xzless: Support compressed standard input
It can be somewhat confusing that

	less < some_file.txt

works fine, whereas

	xzless < some_file.txt.xz

does not.  Since version 429, ‘less’ allows a filter specified in
the LESSOPEN environment variable to preprocess its input even if
it comes from standard input, if $LESSOPEN begins with ‘|-’.  So
set $LESSOPEN to take advantage of this feature.

Check less’s version at runtime so xzless can continue to work
with older versions.
2009-08-09 22:27:22 +03:00
Lasse Collin
a7f5d2fe48 GPLv2+ not GPLv2 for Doxyfile.in is probably OK. 2009-08-09 20:57:46 +03:00
Lasse Collin
b735cde20c Added a copyright notice to Doxyfile.in since it contains
lots of comments from Doxygen.

It seems that the Doxygen authors' intent is to not apply
their copyright on generated files, but since it doesn't
matter for XZ Utils at all, better safe than sorry.
2009-08-02 00:27:29 +03:00
Lasse Collin
0fd157cc00 Updated THANKS. 2009-08-02 00:11:37 +03:00
Lasse Collin
b198da96ff Updated TODO. 2009-08-02 00:10:22 +03:00
Lasse Collin
669413bb2d Updated THANKS. 2009-07-30 12:25:55 +03:00
Jonathan Nieder
dbbd8fb870 xzdiff: add missing ;; to case statement 2009-07-30 12:23:45 +03:00
Lasse Collin
adbad2d16c Added history.txt to doc_DATA. 2009-07-24 13:15:06 +03:00
Lasse Collin
e0236f1256 Updated .gitignore files. 2009-07-24 12:00:40 +03:00
Lasse Collin
2f34fb2692 Minor improvements to COPYING. 2009-07-24 11:34:02 +03:00
Lasse Collin
0db1befcfb Fix incorrect usage of getopt_long(), which caused
invalid memory access if XZ_OPT was defined.
2009-07-23 19:10:55 +03:00
Lasse Collin
8f8ec942d6 Avoid internal error with --format=xz --lzma1. 2009-07-20 15:43:32 +03:00
Lasse Collin
99f9e879a6 Major documentation update.
Installation and packaging instructions were added.
README and other generic docs were revised.

Some of the documentation files are now installed to $docdir.
2009-07-19 13:14:20 +03:00
Lasse Collin
ef4cf1851d Added missing author notice to xzless.in. 2009-07-19 11:09:31 +03:00
Lasse Collin
4c9c989d45 Use AC_CONFIG_AUX_DIR to clean up the toplevel directory
a little.

Fixed a related bug in the toplevel Makefile.am.

Added the build-aux directory to .gitignore.
2009-07-18 18:54:55 +03:00
Lasse Collin
366e436090 Updated the totally outdated TODO file. 2009-07-18 14:34:08 +03:00
Lasse Collin
64e498c89d Added public domain notice into a few files. 2009-07-18 11:26:39 +03:00
Lasse Collin
a35755c5de Allow extra commas in filter-specific options on xz command line.
This may slightly ease writing scripts that construct
filter-specific option strings dynamically.
2009-07-14 21:10:36 +03:00
Lasse Collin
98f3cac1ad Accept --lzma2=preset=6e where "e" is equivalent to --extreme
when no custom chain is in use.
2009-07-14 18:04:31 +03:00
Lasse Collin
d873a09e95 Add dist-hook to create ChangeLog from the commit log,
and to conver the man pages to PDF and plain text, which
may be convenient to those who cannot render man pages.
2009-07-12 19:08:30 +03:00
Lasse Collin
cd69a5a6c1 BCJ filters: Reject invalid start offsets with LZMA_OPTIONS_ERROR.
This is a quick and slightly dirty fix to make the code
conform to the latest file format specification. Without
this patch, it's possible to make corrupt files by
specifying start offset that is not a multiple of the
filter's alignment. Custom start offset is almost never
used, so this was only a minor bug.

The xz command line tool doesn't validate the start offset,
so one will get a bit unclear error message if trying to use
an invalid start offset.
2009-07-10 11:39:38 +03:00
Lasse Collin
eed9953732 Look for full command names instead of substrings
like "un", "cat", and "lz" when determining if
xz is run as unxz, xzcat, lzma, unlzma, or lzcat.

This is to ensure that if xz is renamed (e.g. via
--program-transform-name), it doesn't so easily
work in wrong mode.
2009-07-10 11:33:21 +03:00
Lasse Collin
6f62fa88f4 Updated THANKS. 2009-07-08 23:06:46 +03:00
Lasse Collin
1754b7e03e Portability improvement to version.sh. 2009-07-08 23:05:29 +03:00
Lasse Collin
3bdb53792c Remove --force from xzdec.
It was ignored for compatibility with xz, but now that
--decompress --stdout --force copies unrecognized files
as is to stdout, simply ignoring --force in xzdec would
be wrong. xzdec will not support copying unrecognized
data as is to stdout, so it cannot support --force.
2009-07-08 22:50:16 +03:00
Lasse Collin
5f16ef4abf Use sed instead of $(SED) so that we don't need to
use AC_PROG_SED. We don't do anything fancy with sed,
so this should work OK. libtool 2.2 sets SED but 1.5
doesn't, so $(SED) happened to work when using libtool 2.2.
2009-07-06 10:36:04 +03:00
Lasse Collin
96e4b257e1 Major update to the xzgrep and other scripts based on
the latest versions found from gzip CVS repository.

configure will try to find a POSIX shell to be used by
the scripts. This should ease portability on systems
which have pre-POSIX /bin/sh.

xzgrep and xzdiff support .xz, .lzma, .gz, and .bz2 files.
xzmore and xzless support only .xz and .lzma files.

The name of the xz executable used in these scripts is
now correct even if --program-transform-name has been used.
2009-07-05 22:25:17 +03:00
Lasse Collin
25cc7a6e8c Use @PACKAGE_HOMEPAGE@ in liblzma.pc.in. 2009-07-05 19:26:53 +03:00
Lasse Collin
18c10c30d2 Make "xz --decompress --stdout --force" copy unrecognized
files as is to standard output.

This feature is needed to be more compatible with gzip's
behavior. This was more complicated to implement than it
sounds, because the way liblzma is able to return errors with
files of only a few bytes in size. xz now has its own file
type detection code and no longer uses lzma_auto_decoder().
2009-07-04 00:40:44 +03:00
Lasse Collin
0a289c01ac Define PACKAGE_HOMEPAGE in configure.ac and use it in
xz and xzdec.

Use also PACKAGE_NAME instead of hardcoding "XZ Utils".
2009-07-02 14:30:38 +03:00
Lasse Collin
5cc99db5ba Avoid visibility related compiler warnings on Windows. 2009-07-01 12:21:24 +03:00
Lasse Collin
7653d1cf48 Use static liblzma by default also for tests. 2009-06-30 17:14:39 +03:00
Lasse Collin
f42ee98166 Build system fixes
Don't use libtool convenience libraries to avoid recently
discovered long-standing subtle but somewhat severe bugs
in libtool (at least 1.5.22 and 2.2.6 are affected). It
was found when porting XZ Utils to Windows
<http://lists.gnu.org/archive/html/libtool/2009-06/msg00070.html>
but the problem is significant also e.g. on GNU/Linux.

Unless --disable-shared is passed to configure, static
library built from a set of convenience libraries will
contain PIC objects. That is, while libtool builds non-PIC
objects too, only PIC objects will be used from the
convenience libraries. On 32-bit x86 (tested on mobile XP2400+),
using PIC instead of non-PIC makes the decompressor 10 % slower
with the default CFLAGS.

So while xz was linked against static liblzma by default,
it got the slower PIC objects unless --disable-shared was
used. I tend develop and benchmark with --disable-shared
due to faster build time, so I hadn't noticed the problem
in benchmarks earlier.

This commit also adds support for building Windows resources
into liblzma and executables.
2009-06-30 17:09:57 +03:00
Lasse Collin
89dac1db6f Added a comment about "autoconf -fi" to autogen.sh. 2009-06-29 22:19:51 +03:00
Lasse Collin
6e685aae45 Add -no-undefined to get shared liblzma on Windows. 2009-06-28 10:04:24 +03:00
Lasse Collin
73f560ee5f Make physmem() work on Cygwin 1.5 and older. 2009-06-27 22:57:15 +03:00
Lasse Collin
7ff0004fbc Moved the Windows resource files outside the windows directory
to prepare for building them with Autotools.
2009-06-27 17:28:01 +03:00
Lasse Collin
449c634674 Added missing $(EXEEXT). 2009-06-27 13:05:03 +03:00
Lasse Collin
792db79f27 Create correct symlinks even when
--program-{prefix,suffix,transform} is passed to configure.
2009-06-27 12:32:40 +03:00
Lasse Collin
0adc72feb8 Silence a compiler warning on DOS-like systems. 2009-06-27 10:02:24 +03:00
Lasse Collin
ad12edc952 Updated the filenames in POTFILES.in too. 2009-06-27 09:35:15 +03:00
Lasse Collin
b2b1f86753 Hopefully improved portability of the assembler code in
Autotools based builds on Windows.
2009-06-27 00:43:06 +03:00
Lasse Collin
c393055947 Updated THANKS (most of today's commits are based on
Charles Wilson's patches).
2009-06-26 21:17:29 +03:00
Lasse Collin
da0af22e4b Updated comments to match renamed files. 2009-06-26 21:00:35 +03:00
Lasse Collin
65014fd211 Rename process.[hc] to coder.[hc] and io.[hc] to file_io.[hc]
to avoid problems on systems with system headers with those
names.
2009-06-26 20:49:54 +03:00
Lasse Collin
5e1257466d Rename process_file() to coder_run(). 2009-06-26 20:43:36 +03:00
Lasse Collin
cad62551c5 Ugly hack to make it possible to use the thousand separator
format character with snprintf() on POSIX systems but not
on non-POSIX systems and still keep xgettext working.
2009-06-26 20:36:45 +03:00
Lasse Collin
fe378d4707 Added missing source files to windows/Makefile. 2009-06-26 15:40:40 +03:00
Lasse Collin
390a640856 Basic support for building with Cygwin and MinGW using
the Autotools based build system. It's not good yet, more
fixes will follow.
2009-06-26 15:37:53 +03:00
Lasse Collin
1c9360b7d1 Fix @variables@ to $(variables) in Makefile.am files.
Fix the ordering of libgnu.a and LTLIBINTL on the linker
command line and added missing LTLIBINTL to tests/Makefile.am.
2009-06-26 14:47:31 +03:00
Lasse Collin
d45615c555 Allow to explicitly specify autotool versions in autogen.sh. 2009-06-26 14:20:02 +03:00
Lasse Collin
eaf8367368 Add version.sh to EXTRA_DIST. 2009-06-26 14:18:32 +03:00
Lasse Collin
b317b218e2 Support HW_PHYSMEM64 2009-06-24 20:14:10 +03:00
Lasse Collin
ae82dde5d9 Cast a char argument to isspace() to unsigned char. 2009-06-24 13:01:59 +03:00
Lasse Collin
1735d31ea3 A few more spelling fixes. Released the .xz spec 1.0.3. 2009-06-05 13:46:26 +03:00
Lasse Collin
8ed156ce89 Added xzdec man page. 2009-06-04 23:42:12 +03:00
Lasse Collin
f6df39afaa Harmonized xzdec --memory with xz --memory and made
minor cleanups.
2009-06-04 23:26:47 +03:00
Lasse Collin
1774f27c61 Fix purporse -> purpose. Thanks to Andrew Dudman.
Released .xz spec 1.0.2 due to this fix too.
2009-06-04 22:59:55 +03:00
Lasse Collin
cb61345564 The .xz file format version 1.0.1 2009-06-01 14:53:57 +03:00
Lasse Collin
083c23c680 Make the raw value of the Check field available to applications
via lzma_block structure.

This changes ABI but not doesn't break API.
2009-05-26 14:48:48 +03:00
Lasse Collin
b4f5c81409 Remove undocumented alternative option names --bcj, --ppc,
and --itanium.
2009-05-23 16:57:21 +03:00
Lasse Collin
b1edee2cdc Add support for specifying the BCJ filter start offset
in the xz command line tool.
2009-05-23 15:12:23 +03:00
Lasse Collin
72aa0e9c5f Updated THANKS. 2009-05-23 14:51:09 +03:00
Lasse Collin
dcedb6998c Added support for --quiet and --no-warn to xzdec.
Cleaned up the --help message a little.
2009-05-22 16:40:50 +03:00
Lasse Collin
5f735dae80 Use the 40 % of RAM memory usage limit in xzdec too.
Update the memory usage info text in --help to match
the text in xz --long-help.
2009-05-22 15:11:52 +03:00
Lasse Collin
b60376249e Add --no-warn. 2009-05-22 14:43:00 +03:00
Lasse Collin
b4f92f522d Fix a comment. 2009-05-22 14:27:40 +03:00
Lasse Collin
4dd21d23f2 Remove the --info option, which was an alias for --list. 2009-05-22 14:21:20 +03:00
Lasse Collin
8836139b63 If xz is run as lzma, unlzma, or lzcat, simply imply
--format=lzma. This means that xz emulating lzma
doesn't decompress .xz files, while before this
commit it did. The new way is slightly simpler in
code and especially in upcoming documentation.
2009-05-22 12:27:43 +03:00
Lasse Collin
b0063023f8 Make the default memory usage limit 40 % of RAM for both
compressing and decompressing. This should be OK now that
xz automatically scales down the compression settings if
they would exceed the memory usage limit (earlier, the limit
for compression was increased to 90 % because low limit broke
scripts that used "xz -9" on systems with low RAM).

Support spcifying the memory usage limit as a percentage
of RAM (e.g. --memory=50%).

Support --threads=0 to reset the thread limit to the default
value (number of available CPU cores). Use UINT32_MAX instead
of SIZE_MAX as the maximum in args.c. hardware.c was already
expecting uint32_t value.

Cleaned up the output of --help and --long-help.
2009-05-22 11:29:50 +03:00
Lasse Collin
071b825b23 Support special value "max" where xz and xzdec accept an integer.
Don't round the memory usage limit in xzdec --help to avoid
an integer overflow and to not give wrong impression that
the limit is high enough when it may not actually be.
2009-05-21 17:22:01 +03:00
ABCD
03ca67fd37 Install lzdiff, lzgrep, and lzmore as symlinks
This adds lzdiff, lzgrep, and lzmore to the list of symlinks to install.
It also installs symlinks for the manual pages and removes the new
symlinks on uninstall.
2009-05-21 16:25:36 +03:00
Lasse Collin
a6f43e6412 Use a GCC-specific #pragma instead of GCC-specific
-Wno-uninitialized to silence a bogus warning.
2009-05-02 16:16:28 +03:00
Lasse Collin
f6ce63ebdb Removed --disable-encoder and --disable-decoder. Use the values
given to --enable-encoders and --enable-decoders to determine
if any encoder or decoder support is wanted.
2009-05-02 14:46:50 +03:00
Lasse Collin
be06858d5c Remove docs that are too outdated to be updated
(rewrite will be better).
2009-05-01 11:28:52 +03:00
Lasse Collin
0255401e57 Added documentation about the legacy .lzma file format. 2009-05-01 11:21:46 +03:00
Lasse Collin
1496ff437c Renamed the file format specification to xz-file-format.txt
which is the filename used on the WWW.
2009-05-01 11:20:23 +03:00
Lasse Collin
21c6b94373 Fixed a crash in liblzma.
liblzma tries to avoid useless free()/malloc() pairs in
initialization when multiple files are handled using the
same lzma_stream. This didn't work with filter chains
due to comparison of wrong pointers in lzma_next_coder_init(),
making liblzma think that no memory reallocation is needed
even when it actually is.

Easy way to trigger this bug is to decompress two files with
a single xz command. The first file should have e.g. x86+LZMA2
as the filter chain, and the second file just LZMA2.
2009-04-28 23:08:32 +03:00
Lasse Collin
e518d167aa Fix uint32_t -> size_t in ARM and ARM-Thumb filters.
On 64-bit system it would have gone into infinite
loop if a single input buffer was over 4 GiB (unlikely).
2009-04-15 14:13:38 +03:00
Lasse Collin
31decdce04 Minor fixes to test files' README. 2009-04-14 11:48:46 +03:00
Lasse Collin
4787d65443 Updated history.txt. 2009-04-13 16:36:41 +03:00
Lasse Collin
2f0bc9cd40 Quick & dirty update to support xz in diff/grep/more scripts. 2009-04-13 14:49:48 +03:00
Lasse Collin
02ddf09bc3 Put the interesting parts of XZ Utils into the public domain.
Some minor documentation cleanups were made at the same time.
2009-04-13 11:27:40 +03:00
Lasse Collin
e79c42d854 Fix off-by-one in LZ decoder.
Fortunately, this bug had no security risk other than accepting
some corrupt files as valid.
2009-04-10 11:17:02 +03:00
Pavel Roskin
94eb9ad46f Fix minor typos in README 2009-03-31 21:54:06 +03:00
Lasse Collin
9bab5336eb Add a note and work-around instructions to README about
problems detecting a C99 compiler when some standard
headers are missing.
2009-03-31 21:52:51 +03:00
Lasse Collin
a0497ff7a0 Updated THANKS. 2009-03-18 16:54:38 +02:00
Lasse Collin
390e69887f Fix wrong macro names in lc_cpucores.m4 and cpucores.h.
Thanks to Bert Wesarg.
2009-03-18 16:51:41 +02:00
Lasse Collin
0df9299e24 Test for Linux-specific sysinfo() only on Linux systems.
Some other systems have sysinfo() with different semantics.
2009-03-01 09:03:08 +02:00
Lasse Collin
cf751edfde Added AC_CONFIG_MACRO_DIR to configure.ac. 2009-03-01 09:00:06 +02:00
Lasse Collin
63df14c57d Fix the Autoconf test for getopt_long replacement.
It was broken by e114502b2b.
2009-03-01 08:58:41 +02:00
Lasse Collin
fd6a380f4e Add a rough explanation of --extreme to output of --help. 2009-02-22 19:07:54 +02:00
Lasse Collin
68bf7ac298 Fixes to progress message handling in xz:
- Don't use Windows-specific code on Windows. The old code
    required at least Windows 2000. Now it should work on
    Windows 98 and later, and maybe on Windows 95 too.

  - Use less precision when showing estimated remaining time.

  - Fix some small design issues.
2009-02-22 18:52:49 +02:00
Lasse Collin
47c2e21f82 Added files missing from the previous commit. 2009-02-18 13:00:10 +02:00
Lasse Collin
489a3dbaa0 Added lzma_easy_buffer_encode(). Splitted easy.c into small
pieces to avoid unneeded dependencies making statically
linked applications bigger than needed.
2009-02-17 10:43:00 +02:00
Lasse Collin
7494816ab0 Make physmem.h work on old Windows versions.
Thanks to Hongbo Ni for the original patch.
2009-02-15 15:48:45 +02:00
Lasse Collin
11ae4ae35f Fix microsecond vs. nanosecond confusion in my_time(). 2009-02-14 20:44:52 +02:00
Lasse Collin
3084d662d2 Cleanups to the code that detects the amount of RAM and
the number of CPU cores. Added support for using sysinfo()
on Linux systems whose libc lacks appropriate sysconf()
support (at least dietlibc). The Autoconf macros were
split into separate files, and CPU core count detection
was moved from hardware.c to cpucores.h. The core count
isn't used for anything real for now, so a problematic
part in process.c was commented out.
2009-02-14 00:45:29 +02:00
Lasse Collin
9c62371eab Initial port to DOS using DJGPP. 2009-02-13 18:23:50 +02:00
Lasse Collin
0dae8b7751 Windows port: Take advantage of the version number macros.
Now the version number is not duplicated in the
Windows-specific files anymore.
2009-02-13 18:02:05 +02:00
Lasse Collin
fdbc0cfa71 Changed how the version number is specified in various places.
Now configure.ac will get the version number directly from
src/liblzma/api/lzma/version.h. The intent is to reduce the
number of places where the version number is duplicated. In
future, support for displaying Git commit ID may be added too.
2009-02-13 18:00:03 +02:00
Lasse Collin
1d924e584b Fix handling of integrity check type in the xz command line tool. 2009-02-13 17:30:30 +02:00
Lasse Collin
96c46df7de Improve support for DOS-like systems.
Here DOS-like means DOS, Windows, and OS/2.
2009-02-13 17:29:02 +02:00
Lasse Collin
b6a30ee8c2 Remove dead directories from .gitignore. 2009-02-11 20:02:32 +02:00
Jim Meyering
1ec5b00279 .gitignore vs. Makefiles
How about this for those of us who do srcdir builds?
2009-02-11 20:01:10 +02:00
Lasse Collin
154f5aec2d Removed Makefile from .gitignore since not all Makefiles
in the repository are generated by Autotools. People
should do test builds in a separate build directory anyway.
2009-02-10 21:48:35 +02:00
Lasse Collin
e605c26636 Added resource files for the Windows build. 2009-02-10 21:48:05 +02:00
Lasse Collin
a3bbbe05d3 Let the user specify custom CFLAGS on the make command
line. Previously custom CFLAGS worked only when they were
passed to configure.
2009-02-09 14:54:31 +02:00
Lasse Collin
53f7598998 Fix aliasing issue in physmem.h. 2009-02-08 21:35:11 +02:00
Lasse Collin
0e27028d74 Add a separate internal function to initialize the CRC32
table, which is used also by LZ encoder. This was needed
because calling lzma_crc32() and ignoring the result is
a no-op due to lzma_attr_pure.
2009-02-08 18:24:50 +02:00
Lasse Collin
ae1ad9af54 Make "xz --force" to write to terminal as the error
message suggests.
2009-02-08 18:17:05 +02:00
Lasse Collin
79e25eded4 Support both slash and backslash as path component
separator on Windows when parsing argv[0].
2009-02-08 10:37:50 +02:00
Lasse Collin
bc7c7109cc Omit the wrong and (even if corrected) nowadays useless rm
from autogen.sh.
2009-02-07 23:18:13 +02:00
Lasse Collin
edfc2031e5 Updated THANKS. 2009-02-07 21:41:52 +02:00
Lasse Collin
880c330938 Make it easy to choose if command line tools should be
linked statically or dynamically against liblzma. The
default is still to use static liblzma, but it can now
be changed by passing --enable-dynamic to configure.
Thanks to Mike Frysinger for the original patch.

Fixed a few minor bugs in configure.ac.
2009-02-07 21:17:07 +02:00
Mike Frysinger
3f86532407 add gitignore files
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-07 20:26:09 +02:00
Lasse Collin
bd7ca1dad5 Assume 32 MiB of RAM on unsupported operating systems like
the comment in hardware.c already said.
2009-02-07 17:07:52 +02:00
Lasse Collin
d0ab8c1c73 MinGW support: Don't build fastpos_tablegen.c as part of
liblzma. Build both static and dynamic liblzma, and also
static and dynamic versions of the command line tools.
2009-02-07 16:26:58 +02:00
Lasse Collin
bfd91198e4 Support LZMA_API_STATIC in assembler files to
avoid __declspec(dllexport) equivalent.
2009-02-07 15:55:47 +02:00
Lasse Collin
3306cf3883 Introduced LZMA_API_STATIC macro, which the applications
need to #define when linking against static liblzma on
platforms like Windows. Most developers don't need to
care about LZMA_API_STATIC at all.
2009-02-07 11:11:50 +02:00
Lasse Collin
b719e63c5f Another grammar fix 2009-02-06 16:55:45 +02:00
Lasse Collin
fe5434f940 Grammar fix in README. 2009-02-06 12:30:23 +02:00
Lasse Collin
3dfa58a9ee Some MSYS installations (e.g. MsysGit) don't include
install.exe, so don't rely on it.
2009-02-06 10:06:32 +02:00
Lasse Collin
975d8fd72a Recreated the BCJ test files for x86 and SPARC. The old files
were linked with crt*.o, which are copyrighted, and thus the
old test files were not in the public domain as a whole. They
are freely distributable though, but it is better to be careful
and avoid including any copyrighted pieces in the test files.
The new files are just compiled and assembled object files,
and thus don't contain any copyrighted code.
2009-02-06 09:13:15 +02:00
Lasse Collin
094b1b09a5 Add the "windows" directory to EXTRA_DIST. 2009-02-05 21:21:27 +02:00
Lasse Collin
e1c3412eec Added initial experimental makefile for use with MinGW. 2009-02-05 09:17:51 +02:00
Lasse Collin
75905a9afc Various code cleanups the the xz command line tool.
It now builds with MinGW.
2009-02-05 09:12:57 +02:00
Lasse Collin
d0c0b9e94e Another utime() fix. 2009-02-03 12:15:17 +02:00
Lasse Collin
ccf92a29e8 Fix wrong filename argument for utime() and utimes().
This doesn't affect most systems, since most systems
have better functions available.
2009-02-03 10:41:11 +02:00
Lasse Collin
99c1c2abfa Updated the x86 assembler code:
- Use call/ret pair to get instruction pointer for PIC.
  - Use PIC only if PIC or __PIC__ is #defined.
  - The code should work on MinGW and Darwin in addition
    to GNU/Linux and Solaris.
2009-02-02 21:19:01 +02:00
Lasse Collin
22a0c6dd94 Modify LZMA_API macro so that it works on Windows with
other compilers than MinGW. This may hurt readability
of the API headers slightly, but I don't know any
better way to do this.
2009-02-02 20:14:03 +02:00
Lasse Collin
8dd7b6052e Fix a bug in lzma_block_buffer_decode(), although this
function should be rewritten anyway.
2009-02-01 22:40:35 +02:00
Lasse Collin
55fd41431e Added initial version of raw buffer-to-buffer coding
functions, and cleaned up filter.h API header a little.
May be very buggy, not tested yet.
2009-02-01 22:39:07 +02:00
Lasse Collin
3e54ecee5c Fix missing newlines in xzdec.c. 2009-02-01 00:11:20 +02:00
Lasse Collin
d64ca34f1b Use __cdecl also for function pointers in liblzma API when
on Windows.
2009-02-01 00:10:07 +02:00
Lasse Collin
6a2eb54092 Add LZMA_API to liblzma API headers. It's useful at least
on Windows. sysdefs.h no longer #includes lzma.h, so lzma.h
has to be #included separately where needed.
2009-01-31 11:01:48 +02:00
Lasse Collin
d9993fcb4d Use _WIN32 instead of WIN32 in xzdec.c to test if compiling on Windows. 2009-01-31 10:13:09 +02:00
Lasse Collin
2dbdc5befb Fix two lines in lzma.h on which the # wasn't at the
beginning of the line.
2009-01-31 10:02:52 +02:00
Lasse Collin
4ab7601091 Add support for using liblzma headers in MSVC, which has no
stdint.h or inttypes.h.
2009-01-31 09:55:05 +02:00
Lasse Collin
b2172cf823 Fix # -> ## in a macro in lzma.h. 2009-01-31 08:49:54 +02:00
Lasse Collin
1aae869874 Updated README. 2009-01-30 18:50:16 +02:00
Lasse Collin
f54bcf6f80 Remove dangling crc64_init.c. 2009-01-30 00:29:58 +02:00
Lasse Collin
982da7ed31 The .xz file format specification version 1.0.0 is now
officially released. The format has been technically the same
since 2008-11-19, but now that it is frozen, people can start
using it without a fear that the format will break.
2009-01-28 17:16:38 +02:00
Lasse Collin
c4683a660b Updated THANKS. 2009-01-28 08:45:59 +02:00
Lasse Collin
3241317093 Fix uninitialized variables in alone_decoder.c. This bug was
triggered by the previous commit, since these variables were
not used by anything before support for a preset dictionary.
2009-01-28 08:43:26 +02:00
Lasse Collin
f76e39cf93 Added initial support for preset dictionary for raw LZMA1
and LZMA2. It is not supported by the .xz format or the xz
command line tool yet.
2009-01-27 18:36:05 +02:00
Lasse Collin
449b8c832b Regenerate the CRC tables without trailing blanks. 2009-01-26 20:09:17 +02:00
Jim Meyering
850f740042 remove trailing blanks from all but .xz files 2009-01-26 20:01:51 +02:00
Lasse Collin
667481f1aa Add lzma_block_buffer_decode(). 2009-01-26 14:34:10 +02:00
Lasse Collin
5fb34d8324 Add more sanity checks to lzma_stream_buffer_decode(). 2009-01-26 14:33:28 +02:00
Lasse Collin
c129748675 Avoid hardcoded constant in easy.c. 2009-01-26 14:33:13 +02:00
Lasse Collin
1859d22d75 Tiny bit better sanity check in block_util.c 2009-01-26 13:06:49 +02:00
Lasse Collin
2c5fe958e4 Fix a dumb bug in Block decoder, which made it return
LZMA_DATA_ERROR with valid data. The bug was added in
e114502b2b.
2009-01-25 01:35:56 +02:00
Lasse Collin
c81f13ff29 Added lzma_stream_buffer_decode() and made minor cleanups. 2009-01-23 22:27:50 +02:00
Lasse Collin
0b3318661c Fix a comment. 2009-01-22 12:53:33 +02:00
Lasse Collin
9ec80355a7 Add some single-call buffer-to-buffer coding functions. 2009-01-20 16:37:27 +02:00
Lasse Collin
d8b58d0993 Block encoder cleanups 2009-01-20 13:45:41 +02:00
Lasse Collin
0c09810cb3 Use LZMA_PROG_ERROR in lzma_code() as documented in base.h. 2009-01-20 10:35:15 +02:00
Lasse Collin
2f1a8e8eb8 Fix handling of non-fatal errors in lzma_code(). 2009-01-19 22:53:18 +02:00
Lasse Collin
4810b6bc25 Move some LZMA2 constants to lzma2_encoder.h so that they
can be used outside lzma2_encoder.c.
2009-01-19 14:00:33 +02:00
Lasse Collin
00be5d2e09 Remove dead code. 2009-01-19 13:52:36 +02:00
Lasse Collin
128586213f Beta was supposed to be API stable but I had forgot to rename
lzma_memlimit_encoder and lzma_memlimit_decoder to
lzma_raw_encoder_memlimit and lzma_raw_decoder_memlimit. :-(
Now it is fixed. Hopefully it doesn't cause too much trouble
to those who already thought API is stable.
2009-01-17 14:24:25 +02:00
Lasse Collin
b056379490 Updated THANKS. 2009-01-15 14:29:22 +02:00
Lasse Collin
dc8f3be06d Fixed a bug in 7z2lzma.bash to make it work with .7z files
that use something else than 2^n as the dictionary size.
Thanks to Dan Shechter for the bug report.
2009-01-15 14:27:32 +02:00
Lasse Collin
8286a60b8f Use pthread_sigmask() instead of sigprocmask() when pthreads
are enabled.
2009-01-07 18:41:15 +02:00
Lasse Collin
4fd43cb3a9 Bumped version to 4.999.8beta right after the release
of 4.999.7beta.
2008-12-31 20:01:00 +02:00
Lasse Collin
061748f593 Disable Subblock filter from test_compress.sh since it is
disabled by default in configure.ac.
2008-12-31 18:59:02 +02:00
Lasse Collin
9c45658ddc Disable both Subblock encoder and decoder my default,
since they are not finished and may have security issues too.
2008-12-31 17:44:20 +02:00
Lasse Collin
b59f1e98f5 Update some files in debug directory. 2008-12-31 17:42:50 +02:00
Lasse Collin
d1d17a40d3 Prepare for 4.999.7beta release. 2008-12-31 17:41:46 +02:00
Lasse Collin
88d3e6b0b1 Cleaned up some comments in the API headers. 2008-12-31 17:15:03 +02:00
Lasse Collin
322ecf93c9 Renamed lzma_options_simple to lzma_options_bcj in the API.
The internal implementation is still using the name "simple".
It may need some cleanups, so I look at it later.
2008-12-31 16:29:39 +02:00
Lasse Collin
7eea8bec3a Fixed missing quoting in configure.ac. 2008-12-31 00:57:27 +02:00
Lasse Collin
28e75f7086 Updated src/liblzma/Makefile.am to use liblzma.pc.in, which
should have been in the previous commit.
2008-12-31 00:48:23 +02:00
Lasse Collin
7ed9d943b3 Remove lzma_init() and other init functions from liblzma API.
Half of developers were already forgetting to use these
functions, which could have caused total breakage in some future
liblzma version or even now if --enable-small was used. Now
liblzma uses pthread_once() to do the initializations unless
it has been built with --disable-threads which make these
initializations thread-unsafe.

When --enable-small isn't used, liblzma currently gets needlessly
linked against libpthread (on systems that have it). While it is
stupid for now, liblzma will need threads in future anyway, so
this stupidity will be temporary only.

When --enable-small is used, different code CRC32 and CRC64 is
now used than without --enable-small. This made the resulting
binary slightly smaller, but the main reason was to clean it up
and to handle the lack of lzma_init_check().

The pkg-config file lzma.pc was renamed to liblzma.pc. I'm not
sure if it works correctly and portably for static linking
(Libs.private includes -pthread or other operating system
specific flags). Hopefully someone complains if it is bad.

lzma_rc_prices[] is now included as a precomputed array even
with --enable-small. It's just 128 bytes now that it uses uint8_t
instead of uint32_t. Smaller array seemed to be at least as fast
as the more bloated uint32_t array on x86; hopefully it's not bad
on other architectures.
2008-12-31 00:30:49 +02:00
Lasse Collin
5cda29b566 Use 28 MiB as memory usage limit for encoding in test_compress.sh. 2008-12-27 19:40:31 +02:00
Lasse Collin
050eb14d29 Revert a change made in 3b34851de1
that was related to LZMA_MODE_FAST. The original code is slightly
faster although it compresses slightly worse. But since it is fast
mode, it is better to select the faster version.
2008-12-27 19:32:20 +02:00
Lasse Collin
4820f10d0f Some xz command line tool improvements. 2008-12-27 19:30:19 +02:00
Lasse Collin
e33194e79d Bunch of liblzma tweaks, including some API changes.
The API and ABI should now be very close to stable,
although the code behind it isn't yet.
2008-12-27 19:27:49 +02:00
Lasse Collin
4d00652e75 Updated Makefile.am that was missing from the previous commit. 2008-12-18 13:42:52 +02:00
Lasse Collin
634636fa56 Remove the alignment functions for now. Maybe they will
be added back in some form later, but the current version
wasn't modular, so it would need fixing anyway.
2008-12-17 21:49:53 +02:00
Lasse Collin
4fed98417d xz message handling improvements 2008-12-17 20:11:23 +02:00
Lasse Collin
653e457e37 Fix a dumb bug in .lzma decoder which was introduced in
the previous commit. (Probably the previous commit has
other bugs too, it wasn't tested.)
2008-12-15 23:26:43 +02:00
Lasse Collin
671a5adf1e Bunch of liblzma API cleanups and fixes. 2008-12-15 19:39:13 +02:00
Lasse Collin
17781c2c20 The LZMA2 decoder fix introduced a bug to LZ decoder,
which made LZ decoder return too early after dictionary
reset. This fixes it.
2008-12-15 14:26:52 +02:00
Lasse Collin
f9f2d1e743 Added two new test files. 2008-12-15 11:20:22 +02:00
Lasse Collin
ff7fb2c605 Fix data corruption in LZMA2 decoder. 2008-12-15 10:01:59 +02:00
Lasse Collin
1ceebcf7e1 Name the package "xz" in configure.ac. 2008-12-13 00:54:11 +02:00
Lasse Collin
a94bf00d0a Some adjustments to GCC warning flags. The important change
is the removal of -pedantic. It messes up -Werror (which I
really want to keep so that I don't miss any warnings) with
printf format strings that are in POSIX but not in C99.
2008-12-12 22:43:21 +02:00
Lasse Collin
8582d392ba Remove obsolete comment. 2008-12-10 01:31:00 +02:00
Lasse Collin
b1ae6dd731 Use "decompression" consistently in --long-help. 2008-12-10 01:27:15 +02:00
Lasse Collin
1ea9e7f15a Added preset=NUM to --lzma1 and --lzma2. This makes it easy
to take a preset as a template and modify it a little.
2008-12-10 01:23:58 +02:00
Lasse Collin
bceb3918db Put the file format specification into the public domain.
Same will be done to the actual code later.
2008-12-09 17:43:31 +02:00
Lasse Collin
6efa2d80d4 Make the memusage functions of LZMA1 and LZMA2 encoders
to validate the filter options. Add missing validation
to LZMA2 encoder when options are changed in the middle
of encoding.
2008-12-09 17:41:49 +02:00
Lasse Collin
f20a03206b Updated THANKS. 2008-12-09 10:36:24 +02:00
Lasse Collin
ef7890d564 In command line tool, take advantage of memusage calculation's
ability to also validate the filter chain and options (not
implemented yet for all filters).
2008-12-01 23:04:12 +02:00
Lasse Collin
ccd57afa09 Validate the filter chain before checking filter-specific
memory usage.
2008-12-01 22:59:28 +02:00
Lasse Collin
c596fda40b Make the memusage functions of LZMA1 and LZMA2 decoders
to validate the filter options.
2008-12-01 22:58:22 +02:00
Lasse Collin
c58f469be5 Added the changes for Delta filter that should have been
part of 656ec87882.
2008-12-01 22:55:18 +02:00
Lasse Collin
cd70801520 LZMA2 decoder cleanups. Make it require new LZMA properties
also in the first LZMA chunk after a dictionary reset in
uncompressed chunk.
2008-12-01 22:50:28 +02:00
Lasse Collin
656ec87882 Added lzma_delta_coder_memusage() which also validates
the options.
2008-12-01 16:30:11 +02:00
Lasse Collin
691a9155b7 Automake includes the m4 directory, so don't add it in
Makefile.am separately.

Updated THANKS.
2008-11-29 10:03:49 +02:00
Lasse Collin
c7007ddf06 Tested using COLUMNS environment variable to avoid broken
progress indicator but since COLUMNS isn't usually available,
the code was left commented out.
2008-11-28 12:00:48 +02:00
Lasse Collin
ae65dcfde2 Cleanups to message.c. 2008-11-27 19:28:59 +02:00
Lasse Collin
a8368b75cd Remove the nowadays unneeded memory limitting malloc() wrapper. 2008-11-25 02:37:47 +02:00
Lasse Collin
69472ee5f0 VLI encoder and decoder cleanups. Made encoder return
LZMA_PROG_ERROR in single-call mode if there's no output
space.
2008-11-23 15:09:03 +02:00
Lasse Collin
4249c8c15a Typo fix 2008-11-22 17:44:33 +02:00
Lasse Collin
6d1d6f4598 Support NetBSD's errno for O_NOFOLLOW. 2008-11-20 22:59:10 +02:00
Lasse Collin
f901a290ee Build xzdec and lzmadec from xzdec.c. xzdec supports only .xz
files and lzmadec only .lzma files.
2008-11-20 18:05:52 +02:00
Lasse Collin
86a0ed8f01 Minor cleanups to xzdec. 2008-11-20 11:01:29 +02:00
Lasse Collin
54f716ba89 Added missing check for uint16_t. 2008-11-19 23:55:22 +02:00
Lasse Collin
1880a3927b Renamed lzma to xz and lzmadec to xzdec. We create symlinks
lzma, unlzma, and lzcat in "make install" for backwards
compatibility with LZMA Utils 4.32.x; I'm not sure if this
should be the default though.
2008-11-19 23:52:24 +02:00
Lasse Collin
e114502b2b Oh well, big messy commit again. Some highlights:
- Updated to the latest, probably final file format version.
  - Command line tool reworked to not use threads anymore.
    Threading will probably go into liblzma anyway.
  - Memory usage limit is now about 30 % for uncompression
    and about 90 % for compression.
  - Progress indicator with --verbose
  - Simplified --help and full --long-help
  - Upgraded to the last LGPLv2.1+ getopt_long from gnulib.
  - Some bug fixes
2008-11-19 20:46:52 +02:00
Lasse Collin
3c3905b534 Fixed the test that should have been fixed as part
of 1e8e4fd1f3.
2008-10-09 11:12:29 +03:00
Lasse Collin
0f295bf7a3 Fixed some help messages. 2008-10-07 16:42:18 +03:00
Lasse Collin
1e8e4fd1f3 Made the preset numbering more logical in liblzma API. 2008-10-07 09:40:31 +03:00
Lasse Collin
5e4df4c3c0 Removed fi from po/LINGUAS. 2008-10-03 19:36:09 +03:00
Lasse Collin
fcfb86c777 Fixed suffix handling with --format=raw. 2008-10-03 07:06:48 +03:00
Lasse Collin
bd137524f2 Initial changes to change the suffix of the new format to .xz.
This also fixes a bug related to --suffix option. Some issues
with suffixes with --format=raw were not fixed.
2008-10-02 22:51:46 +03:00
Lasse Collin
4c321a41c4 Renamed the test files from .lzma suffix to .xz suffix. 2008-09-30 17:43:55 +03:00
Lasse Collin
8e60c889a2 Fixed Stream decoder to actually use the first_stream variable. 2008-09-30 13:57:44 +03:00
Lasse Collin
3bdbc12c05 Added one more test file. 2008-09-30 13:56:57 +03:00
Lasse Collin
a6639022fd Fixed uninitialized variable in Stream decoder. 2008-09-30 13:34:07 +03:00
Lasse Collin
ed3709000a Added two test files. 2008-09-30 13:27:28 +03:00
Lasse Collin
ea560b0ea8 Fix conflicting Subblock helper filter's ID. 2008-09-27 23:49:24 +03:00
Lasse Collin
ad97483b6e Changed magic bytes to match the updated spec. Filename
suffix wasn't changed yet.
2008-09-27 23:37:13 +03:00
Lasse Collin
7a57069167 Remove po/fi.po since I'm not keeping it updated for now. 2008-09-27 23:16:09 +03:00
Lasse Collin
018ae09df8 Fix also test_compress.sh. 2008-09-27 23:13:54 +03:00
Lasse Collin
3a62a5fb85 Fixed compilation of test_filter_flags.c, which was broken by
1dcecfb09b.
2008-09-27 23:01:15 +03:00
Lasse Collin
c6ca26eef7 Updated file format specification. It changes the suffix
of the new format to .xz and removes the recently added
LZMA filter.
2008-09-27 19:11:02 +03:00
Lasse Collin
1dcecfb09b Some API changes, bug fixes, cleanups etc. 2008-09-27 19:09:21 +03:00
Lasse Collin
5cc5064cae Added 7z2lzma.bash. 2008-09-27 11:28:49 +03:00
Lasse Collin
f147666a5c Miscellaneous LZ and LZMA encoder cleanups 2008-09-17 22:11:39 +03:00
Lasse Collin
13d68b0698 LZ decoder cleanup 2008-09-13 13:54:00 +03:00
Lasse Collin
13a74b78e3 Renamed constants:
- LZMA_VLI_VALUE_MAX -> LZMA_VLI_MAX
  - LZMA_VLI_VALUE_UNKNOWN -> LZMA_VLI_UNKNOWN
  - LZMA_HEADER_ERRRO -> LZMA_OPTIONS_ERROR
2008-09-13 12:10:43 +03:00
Lasse Collin
320601b2c7 Improved the Stream Flags handling API. 2008-09-12 22:41:40 +03:00
Lasse Collin
ec490da522 Simplified debug/known_sizes.c to match the relaxed
requirements of Block encoder.
2008-09-11 23:10:44 +03:00
Lasse Collin
16e8b98f26 Remove a check from Block encoder that should have already
been removed in 2ba01bfa75.
2008-09-11 23:09:24 +03:00
Lasse Collin
5a710c3805 Remove bogus #includes. 2008-09-11 20:02:38 +03:00
Lasse Collin
01892b2ca5 Updated THANKS. 2008-09-11 10:49:14 +03:00
Lasse Collin
962f2231d4 Fix a compiler error on big endian systems that don't
support unaligned memory access.
2008-09-11 10:48:12 +03:00
Lasse Collin
fa3ab0df8a Silence a compiler warning. 2008-09-11 10:46:14 +03:00
Lasse Collin
9373e81e18 Bumped version to 4.999.6alpha. 2008-09-10 19:16:32 +03:00
Lasse Collin
cb072b7c84 Check for LZMA_FILTER_RESERVED_START in filter_flags_encoder.c.
Use LZMA_PROG_ERROR instead of LZMA_HEADER_ERROR if the Filter ID
is in the reserved range. This allows Block Header encoder to
detect unallowed Filter IDs, which is good for Stream encoder.
2008-09-10 17:02:00 +03:00
Lasse Collin
123ab0acec Filter handling cleanups 2008-09-10 16:44:32 +03:00
Lasse Collin
9cfcd0c4f2 Comments 2008-09-10 00:33:00 +03:00
Lasse Collin
2ba01bfa75 Cleaned up Block encoder and moved the no longer shared
code from block_private.h to block_decoder.c. Now the Block
encoder doesn't need compressed_size and uncompressed_size
from lzma_block structure to be initialized.
2008-09-10 00:27:02 +03:00
Lasse Collin
07efcb5a6b Changed Filter ID of LZMA to 0x20. 2008-09-07 10:23:13 +03:00
Lasse Collin
32fe5fa541 Comments 2008-09-06 23:42:50 +03:00
Lasse Collin
0a31ed9d5e Some API cleanups 2008-09-06 15:14:30 +03:00
Lasse Collin
da98df5440 Added support for raw encoding and decoding to the command
line tool, and made various cleanups. --lzma was renamed to
--lzma1 to prevent people from accidentally using LZMA when
they want LZMA2.
2008-09-04 11:53:06 +03:00
Lasse Collin
2496aee8a7 Don't allow LZMA_SYNC_FLUSH with decoders anymore. There's
simply nothing that would use it. Allow LZMA_FINISH to the
decoders, which will usually ignore it (auto decoder and
Stream decoder being exceptions).
2008-09-04 10:39:15 +03:00
Lasse Collin
bea301c26d Minor updates to the file format specification. 2008-09-03 17:06:25 +03:00
Lasse Collin
9c75b089b4 Command line tool fixes 2008-09-02 19:33:32 +03:00
Lasse Collin
bab0590504 Auto decoder cleanup 2008-09-02 19:31:42 +03:00
Lasse Collin
689602336d Updated auto decoder to handle LZMA_CONCATENATED when decoding
LZMA_Alone files. Decoding of concatenated LZMA_Alone files is
intentionally not supported, so it is better to put this in
auto decoder than LZMA_Alone decoder.
2008-09-02 19:12:12 +03:00
Lasse Collin
80c4158f19 Stream decoder cleanups 2008-09-02 14:56:52 +03:00
Lasse Collin
fc68165745 Some fixes to LZ encoder. 2008-09-02 11:45:39 +03:00
Lasse Collin
ede675f9ac Fix wrong pointer calculation in LZMA encoder. 2008-08-31 11:47:01 +03:00
Lasse Collin
3b34851de1 Sort of garbage collection commit. :-| Many things are still
broken. API has changed a lot and it will still change a
little more here and there. The command line tool doesn't
have all the required changes to reflect the API changes, so
it's easy to get "internal error" or trigger assertions.
2008-08-28 22:53:15 +03:00
Lasse Collin
57b9a145a5 Fix test_filter_flags to match the new restriction of lc+lp. 2008-06-20 17:16:32 +03:00
Lasse Collin
eaafc4367c Remove some redundant code from LZMA encoder. 2008-06-20 16:19:54 +03:00
Lasse Collin
0809c46534 Add limit of lc + lp <= 4. Now we can allocate the
literal coder as part of the main LZMA encoder or
decoder structure.

Make the LZMA decoder to rely on the current internal API
to free the allocated memory in case an error occurs.
2008-06-19 16:35:08 +03:00
Lasse Collin
d25ab1b961 Comments 2008-06-18 21:45:19 +03:00
Lasse Collin
6368a2fa59 Delete old code that was supposed to be already deleted
from test_block_header.c.
2008-06-18 19:19:02 +03:00
Lasse Collin
7d17818cec Update the code to mostly match the new simpler file format
specification. Simplify things by removing most of the
support for known uncompressed size in most places.
There are some miscellaneous changes here and there too.

The API of liblzma has got many changes and still some
more will be done soon. While most of the code has been
updated, some things are not fixed (the command line tool
will choke with invalid filter chain, if nothing else).

Subblock filter is somewhat broken for now. It will be
updated once the encoded format of the Subblock filter
has been decided.
2008-06-18 18:02:10 +03:00
Lasse Collin
bf6348d1a3 Update the file format specification draft. The new one is
a lot simpler than the previous versions, but it also means
that the existing code will change a lot.
2008-06-17 15:03:46 +03:00
Lasse Collin
803194ddd2 Fix uninitialized variable in LZMA encoder. This was
introduced in 369f72fd65.
2008-06-11 21:42:47 +03:00
Lasse Collin
0ea98e52ba Improve command line integer parsing a little in lzma and
lzmadec to make them accept also KiB in addition Ki etc.
Fix also memory usage information in lzmadec --help.
2008-06-11 15:08:44 +03:00
Lasse Collin
436fa5fae9 s/decompressed/compressed/ in the command line tool's
error message.
2008-06-10 20:36:12 +03:00
Lasse Collin
369f72fd65 Fix a buffer overflow in the LZMA encoder. It was due to my
misunderstanding of the code. There's no tiny fix for this
problem, so I also cleaned up the code in general.

This reduces the speed of the encoder 2-5 % in the fastest
compression mode ("lzma -1"). High compression modes should
have no noticeable performance difference.

This commit breaks things (especially LZMA_SYNC_FLUSH) but I
will fix them once the new format and LZMA2 has been roughly
implemented. Plain LZMA won't support LZMA_SYNC_FLUSH at all
and won't be supported in the new .lzma format. This may
change still but this is what it looks like now.

Support for known uncompressed size (that is, LZMA or LZMA2
without EOPM) is likely to go away. This means there will
be API changes.
2008-06-01 12:48:17 +03:00
Lasse Collin
e55e0e873c Typo fixes from meyering. 2008-05-30 11:53:41 +03:00
Lasse Collin
ed6664146f Remove support for pre-C89 libc versions that lack memcpy,
memmove, and memset.
2008-05-11 14:24:42 +03:00
Lasse Collin
b09464bf9a Improved C99 compiler detection in configure.ac. It will
pass -std=gnu99 instead of -std=c99 to GCC now, but -pedantic
should still give warnings about GNU extensions like before
except with some special keywords like asm().
2008-05-11 14:17:21 +03:00
Lasse Collin
11de5d5267 Bunch of grammar fixes from meyering. 2008-05-06 15:15:07 +03:00
Lasse Collin
dc192b6343 Typo fix 2008-05-06 13:41:05 +03:00
Lasse Collin
944b62b932 Don't print an error message on broken pipe unless --verbose
is used.
2008-05-04 22:29:27 +03:00
Lasse Collin
8e074349e4 Fix a crash with --format=alone if other filters than LZMA
are specified on the command line.
2008-04-30 22:16:17 +03:00
Lasse Collin
2f361ac19b Updated THANKS. 2008-04-28 17:08:27 +03:00
Lasse Collin
3be21fb12f Fixed wrong spelling "limitter" to "limiter". This affects
liblzma's API.
2008-04-28 17:06:34 +03:00
Lasse Collin
beeb810608 Prevent LZ encoder from hanging with known uncompressed
size. The "fix" breaks LZMA_SYNC_FLUSH at end of stream
with known uncompressed size, but since it currently seems
likely that support for encoding with known uncompressed
size will go away anyway, I'm not fixing this problem now.
2008-04-25 15:39:50 +03:00
Lasse Collin
c324325f9f Removed src/liblzma/common/sysdefs.h symlink, which was
annoying, because "make dist" put two copies of sysdefs.h
into the tarball instead of the symlink.
2008-04-25 13:58:56 +03:00
Lasse Collin
d3ba30243c Added memusage.c to debug directory. 2008-04-25 13:41:29 +03:00
Lasse Collin
8f804c29aa Bumped version number to 4.999.3alpha. It will become 5.0.0
once we have a stable release (won't be very soon). The
version number is no longer related to version of LZMA SDK.

Made some small Automake-related changes to toplevel
Makefile.am and configure.ac.
2008-04-25 13:32:35 +03:00
Lasse Collin
c99037ea10 Fix a memory leak by calling free(extra->data) in
lzma_extra_free().
2008-04-24 20:25:39 +03:00
Lasse Collin
22ba3b0b50 Make unlzma and lzcat symlinks. 2008-04-24 20:23:05 +03:00
Lasse Collin
17c36422d4 Fixed a bug in command line option parsing. 2008-04-24 20:20:27 +03:00
Lasse Collin
283f939974 Added two assert()s. 2008-04-24 20:19:20 +03:00
Lasse Collin
eb348a60b6 Switch to uint16_t as the type of range coder probabilities. 2008-04-24 19:22:53 +03:00
Lasse Collin
6c5306e312 Fix wrong return type (uint32_t -> bool). 2008-04-24 18:39:57 +03:00
Lasse Collin
712cfe3ebf Fix data corruption in LZ encoder with LZMA_SYNC_FLUSH. 2008-04-24 18:38:00 +03:00
Lasse Collin
bc04486e36 Fix fastpos problem in Makefile.am when built with --enable-small. 2008-04-24 17:33:01 +03:00
Lasse Collin
7ab493924e Use 64-bit integer as range encoder's cache size. This fixes a
theoretical data corruption, which should be very hard to trigger
even intentionally.
2008-04-24 17:30:51 +03:00
Lasse Collin
641998c3e1 Replaced the range decoder optimization that used arithmetic
right shift with as fast version that doesn't need
arithmetic right shift. Removed the related check from
configure.ac.
2008-03-24 16:38:40 +02:00
Lasse Collin
ad999efd27 Take advantage of arithmetic right shift in range decoder. 2008-03-22 14:39:34 +02:00
Lasse Collin
03e0e8a0d7 Added autoconf check to detect if we can use arithmetic
right shift for optimizations.
2008-03-22 14:18:29 +02:00
Lasse Collin
7521bbdc83 Update a comment to use the variable name rep_len_decoder.
(And BTW, the previous commit actually did change the
program logic slightly.)
2008-03-22 01:26:36 +02:00
Lasse Collin
63b74d000e Demystified the "state" variable in LZMA code. Use the
word literal instead of char for better consistency.
There are still some names with _char instead of _literal
in lzma_optimum, these may be changed later.

Renamed length coder variables.

This commit doesn't change the program logic.
2008-03-22 00:57:33 +02:00
Lasse Collin
e6eb0a2675 Fix data corruption in LZMA encoder. Note that this bug was
specific to liblzma and was *not* present in LZMA SDK.
2008-03-14 23:16:11 +02:00
Lasse Collin
7d516f5129 Fix a comment API header. 2008-03-14 21:32:37 +02:00
Lasse Collin
748d6e4274 Make lzma_stream.next_in const. Let's see if anyone complains. 2008-03-12 23:14:50 +02:00
Lasse Collin
bfde3b24a5 Apply a minor speed optimization to LZMA decoder. 2008-03-11 15:35:34 +02:00
Lasse Collin
f310c50286 Initialize the last byte of the dictionary to zero so that
lz_get_byte(lz, 0) returns zero. This was broken by
1a3b218598.
2008-03-11 15:17:16 +02:00
Lasse Collin
5ead36cf7f Really fix the price count initialization. 2008-03-10 15:57:55 +02:00
Lasse Collin
d4d7feb83d Updated THANKS. 2008-03-10 13:47:17 +02:00
Lasse Collin
0541c5ea63 Initialize align_price_count and match_price_count in
lzma_encoder_init.c. While we don't call
fill_distances_prices() and fill_align_prices() in
lzma_lzma_encoder_init(), we still need to initialize
these two variables so that the fill functions get
called in lzma_encoder_getoptimum.c in the beginning
of a stream.
2008-03-10 13:46:48 +02:00
Lasse Collin
596fa1fac7 Always initialize lz->temp_size in lz_decoder.c. temp_size did
get initialized as a side-effect after allocating a new decoder,
but not when the decoder was reused.
2008-03-10 13:44:29 +02:00
Lasse Collin
45e43e1695 Don't fill allocated memory with 0xFD when debugging is
enabled. It hides errors from Valgrind.
2008-03-10 13:41:25 +02:00
Lasse Collin
c0e19e0662 Remove two redundant validity checks from the LZMA decoder.
These are already checked elsewhere, so omitting these
gives (very) tiny speed up.
2008-02-28 10:24:31 +02:00
Lasse Collin
de74858062 Tiny clean up to file-format.txt. 2008-02-06 13:25:32 +02:00
Lasse Collin
1a3b218598 Don't memzero() the history buffer when initializing LZ
decoder. There's no danger of information leak here, so
it isn't required. Doing memzero() takes a lot of time
with large dictionaries, which could make it easier to
construct DoS attack to consume too much CPU time.
2008-02-02 14:51:06 +02:00
Lasse Collin
7e796e312b Do uncompressed size validation in raw encoder. This way
it gets done for not only raw encoder, but also Block
and LZMA_Alone encoders.
2008-02-01 08:39:26 +02:00
Lasse Collin
7dd48578a3 Avoid unneeded function call in raw_common.c. 2008-02-01 08:32:05 +02:00
Lasse Collin
b596fac963 Updated THANKS. 2008-01-26 21:42:38 +02:00
Lasse Collin
e9f6e9c075 Added note.GNU-stack to x86 assembler files. It is needed
when using non-executable stack.
2008-01-26 21:40:23 +02:00
Lasse Collin
4c7ad179c7 Added api/lzma/easy.h. I had forgot to add this to the
git repo. Thanks to Stephan Kulow.
2008-01-26 19:12:50 +02:00
Lasse Collin
288b232f54 Added more test files. 2008-01-26 11:09:17 +02:00
Lasse Collin
c467b0defc Added more test files. 2008-01-26 10:47:55 +02:00
Lasse Collin
f9842f7127 Return LZMA_HEADER_ERROR if LZMA_SYNC_FLUSH is used with any
of the so called simple filters. If there is demand, limited
support for LZMA_SYNC_FLUSH may be added in future.

After this commit, using LZMA_SYNC_FLUSH shouldn't cause
undefined behavior in any situation.
2008-01-26 00:25:34 +02:00
Lasse Collin
e988ea1d1a Added more Multi-Block test files. Improved some
descriptions in the test files' README.
2008-01-25 23:50:35 +02:00
Lasse Collin
4441e00418 Combine lzma_options_block validation needed by both Block
encoder and decoder, and put the shared things to
block_private.h. Improved the checks a little so that
they may detect too big Compressed Size at initialization
time if lzma_options_block.total_size or .total_limit is
known.

Allow encoding and decoding Blocks with combinations of
fields that are not allowed by the file format specification.
Doing this requires that the application passes such a
combination in lzma_options_lzma; liblzma doesn't do that,
but it's not impossible that someone could find them useful
in some custom file format.
2008-01-25 23:12:36 +02:00
Lasse Collin
bf4200c818 Added test_memlimit.c. 2008-01-25 19:21:22 +02:00
Lasse Collin
7b8fc7e6b5 Improved the memory limitter:
- Added lzma_memlimit_max() and lzma_memlimit_reached()
    API functions.
  - Added simple estimation of malloc()'s memory usage
    overhead.
  - Fixed integer overflow detection in lzma_memlimit_alloc().
  - Made some white space cleanups and added more comments.

The description of lzma_memlimit_max() in memlimit.h is bad
and should be improved.
2008-01-25 19:20:28 +02:00
Lasse Collin
e0c3d0043d Use more parenthesis in succeed() macro in tests/tests.h. 2008-01-25 13:55:52 +02:00
Lasse Collin
1fd76d4881 Added more Multi-Block Stream test files. 2008-01-24 14:49:34 +02:00
Lasse Collin
6e27b1098a Added bunch of test files containing Multi-Block Streams. 2008-01-24 00:46:05 +02:00
Lasse Collin
db9df0a960 Fix decoding of empty Metadata Blocks, that don't have
even the Metadata Flags field. Earlier the code allowed
such files; now they are prohibited as the file format
specification requires.
2008-01-23 23:43:00 +02:00
Lasse Collin
765f0b05f6 Fix a bug related to 99e12af4e2.
lzma_metadata.header_metadata_size was not properly set to
zero if the Metadata had only the Metadata Flags field.
2008-01-23 23:38:18 +02:00
Lasse Collin
3a7cc5c3de Fix decoding of Extra Records that have empty Data. 2008-01-23 23:35:49 +02:00
Lasse Collin
e5fdec93e2 Add the trailing '\0' to lzma_extra.data as the API header
already documents.
2008-01-23 22:02:38 +02:00
Lasse Collin
ed40dc5a2c Added debug/full_flush.c. 2008-01-23 21:21:21 +02:00
Lasse Collin
ae0cd09a66 Return LZMA_STREAM_END instead of LZMA_OK if
LZMA_SYNC_FLUSH or LZMA_FULL_FLUSH is used when
there's no unfinished Block open.
2008-01-23 21:05:33 +02:00
Lasse Collin
0e80ded13d Added bad-single-none-footer_filter_flags.lzma and
bad-single-none-too_long_vli.lzma.
2008-01-23 20:05:01 +02:00
Lasse Collin
8c8eb14055 Fixed a typo. 2008-01-23 13:42:35 +02:00
Lasse Collin
980f65a9a1 Fix a memory leak in the Subblock encoder. 2008-01-23 13:40:45 +02:00
Lasse Collin
99e12af4e2 Fix Size of Header Metadata Block handling. Now
lzma_metadata.header_metadata_size == LZMA_VLI_VALUE_UNKNOWN
is not allowed at all. To indicate missing Header Metadata
Block, header_metadata_size must be set to zero. This is
what Metadata decoder does after this patch too.

Note that other missing fields in lzma_metadata are still
indicated with LZMA_VLI_VALUE_UNKNOWN. This isn't as
illogical as it sounds at first, because missing Size of
Header Metadata Block means that Header Metadata Block is
not present in the Stream. With other Metadata fields,
a missing field means only that the value is unknown.
2008-01-23 13:36:07 +02:00
Lasse Collin
58b78ab20c Fix a memory leak in metadata_decoder.c. 2008-01-23 13:15:55 +02:00
Lasse Collin
4d8cdbdab4 Fix the fix 863028cb7a which
just moved to problem. Now it's really fixed.
2008-01-23 13:13:58 +02:00
Lasse Collin
67321de963 Take advantage of return_if_error() macro in
lzma_info_metadata_set() in info.c.
2008-01-23 00:21:04 +02:00
Lasse Collin
863028cb7a Fixed a dangling pointer that caused invalid free(). 2008-01-23 00:18:32 +02:00
Lasse Collin
cf49f42a6b Added lzma_easy_* functions. These should make using
liblzma as easy as using zlib, because the easy API
don't require developers to know any fancy LZMA options.

Note that Multi-Block Stream encoding is currently broken.
The easy API should be OK, the bug(s) are elsewhere.
2008-01-22 22:49:24 +02:00
Lasse Collin
1747b85a43 Fix Multi-Block Stream encoder's EOPM usage. 2008-01-22 21:16:22 +02:00
Lasse Collin
0ed6f1adce Made lzma_extra pointers const in lzma_options_stream. 2008-01-22 00:15:11 +02:00
Lasse Collin
305afa38f6 Updated debug/sync_flush.c. 2008-01-20 20:15:21 +02:00
Lasse Collin
d53e9b7705 Added debug/repeat.c. 2008-01-20 20:14:26 +02:00
Lasse Collin
107259e306 Fix alignment handling bugs in Subblock encoder.
This leaves one known alignment bug unfixed: If repeat count
doesn't fit into 28-bit integer, the encoder has to split
this to multiple Subblocks with Subblock Type `Repeating Data'.
The extra Subblocks may have wrong alignment. Correct alignment
is restored after the split Repeating Data has been completely
written out.

Since the encoder doesn't even try to fix the alignment unless
the size of Data is at least 4 bytes, to trigger this bug you
need at least 4 GiB of repeating data with sequence length of
4 or more bytes. Since the worst thing done by this bug is
misaligned data (no data corruption), this bug simply isn't
worth fixing, because a proper fix isn't simple.
2008-01-20 20:12:58 +02:00
Lasse Collin
e141fe1895 Implemented LZMA_SYNC_FLUSH support to the Subblock encoder.
The API for handing Subfilters was changed to make it
consistent with LZMA_SYNC_FLUSH.

A few sanity checks were added for Subfilter handling. Some
small bugs were fixed. More comments were added.
2008-01-19 21:16:33 +02:00
Lasse Collin
23c227a864 Revised the Delta filter implementation. The initialization
function is still shared between encoder and decoder, but the
actual coding is in separate files for encoder and decoder.

There are now separate functions for the actual delta
calculation depending on if Delta is the last filter in the
chain or not. If it is the last, the new code copies the
data from input to output buffer and does the delta
calculation at the same time. The old code first copied the
data, then did the delta in the target buffer, which required
reading through the data twice.

Support for LZMA_SYNC_FLUSH was added to the Delta encoder.
This doesn't change anything in the file format.
2008-01-19 15:19:21 +02:00
Lasse Collin
61dc82f3e3 Added the debug directory and the first debug tool
(sync_flush). These tools are not built unless the
user runs "make" in the debug directory.
2008-01-18 20:18:08 +02:00
Lasse Collin
0ae3208db9 Added test files to test usage of flush marker in LZMA. 2008-01-18 20:13:00 +02:00
Lasse Collin
ab5feaf1fc Fix LZMA_SYNC_FLUSH handling in LZ and LZMA encoders.
That code is now almost completely in LZ coder, where
it can be shared with other LZ77-based algorithms in
future.
2008-01-18 20:02:52 +02:00
Lasse Collin
079c4f7fc2 Don't add -g to CFLAGS when --enable-debug is specified.
It's the job of the user to put that in CFLAGS.
2008-01-18 17:21:24 +02:00
Lasse Collin
61d1784d8f Set stdin and stdout to binary mode on Windows. This patch is
a forward port of b7b22fcb979a16d3a47c8001f058c9f7d4416068
from lzma-utils-legacy.git. I don't know if the new code base
builds on Windows, but this is a start.
2008-01-18 14:17:37 +02:00
Lasse Collin
c9cba97691 Added test_compress.sh and bunch of files needed by it.
This new set of tests compress and decompress several
test files with many different compression options.
This set of tests will be extended later.
2008-01-18 00:50:29 +02:00
Lasse Collin
33be3c0e24 Subblock decoder: Don't exit the main loop in decode_buffer()
too early if we hit End of Input while decoding a Subblock of
type Repeating Data. To keep the loop termination condition
elegant, the order of enumerations in coder->sequence were
changed.

To keep the case-labels in roughly the same order as the
enumerations in coder->sequence, large chunks of code was
moved around. This made the diff big and ugly compared to
the amount of the actual changes made.
2008-01-17 18:56:53 +02:00
Lasse Collin
b254bd97b1 Fix wrong too small size of argument unfiltered_max
in ia64_coder_init(). It triggered assert() in
simple_coder.c, and could have caused a buffer overflow.

This error was probably a copypaste mistake, since most
of the simple filters use unfiltered_max = 4.
2008-01-17 17:39:42 +02:00
Lasse Collin
8f5794c8f1 Added --delta to the output of "lzma --help". 2008-01-17 17:27:45 +02:00
Lasse Collin
f88590e001 Fix Subblock docoder: If Subblock filter was used with known
Uncompressed Size, and the last output byte was from RLE,
the code didn't stop decoding as it should have done.
2008-01-17 13:14:20 +02:00
Lasse Collin
bc0b945ca3 Tiny non-technical edits to file-format.txt. 2008-01-16 16:33:37 +02:00
Lasse Collin
7599bb7064 Plugged a memory leak in stream_decoder.c. 2008-01-16 14:48:04 +02:00
Lasse Collin
0b58153931 Added memory leak detection to lzmadec.c. 2008-01-16 14:47:27 +02:00
Lasse Collin
5b5b13c7bb Added lzma_memlimit_count(). 2008-01-16 14:46:50 +02:00
Lasse Collin
19389f2b82 Added ARRAY_SIZE(array) macro. 2008-01-16 14:31:44 +02:00
Lasse Collin
9bc33a54cb Make Uncompresed Size validation more strict
in alone_decoder.c.
2008-01-16 13:27:03 +02:00
Lasse Collin
01d71d60b7 Free the allocated memory in lzmadec if debugging is
enabled. This should make it possible to detect possible
memory leaks with Valgrind.
2008-01-15 17:46:59 +02:00
Lasse Collin
8235e6e5b2 Fix memory leaks from test_block_header.c. 2008-01-15 16:25:38 +02:00
Lasse Collin
f10fc6a69d Use fastpos.h when encoding LZMA dictionary size in
Filter Flags encoder.
2008-01-15 14:23:35 +02:00
Lasse Collin
e5728142a2 Revised the fastpos code. It now uses the slightly faster
table-based version from LZMA SDK 4.57. This should be
fast on most systems.

A simpler and smaller alternative version is also provided.
On some CPUs this can be even a little faster than the
default table-based version (see comments in fastpos.h),
but on most systems the table-based code is faster.
2008-01-15 14:02:22 +02:00
Lasse Collin
10437b5b56 Added bsr.h. 2008-01-15 13:32:13 +02:00
Lasse Collin
f3c88e8b8d Fixed assembler detection in configure.ac, and added
detection for x86_64.
2008-01-15 13:29:14 +02:00
Lasse Collin
54ec204f58 Omit invalid space from printf() format string
in price_table_gen.c.
2008-01-15 12:20:41 +02:00
Lasse Collin
01b4b19f49 Removed a few unused macros from lzma_common.h. 2008-01-15 09:54:34 +02:00
Lasse Collin
19bd7f3cf2 Fix a typo in lzma_encoder.c. 2008-01-15 08:37:42 +02:00
Lasse Collin
9f9b198301 Convert bittree_get_price() and bittree_reverse_get_price()
from macros to inline functions.
2008-01-15 08:36:25 +02:00
Lasse Collin
78e85cb1a7 Fix CRC code in case --enable-small is used. 2008-01-15 07:44:59 +02:00
Lasse Collin
949d4346e2 Fix typo in test_index.c. 2008-01-15 07:41:39 +02:00
Lasse Collin
d13d693155 Added precomputed range coder probability price table. 2008-01-15 07:40:21 +02:00
Lasse Collin
362dc3843b Remove RC_BUFFER_SIZE from lzma_encoder_private.h
and replace it with a sanity check.
2008-01-14 13:42:43 +02:00
Lasse Collin
e22b37968d Major changes to LZ encoder, LZMA encoder, and range encoder.
These changes implement support for LZMA_SYNC_FLUSH in LZMA
encoder, and move the temporary buffer needed by range encoder
from lzma_range_encoder structure to lzma_lz_encoder.
2008-01-14 13:39:54 +02:00
Lasse Collin
b59ef39737 Added one assert() to process.c of the command line tool. 2008-01-14 13:34:29 +02:00
Lasse Collin
9547e734a0 Don't use coder->lz.stream_end_was_reached in assertions
in match_c.h.
2008-01-14 12:09:52 +02:00
Lasse Collin
3e09e1c058 In lzma_read_match_distances(), don't use
coder->lz.stream_end_was_reached. That variable
will be removed, and the check isn't required anyway.
Rearrange the check so that it doesn't make one to
think that there could be an integer overflow.
2008-01-14 12:08:02 +02:00
Lasse Collin
a670fec802 Small LZMA_SYNC_FLUSH fixes to Block and Single-Stream encoders. 2008-01-14 11:56:41 +02:00
Lasse Collin
3599dba957 More fixes to LZMA decoder's flush marker handling. 2008-01-14 11:54:56 +02:00
Lasse Collin
f73c2ab607 Eliminate lzma_lz_encoder.must_move_pos. It's needed
only in one place which isn't performance criticial.
2008-01-10 17:13:42 +02:00
Lasse Collin
382808514a Define HAVE_ASM_X86 when x86 assembler optimizations are
used. This #define will be useful for inline assembly.
2008-01-09 20:05:57 +02:00
Lasse Collin
0e70fbe403 Added good-single-none-empty_3.lzma and
bad-single-none-empty.lzma.
2008-01-09 12:06:46 +02:00
Lasse Collin
379fbbe84d Take advantage of return_if_error() in block_decoder.c. 2008-01-08 23:11:59 +02:00
Lasse Collin
97d5fa8207 Updated tests/files/README. 2008-01-08 23:10:57 +02:00
Lasse Collin
3bb9bb3109 Added test files with empty Compressed Data. 2008-01-08 23:05:40 +02:00
Lasse Collin
7054c5f588 Fix decoding of Blocks that have only Block Header. 2008-01-08 22:58:42 +02:00
Lasse Collin
753e4d95cd Added good-single-subblock_implicit.lzma. 2008-01-08 22:27:46 +02:00
Lasse Collin
faeac7b7ac Disable CRC32 from Block Headers when --check=none
has been specified.
2008-01-08 18:50:30 +02:00
Lasse Collin
a751126dbb Fixed encoding of empty files. Arguments to is_size_valid()
were in wrong order in block_encoder.c.
2008-01-08 13:36:29 +02:00
Lasse Collin
9080267603 Added a few test files. 2008-01-08 13:35:36 +02:00
Lasse Collin
b4943ccf73 Avoid using ! in test_files.sh, because that doesn't work
with some ancient /bin/sh versions.
2008-01-08 12:29:58 +02:00
Lasse Collin
e2417b2b91 More pre-C99 inttypes.h compatibility fixes. Now the code
should work even if the system has no inttypes.h.
2008-01-08 00:48:30 +02:00
Lasse Collin
5d227e51c2 Updated fi.po although it's currently pretty much crap. 2008-01-07 23:25:32 +02:00
Lasse Collin
c7189d981a Test for $GCC = yes instead of if it is non-empty. This
way it is possible to use ac_cv_c_compiler_gnu=no to
force configure to think it is using non-GNU C compiler.
2008-01-07 23:14:25 +02:00
Lasse Collin
3dbbea82b7 Added test_files.sh to tests/Makefile.am so it gets
included in the tarball with "make dist".
2008-01-07 21:49:41 +02:00
Lasse Collin
2fd2d18154 Cosmetic edit to test_files.sh. 2008-01-07 18:22:24 +02:00
Lasse Collin
9a71d57310 Added tests/files/README. 2008-01-07 18:09:44 +02:00
Lasse Collin
47f48fe993 Tell in COPYING that everything in tests/files is
public domain.
2008-01-07 14:20:57 +02:00
Lasse Collin
3502b3e1d0 Cleaned up the tests/files directory. 2008-01-07 14:19:05 +02:00
Lasse Collin
908b2ac604 Added test_files.sh to test decoding of the files in
the tests/files directory. It doesn't test the malicious
files yet.
2008-01-07 13:49:19 +02:00
Lasse Collin
ecb2a6548f Updated README regarding the assembler optimizations. 2008-01-07 11:23:13 +02:00
Lasse Collin
eacb805043 Updated THANKS. 2008-01-07 10:58:00 +02:00
Lasse Collin
1239649f96 Cosmetic changes to configure.ac. 2008-01-06 21:47:17 +02:00
Lasse Collin
88ee301ec2 Automatically disable assembler code on Darwin x86.
Darwin has different ABI than GNU+Linux and Solaris,
thus the assembler code doesn't assemble on Darwin.
2008-01-06 19:46:38 +02:00
Lasse Collin
c15a7abf66 With printf(), use PRIu64 with a cast to uint64_t instead
of %zu, because some pre-C99 libc versions don't support %zu.
2008-01-06 19:45:27 +02:00
Lasse Collin
4e7e54c4c5 Introduced compatibility with systems that have pre-C99
or no inttypes.h. This is useful when the compiler has
good enough support for C99, but libc headers don't.

Changed liblzma API so that sys/types.h and inttypes.h
have to be #included before #including lzma.h. On systems
that don't have C99 inttypes.h, it's the problem of the
applications to provide the required types and macros
before #including lzma.h.

If lzma.h defined the missing types and macros, it could
conflict with third-party applications whose configure
has detected that the types are missing and defined them
in config.h already. An alternative would have been
introducing lzma_uint32 and similar types, but that would
just be an extra pain on modern systems.
2008-01-06 16:27:41 +02:00
Lasse Collin
a71864f77d Fix typo in comment (INT64_MAX -> UINT64_MAX). 2008-01-05 19:57:00 +02:00
Lasse Collin
072927905a Rearranged testing of GCC-specific flags. 2008-01-05 19:42:04 +02:00
Lasse Collin
d160ee3259 Another bug fix for flush marker detection. 2008-01-05 01:20:24 +02:00
Lasse Collin
fc67f79f60 Fix stupid bugs in flush marker detection. 2008-01-04 21:37:01 +02:00
Lasse Collin
0029cbbabe Added support for flush marker, which will be in files
that use LZMA_SYNC_FLUSH with encoder (not implemented
yet). This is a new feature in the raw LZMA format,
which isn't supported by old decoders. This shouldn't
be a problem in practice, since lzma_alone_encoder()
will not allow LZMA_SYNC_FLUSH, and thus not allow
creating files on decodable with old decoders.

Made lzma_decoder.c to require tab width of 4 characters
if one wants to fit the code in 80 columns. This makes
the code easier to read.
2008-01-04 21:30:33 +02:00
Lasse Collin
bbfd1f6ab0 Moved range decoder initialization (reading the first
five input bytes) from LZMA decoder to range decoder
header. Did the same for decoding of direct bits.
2008-01-04 20:45:05 +02:00
Lasse Collin
5db745cd2a Added a note to README that --disable-assembler
must be used on Darwin.
2007-12-14 11:15:21 +02:00
Lasse Collin
44b333d461 Use the filename suffix .S instead of .s for assembler files
so that the preprocessor removes the /* */ style comments,
which are not supported by some non-GNU assemblers (Solaris)
that otherwise work with this code.
2007-12-14 10:07:10 +02:00
Lasse Collin
ec1c82b2e8 Fixed wrong symbol name in crc64_x86.s. 2007-12-14 09:59:05 +02:00
Lasse Collin
2881570df6 Use .globl instead of .global in x86 assembler code for
better portability. Still needs fixing the commenting.
2007-12-14 09:53:24 +02:00
Lasse Collin
698470b8f3 Fixed a few short options that take an argument.
short_opts[] was missing colons to indicate
required argument. Thanks to Fabio Pedretti for
the bug report.
2007-12-13 20:14:37 +02:00
Lasse Collin
918bcb0e07 Removed uncompressed size tracking from Delta encoder too. 2007-12-11 17:08:04 +02:00
Lasse Collin
3e16d51dd6 Remove uncompressed size tracking from the filter encoders.
It's not strictly needed there, and just complicates the
code. LZ encoder never even had this feature.

The primary reason to have uncompressed size tracking in
filter encoders was validating that the application
doesn't give different amount of input that it had
promised. A side effect was to validate internal workings
of liblzma.

Uncompressed size tracking is still present in the Block
encoder. Maybe it should be added to LZMA_Alone and raw
encoders too. It's simpler to have one coder just to
validate the uncompressed size instead of having it
in every filter.
2007-12-11 16:49:19 +02:00
Lasse Collin
5286723e0d Get rid of no-NLS gnulib. I don't know how to get it
working with Automake. People who want smaller lzmadec
should use --disable-nls on non-GNU systems.
2007-12-11 14:10:53 +02:00
Lasse Collin
ce8b036a6c Fixed a typo in tests/Makefile.am which prevented
building the tests if gnulib was needed.
2007-12-11 14:09:35 +02:00
Lasse Collin
7c1ad41eb6 Fixed wrong type of flags_size in Subblock encoder. 2007-12-11 11:18:58 +02:00
Lasse Collin
ce64df7162 Bumped version number to 4.42.3alpha. 2007-12-10 20:44:16 +02:00
494 changed files with 44966 additions and 31468 deletions

64
.gitignore vendored Normal file
View File

@@ -0,0 +1,64 @@
*~
*.bak
*.bak[0-9]
.deps
.libs
*.la
*.lo
*.o
Makefile.in
/ABOUT-NLS
/autom4te.cache
/Doxyfile
/aclocal.m4
/config.h
/config.h.in
/config.log
/config.status
/configure
/libtool
/stamp-h1
build-aux/compile
build-aux/config.guess
build-aux/config.rpath
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/missing
/src/liblzma/liblzma.pc
/src/lzmainfo/lzmainfo
/src/xz/xz
/src/xzdec/lzmadec
/src/xzdec/xzdec
/src/scripts/xzdiff
/src/scripts/xzgrep
/src/scripts/xzless
/src/scripts/xzmore
/tests/compress_generated_abc
/tests/compress_generated_random
/tests/compress_generated_text
/tests/create_compress_files
/tests/test_block_header
/tests/test_check
/tests/test_filter_flags
/tests/test_index
/tests/test_stream_flags
/lib/Makefile
/tests/Makefile
/Makefile
/debug/Makefile
/src/scripts/Makefile
/src/xz/Makefile
/src/Makefile
/src/liblzma/Makefile
/src/liblzma/api/Makefile
/src/lzmainfo/Makefile
/src/xzdec/Makefile

35
AUTHORS
View File

@@ -1,18 +1,27 @@
Authors of LZMA Utils
---------------------
Authors of XZ Utils
===================
Igor Pavlov
* designed LZMA as an algorithm;
* wrote an implementation known as LZMA SDK, which is part of
the bigger 7-Zip project.
XZ Utils is developed and maintained by Lasse Collin
<lasse.collin@tukaani.org>.
Ville Koskinen
* wrote the first version of the gzip-like lzma command line
utility (C++)
* helped a lot with the documentation.
Major parts of liblzma are based on code written by Igor Pavlov,
specifically the LZMA SDK <http://7-zip.org/sdk.html>. Without
this code, XZ Utils wouldn't exist.
Lasse Collin
* ported LZMA SDK to C and zlib-like API (liblzma);
* rewrote the command line tool again to use liblzma and pthreads.
The SHA-256 implementation in liblzma is based on the code found from
7-Zip <http://7-zip.org/>, which has a modified version of the SHA-256
code found from Crypto++ <http://www.cryptopp.com/>. The SHA-256 code
in Crypto++ was written by Kevin Springle and Wei Dai.
Some scripts have been adapted from gzip. The original versions
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
Andrew Dudman helped adapting the script and their man pages for
XZ Utils.
The GNU Autotools based build system contains files from many authors,
which I'm not trying list here.
Several people have contributed fixes or reported bugs. Most of them
are mentioned in the file THANKS.

69
COPYING
View File

@@ -1,24 +1,65 @@
LZMA Utils Licenses
-------------------
XZ Utils Licensing
==================
Different licenses apply to different files in this package. Here
is a rough summary of which license apply to which parts of this
is a rough summary of which licenses apply to which parts of this
package (but check the individual files to be sure!):
- Everything under src/liblzma/check is public domain.
- Everything else under the src directory is under the GNU LGPL
2.1 or (at your opinion) any later version.
- Outside the src directory, there are some files that are under
the GNU GPL 2 or (at your opinion) any later version, or under
the GNU GPL 3 or (at your opinion) any later version.
- Most documentation files are under an all-permissive license.
The following license texts are included in the following files
in this package:
- liblzma is in the public domain.
- xz, xzdec, and lzmadec command line tools are in the public
domain unless GNU getopt_long had to be compiled and linked
in from the lib directory. The getopt_long code is under
GNU LGPLv2.1+.
- The scripts to grep, diff, and view compressed files have been
adapted from gzip. These scripts and their documentation are
under GNU GPLv2+.
- All the documentation in the doc directory and most of the
XZ Utils specific documentation files in other directories
are in the public domain.
- Translated messages are in the public domain.
- The build system contains public domain files, and files that
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
in the binaries being built.
- Test files and test code in the tests directory, and debugging
utilities in the debug directory are in the public domain.
- The extra directory may contain public domain files, and files
that are under various free software licenses.
You can do whatever you want with the files that have been put into
the public domain. If you find public domain legally problematic,
take the previous sentence as a license grant. If you still find
the lack of copyright legally problematic, you have too many
lawyers.
As usual, this software is provided "as is", without any warranty.
If you copy significant amounts of public domain code from XZ Utils
into your project, acknowledging this somewhere in your software is
polite (especially if it is proprietary, non-free software), but
naturally it is not legally required. Here is an example of a good
notice to put into "about box" or into documentation:
This software includes code from XZ Utils <http://tukaani.org/xz/>.
The following license texts are included in the following files:
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
- COPYING.GPLv2: GNU General Public License version 2
- COPYING.GPLv3: GNU General Public License version 3
If you have questions, don't hesitate to ask the copyright holder(s)
for more information.
Note that the toolchain (compiler, linker etc.) may add some code
pieces that are copyrighted. Thus, it is possible that e.g. liblzma
binary wouldn't actually be in the public domain in its entirety
even though it contains no copyrighted code from the XZ Utils source
package.
If you have questions, don't hesitate to ask the author(s) for more
information.

View File

@@ -1,2 +1,7 @@
See the commit log in the git repository:
git://ctrl.tukaani.org/lzma-utils.git
git clone http://git.tukaani.org/xz.git
Note that "make dist" doesn't put this tiny file into the package.
Instead, the git commit log is used as ChangeLog. See dist-hook in
Makefile.am for details.

View File

@@ -1,5 +1,8 @@
# Doxyfile 1.4.7
# Copyright (C) 1997-2007 by Dimitri van Heesch
# License: GNU GPLv2+
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
@@ -115,7 +118,7 @@ FULL_PATH_NAMES = YES
# If left blank the directory from which doxygen is run is used as the
# path to strip.
STRIP_FROM_PATH =
STRIP_FROM_PATH = @top_srcdir@/src
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
@@ -955,13 +958,13 @@ ENABLE_PREPROCESSING = YES
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
@@ -989,7 +992,9 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED =
PREDEFINED = LZMA_API(type)=type \
LZMA_API_IMPORT \
LZMA_API_CALL=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.

444
INSTALL Normal file
View File

@@ -0,0 +1,444 @@
XZ Utils Installation
=====================
0. Preface
1. Supported platforms
1.1. Compilers
1.2. Platform-specific notes
1.2.1. IRIX
1.2.2. MINIX 3
1.2.3. OpenVMS
1.2.4. Tru64
1.2.5. Windows
1.2.6. DOS
1.3. Adding support for new platforms
2. configure options
2.1. Static vs. dynamic linking of liblzma
2.2. Optimizing xzdec and lzmadec
3. xzgrep and other scripts
3.1. Dependencies
3.2. PATH
4. Troubleshooting
4.1. "No C99 compiler was found."
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
0. Preface
----------
If you aren't familiar with building packages that use GNU Autotools,
see the file INSTALL.generic for generic instructions before reading
further.
If you are going to build a package for distribution, see also the
file PACKAGERS. It contains information that should help making the
binary packages as good as possible, but the information isn't very
interesting to those making local builds for private use or for use
in special situations like embedded systems.
1. Supported platforms
----------------------
XZ Utils are developed on GNU/Linux, but they should work on many
POSIX-like operating systems like *BSDs and Solaris, and even on
a few non-POSIX operating systems.
1.1. Compilers
A C99 compiler is required to compile XZ Utils. If you use GCC, you
need at least version 3.x.x. GCC version 2.xx.x doesn't support some
C99 features used in XZ Utils source code, thus GCC 2 won't compile
XZ Utils.
XZ Utils takes advantage of some GNU C extensions when building
with GCC. Because these extensions are used only when building
with GCC, it should be possible to use any C99 compiler.
1.2. Platform-specific notes
1.2.1. IRIX
MIPSpro 7.4.4m has been reported to produce broken code if using
the -O2 optimization flag ("make check" fails). Using -O1 should
work.
A problem has been reported when using shared liblzma. Passing
--disable-shared to configure works around this. Alternatively,
putting "-64" to CFLAGS to build a 64-bit version might help too.
1.2.2. MINIX 3
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
which doesn't support C99. Install GCC to compile XZ Utils.
MINIX 3.1.8 (and possibly some other versions too) has bugs in
/usr/include/stdint.h, which has to be patched before XZ Utils
can be compiled correctly. See
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
XZ Utils doesn't have code to detect the amount of physical RAM and
number of CPU cores on MINIX 3.
See section 4.4 in this file about symbol visibility warnings (you
may want to pass gl_cv_cc_visibility=no to configure).
1.2.3. OpenVMS
XZ Utils can be built for OpenVMS, but the build system files
are not included in the XZ Utils source package. The required
OpenVMS-specific files are maintained by Jouk Jansen and can be
downloaded here:
http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils
1.2.4. Tru64
If you try to use the native C compiler on Tru64 (passing CC=cc to
configure), you may need the workaround mention in section 4.1 in
this file (pass also ac_cv_prog_cc_c99= to configure).
1.2.5. Windows
Building XZ Utils on Windows is supported under MinGW + MSYS,
MinGW-w64 + MSYS, and Cygwin. There is windows/build.bash to
ease packaging XZ Utils with MinGW(-w64) + MSYS into a
redistributable .zip or .7z file. See windows/INSTALL-Windows.txt
for more information.
It might be possible to build liblzma with a non-GNU toolchain too,
but that will probably require writing a separate makefile. Building
the command line tools with non-GNU toolchains will be harder than
building only liblzma.
Even if liblzma is built with MinGW, the resulting DLL or static
library can be used by other compilers and linkers, including MSVC.
Thus, it shouldn't be a problem to use MinGW to build liblzma even
if you cannot use MinGW to build the rest of your project. See
windows/README-Windows.txt for details.
1.2.6. DOS
There is an experimental Makefile in the "dos" directory to build
XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
needed. See dos/README for more information.
GNU Autotools based build hasn't been tried on DOS. If you try, I
would like to hear if it worked.
1.3. Adding support for new platforms
If you have written patches to make XZ Utils to work on previously
unsupported platform, please send the patches to me! I will consider
including them to the official version. It's nice to minimize the
need of third-party patching.
One exception: Don't request or send patches to change the whole
source package to C89. I find C99 substantially nicer to write and
maintain. However, the public library headers must be in C89 to
avoid frustrating those who maintain programs, which are strictly
in C89 or C++.
2. configure options
--------------------
In most cases, the defaults are what you want. Many of the options
below are useful only when building a size-optimized version of
liblzma or command line tools.
--enable-encoders=LIST
--disable-encoders
Specify a comma-separated LIST of filter encoders to
build. See "./configure --help" for exact list of
available filter encoders. The default is to build all
supported encoders.
If LIST is empty or --disable-encoders is used, no filter
encoders will be built and also the code shared between
encoders will be omitted.
Disabling encoders will remove some symbols from the
liblzma ABI, so this option should be used only when it
is known to not cause problems.
--enable-decoders=LIST
--disable-decoders
This is like --enable-encoders but for decoders. The
default is to build all supported decoders.
--enable-match-finders=LIST
liblzma includes two categories of match finders:
hash chains and binary trees. Hash chains (hc3 and hc4)
are quite fast but they don't provide the best compression
ratio. Binary trees (bt2, bt3 and bt4) give excellent
compression ratio, but they are slower and need more
memory than hash chains.
You need to enable at least one match finder to build the
LZMA1 or LZMA2 filter encoders. Usually hash chains are
used only in the fast mode, while binary trees are used to
when the best compression ratio is wanted.
The default is to build all the match finders if LZMA1
or LZMA2 filter encoders are being built.
--enable-checks=LIST
liblzma support multiple integrity checks. CRC32 is
mandatory, and cannot be omitted. See "./configure --help"
for exact list of available integrity check types.
liblzma and the command line tools can decompress files
which use unsupported integrity check type, but naturally
the file integrity cannot be verified in that case.
Disabling integrity checks may remove some symbols from
the liblzma ABI, so this option should be used only when
it is known to not cause problems.
--disable-xz
--disable-xzdec
--disable-lzmadec
--disable-lzmainfo
Don't build and install the command line tool mentioned
in the option name.
NOTE: Disabling xz will skip some tests in "make check".
NOTE: If xzdec is disabled and lzmadec is left enabled,
a dangling man page symlink lzmadec.1 -> xzdec.1 is
created.
--disable-lzma-links
Don't create symlinks for LZMA Utils compatibility.
This includes lzma, unlzma, and lzcat. If scripts are
installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep,
lzmore, and lzless will be omitted if this option is used.
--disable-scripts
Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
and their symlinks.
--disable-assembler
liblzma includes some assembler optimizations. Currently
there is only assembler code for CRC32 and CRC64 for
32-bit x86.
All the assembler code in liblzma is position-independent
code, which is suitable for use in shared libraries and
position-independent executables. So far only i386
instructions are used, but the code is optimized for i686
class CPUs. If you are compiling liblzma exclusively for
pre-i686 systems, you may want to disable the assembler
code.
--enable-unaligned-access
Allow liblzma to use unaligned memory access for 16-bit
and 32-bit loads and stores. This should be enabled only
when the hardware supports this, i.e. when unaligned
access is fast. Some operating system kernels emulate
unaligned access, which is extremely slow. This option
shouldn't be used on systems that rely on such emulation.
Unaligned access is enabled by default on x86, x86-64,
and big endian PowerPC.
--enable-small
Reduce the size of liblzma by selecting smaller but
semantically equivalent version of some functions, and
omit precomputed lookup tables. This option tends to
make liblzma slightly slower.
Note that while omitting the precomputed tables makes
liblzma smaller on disk, the tables are still needed at
run time, and need to be computed at startup. This also
means that the RAM holding the tables won't be shared
between applications linked against shared liblzma.
This option doesn't modify CFLAGS to tell the compiler
to optimize for size. You need to add -Os or equivalent
flag(s) to CFLAGS manually.
--enable-assume-ram=SIZE
On the most common operating systems, XZ Utils is able to
detect the amount of physical memory on the system. This
information is used by the options --memlimit-compress,
--memlimit-decompress, and --memlimit when setting the
limit to a percentage of total RAM.
On some systems, there is no code to detect the amount of
RAM though. Using --enable-assume-ram one can set how much
memory to assume on these systems. SIZE is given as MiB.
The default is 128 MiB.
Feel free to send patches to add support for detecting
the amount of RAM on the operating system you use. See
src/common/tuklib_physmem.c for details.
--disable-threads
Disable threading support. This makes some things
thread-unsafe, meaning that if multithreaded application
calls liblzma functions from more than one thread,
something bad may happen.
Use this option if threading support causes you trouble,
or if you know that you will use liblzma only from
single-threaded applications and want to avoid dependency
on libpthread.
--enable-debug
This enables the assert() macro and possibly some other
run-time consistency checks. It makes the code slower, so
you normally don't want to have this enabled.
--enable-werror
If building with GCC, make all compiler warnings an error,
that abort the compilation. This may help catching bugs,
and should work on most systems. This has no effect on the
resulting binaries.
2.1. Static vs. dynamic linking of liblzma
On 32-bit x86, linking against static liblzma can give a minor
speed improvement. Static libraries on x86 are usually compiled as
position-dependent code (non-PIC) and shared libraries are built as
position-independent code (PIC). PIC wastes one register, which can
make the code slightly slower compared to a non-PIC version. (Note
that this doesn't apply to x86-64.)
If you want to link xz against static liblzma, the simplest way
is to pass --disable-shared to configure. If you want also shared
liblzma, run configure again and run "make install" only for
src/liblzma.
2.2. Optimizing xzdec and lzmadec
xzdec and lzmadec are intended to be relatively small instead of
optimizing for the best speed. Thus, it is a good idea to build
xzdec and lzmadec separately:
- To link the tools against static liblzma, pass --disable-shared
to configure.
- To select somewhat size-optimized variant of some things in
liblzma, pass --enable-small to configure.
- Tell the compiler to optimize for size instead of speed.
E.g. with GCC, put -Os into CFLAGS.
- xzdec and lzmadec will never use multithreading capabilities of
liblzma. You can avoid dependency on libpthread by passing
--disable-threads to configure.
- There are and will be no translated messages for xzdec and
lzmadec, so it is fine to pass also --disable-nls to configure.
- Only decoder code is needed, so you can speed up the build
slightly by passing --disable-encoders to configure. This
shouldn't affect the final size of the executables though,
because the linker is able to omit the encoder code anyway.
If you have no use for xzdec or lzmadec, you can disable them with
--disable-xzdec and --disable-lzmadec.
3. xzgrep and other scripts
---------------------------
3.1. Dependencies
POSIX shell (sh) and bunch of other standard POSIX tools are required
to run the scripts. The configure script tries to find a POSIX
compliant sh, but if it fails, you can force the shell by passing
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
script.
Some of the scripts require also mktemp. The original mktemp can be
found from <http://www.mktemp.org/>. On GNU, most will use the mktemp
program from GNU coreutils instead of the original implementation.
Both mktemp versions are fine for XZ Utils (and practically for
everything else too).
3.2. PATH
The scripts assume that the required tools (standard POSIX utilities,
mktemp, and xz) are in PATH; the scripts don't set the PATH themselves.
Some people like this while some think this is a bug. Those in the
latter group can easily patch the scripts before running the configure
script by taking advantage of a placeholder line in the scripts.
For example, to make the scripts prefix /usr/bin:/bin to PATH:
perl -pi -e 's|^#SET_PATH.*$|PATH=/usr/bin:/bin:\$PATH|' \
src/scripts/xz*.in
4. Troubleshooting
------------------
4.1. "No C99 compiler was found."
You need a C99 compiler to build XZ Utils. If the configure script
cannot find a C99 compiler and you think you have such a compiler
installed, set the compiler command by passing CC=/path/to/c99 as
an argument to the configure script.
If you get this error even when you think your compiler supports C99,
you can override the test by passing ac_cv_prog_cc_c99= as an argument
to the configure script. The test for C99 compiler is not perfect (and
it is not as easy to make it perfect as it sounds), so sometimes this
may be needed. You will get a compile error if your compiler doesn't
support enough C99.
4.2. "No POSIX conforming shell (sh) was found."
xzgrep and other scripts need a shell that (roughly) conforms
to POSIX. The configure script tries to find such a shell. If
it fails, you can force the shell to be used by passing
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
script.
4.3. configure works but build fails at crc32_x86.S
The easy fix is to pass --disable-assembler to the configure script.
The configure script determines if assembler code can be used by
looking at the configure triplet; there is currently no check if
the assembler code can actually actually be built. The x86 assembler
code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
Cygwin, and DJGPP. On other x86 systems, there may be problems and
the assembler code may need to be disabled with the configure option.
If you get this error when building for x86-64, you have specified or
the configure script has misguessed your architecture. Pass the
correct configure triplet using the --build=CPU-COMPANY-SYSTEM option
(see INSTALL.generic).
4.4. Lots of warnings about symbol visibility
On some systems where symbol visibility isn't supported, GCC may
still accept the visibility options and attributes, which will make
configure think that visibility is supported. This will result in
many compiler warnings. You can avoid the warnings by forcing the
visibility support off by passing gl_cv_cc_visibility=no as an
argument to the configure script. This has no effect on the
resulting binaries, but fewer warnings looks nicer and may allow
using --enable-werror.

365
INSTALL.generic Normal file
View File

@@ -0,0 +1,365 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@@ -1,17 +1,11 @@
##
## Copyright (C) 2007 Lasse Collin
## Author: Lasse Collin
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
DIST_SUBDIRS = lib src po tests debug
SUBDIRS =
if COND_GNULIB
@@ -20,16 +14,80 @@ endif
SUBDIRS += src po tests
dist_doc_DATA = \
AUTHORS \
COPYING \
COPYING.GPLv2 \
NEWS \
README \
THANKS \
TODO \
doc/faq.txt \
doc/history.txt \
doc/xz-file-format.txt \
doc/lzma-file-format.txt
examplesdir = $(docdir)/examples
dist_examples_DATA = \
doc/examples/xz_pipe_comp.c \
doc/examples/xz_pipe_decomp.c
EXTRA_DIST = \
m4 \
config.rpath \
Doxyfile.in \
extra \
doc \
dos \
windows \
autogen.sh \
Doxyfile.in \
COPYING.GPLv2 \
COPYING.GPLv3 \
COPYING.LGPLv2.1
COPYING.LGPLv2.1 \
INSTALL.generic \
PACKAGERS \
build-aux/manconv.sh \
build-aux/version.sh
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
# List of man pages to conver to PDF and plain text in the dist-hook target.
manfiles = \
src/xz/xz.1 \
src/xzdec/xzdec.1 \
src/lzmainfo/lzmainfo.1 \
src/scripts/xzdiff.1 \
src/scripts/xzgrep.1 \
src/scripts/xzless.1 \
src/scripts/xzmore.1
# Create ChangeLog from output of "git log --date=iso --stat".
# Convert the man pages to PDF and plain text (ASCII only) formats.
dist-hook:
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
( cd "$(srcdir)" && git log --date=iso --stat ) \
> "$(distdir)/ChangeLog"; \
fi
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
dest="$(distdir)/doc/man" && \
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
for FILE in $(manfiles); do \
BASE=`basename $$FILE .1` && \
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-letter/$$BASE-letter.pdf" && \
sh "$(srcdir)/build-aux/manconv.sh" ascii \
< "$(srcdir)/$$FILE" \
> "$$dest/txt/$$BASE.txt"; \
done; \
fi
# This works with GNU tar and gives cleaner package than normal 'make dist'.
mydist:
VERSION=$(VERSION); \
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
fi; \
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
$(MAKE) VERSION="$$VERSION" dist-gzip

94
NEWS
View File

@@ -0,0 +1,94 @@
XZ Utils User-Visible Changes
=============================
5.0.2 (2011-04-01)
* LZMA2 decompressor now correctly accepts LZMA2 streams with no
uncompressed data. Previously it considered them corrupt. The
bug can affect applications that use raw LZMA2 streams. It is
very unlikely to affect .xz files because no compressor creates
.xz files with empty LZMA2 streams. (Empty .xz files are a
different thing than empty LZMA2 streams.)
* "xz --suffix=.foo filename.foo" now refuses to compress the
file due to it already having the suffix .foo. It was already
documented on the man page, but the code lacked the test.
* "xzgrep -l foo bar.xz" works now.
* Polish translation was added.
5.0.1 (2011-01-29)
* xz --force now (de)compresses files that have setuid, setgid,
or sticky bit set and files that have multiple hard links.
The man page had it documented this way already, but the code
had a bug.
* gzip and bzip2 support in xzdiff was fixed.
* Portability fixes
* Minor fix to Czech translation
5.0.0 (2010-10-23)
Only the most important changes compared to 4.999.9beta are listed
here. One change is especially important:
* The memory usage limit is now disabled by default. Some scripts
written before this change may have used --memory=max on xz command
line or in XZ_OPT. THESE USES OF --memory=max SHOULD BE REMOVED
NOW, because they interfere with user's ability to set the memory
usage limit himself. If user-specified limit causes problems to
your script, blame the user.
Other significant changes:
* Added support for XZ_DEFAULTS environment variable. This variable
allows users to set default options for xz, e.g. default memory
usage limit or default compression level. Scripts that use xz
must never set or unset XZ_DEFAULTS. Scripts should use XZ_OPT
instead if they need a way to pass options to xz via an
environment variable.
* The compression settings associated with the preset levels
-0 ... -9 have been changed. --extreme was changed a little too.
It is now less likely to make compression worse, but with some
files the new --extreme may compress slightly worse than the old
--extreme.
* If a preset level (-0 ... -9) is specified after a custom filter
chain options have been used (e.g. --lzma2), the custom filter
chain will be forgotten. Earlier the preset options were
completely ignored after custom filter chain options had been
seen.
* xz will create sparse files when decompressing if the uncompressed
data contains long sequences of binary zeros. This is done even
when writing to standard output that is connected to a regular
file and certain additional conditions are met to make it safe.
* Support for "xz --list" was added. Combine with --verbose or
--verbose --verbose (-vv) for detailed output.
* I had hoped that liblzma API would have been stable after
4.999.9beta, but there have been a couple of changes in the
advanced features, which don't affect most applications:
- Index handling code was revised. If you were using the old
API, you will get a compiler error (so it's easy to notice).
- A subtle but important change was made to the Block handling
API. lzma_block.version has to be initialized even for
lzma_block_header_decode(). Code that doesn't do it will work
for now, but might break in the future, which makes this API
change easy to miss.
* The major soname has been bumped to 5.0.0. liblzma API and ABI
are now stable, so the need to recompile programs linking against
liblzma shouldn't arise soon.

231
PACKAGERS Normal file
View File

@@ -0,0 +1,231 @@
Information to packagers of XZ Utils
====================================
0. Preface
1. Package naming
2. Package description
3. License
4. configure options
5. Additional documentation
6. Extra files
7. Installing XZ Utils and LZMA Utils in parallel
8. Example
0. Preface
----------
This document is meant for people who create and maintain XZ Utils
packages for operating system distributions. The focus is on GNU/Linux
systems, but most things apply to other systems too.
While the standard "configure && make DESTDIR=$PKG install" should
give a pretty good package, there are some details which packagers
may want to tweak.
Packagers should also read the INSTALL file.
1. Package naming
-----------------
The preferred name for the XZ Utils package is "xz", because that's
the name of the upstream tarball. Naturally you may have good reasons
to use some other name; I won't get angry about it. ;-) It's just nice
to be able to point people to the correct package name without asking
what distro they have.
If your distro policy is to split things into small pieces, here is
one suggestion:
xz xz, xzdec, scripts (xzdiff, xzgrep, etc.), docs
xz-lzma lzma, unlzma, lzcat, lzgrep etc. symlinks and
lzmadec binary for compatibility with LZMA Utils
liblzma liblzma.so.*
liblzma-devel liblzma.so, liblzma.a, API headers
2. Package description
----------------------
Here is a suggestion which you may use as the package description.
If you can use only one-line description, pick only the first line.
Naturally, feel free to use some other description if you find it
better, and maybe send it to me too.
Library and command line tools for XZ and LZMA compressed files
XZ Utils provide a general purpose data compression library
and command line tools. The native file format is the .xz
format, but also the legacy .lzma format is supported. The .xz
format supports multiple compression algorithms, of which LZMA2
is currently the primary algorithm. With typical files, XZ Utils
create about 30 % smaller files than gzip.
If you are splitting XZ Utils into multiple packages, here are some
suggestions for package descriptions:
xz:
Command line tools for XZ and LZMA compressed files
This package includes the xz compression tool and other command
line tools from XZ Utils. xz has command line syntax similar to
that of gzip. The native file format is the .xz format, but also
the legacy .lzma format is supported. The .xz format supports
multiple compression algorithms, of which LZMA2 is currently the
primary algorithm. With typical files, XZ Utils create about 30 %
smaller files than gzip.
Note that this package doesn't include the files needed for
LZMA Utils 4.32.x compatibility. Install also the xz-lzma
package to make XZ Utils emulate LZMA Utils 4.32.x.
xz-lzma:
LZMA Utils emulation with XZ Utils
This package includes executables and symlinks to make
XZ Utils emulate lzma, unlzma, lzcat, and other command
line tools found from the legacy LZMA Utils 4.32.x package.
liblzma:
Library for XZ and LZMA compressed files
liblzma is a general purpose data compression library with
an API similar to that of zlib. liblzma supports multiple
algorithms, of which LZMA2 is currently the primary algorithm.
The native file format is .xz, but also the legacy .lzma
format and raw streams (no headers at all) are supported.
This package includes the shared library.
liblzma-devel:
Library for XZ and LZMA compressed files
This package includes the API headers, static library, and
other development files related to liblzma.
3. License
----------
If the package manager supports a license field, you probably should
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
XZ Utils are in the public domain, but some less important files
ending up into the binary package are under GPLv2+. So it is simplest
to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
If you split XZ Utils into multiple packages as described earlier
in this file, liblzma and liblzma-dev packages will contain only
public domain code (from XZ Utils at least; compiler or linker may
add some third-party code, which may be copyrighted).
4. configure options
--------------------
Unless you are building a package for a distribution that is meant
only for embedded systems, don't use the following configure options:
--enable-debug
--enable-encoders (*)
--enable-decoders
--enable-match-finders
--enable-checks
--enable-small (*)
--disable-threads (*)
(*) These are OK when building xzdec and lzmadec as described
in INSTALL.
xzdec and lzmadec don't provide any functionality that isn't already
available in the xz tool. Shipping xzdec and lzmadec without size
optimization and statically-linked liblzma isn't very useful. Doing
that would give users the xzdec man page, which may make it easier
for people to find out that such tools exists, but the executables
wouldn't have any advantage over the full-featured xz.
5. Additional documentation
---------------------------
"make install" copies some additional documentation to $docdir
(--docdir in configure). There is a copy of the GNU GPL v2, which
can be replaced with a symlink if your distro ships with shared
copies of the common license texts.
liblzma API is currently only documented using Doxygen tags in the
API headers. It hasn't been tested much how good results Doxygen
is able to make from the tags (e.g. Doxyfile might need tweaking,
the tagging may need to be improved etc.), so it might be simpler
to just let people read docs directly from the .h files for now,
and also save quite a bit in package size at the same time.
6. Extra files
--------------
The "extra" directory contains some small extra tools or other files.
The exact set of extra files can vary between XZ Utils releases. The
extra files have only limited use or they are too dangerous to be
put directly to $bindir (7z2lzma.sh is a good example, since it can
silently create corrupt output if certain conditions are not met).
If you feel like it, you may copy the extra directory under the doc
directory (e.g. /usr/share/doc/xz/extra). Maybe some people will find
them useful. However, most people needing these tools probably are
able to find them from the source package too.
The "debug" directory contains some tools that are useful only when
hacking on XZ Utils. Don't package these tools.
7. Installing XZ Utils and LZMA Utils in parallel
-------------------------------------------------
XZ Utils and LZMA Utils 4.32.x can be installed in parallel by
omitting the compatibility symlinks (lzma, unlzma, lzcat, lzgrep etc.)
from the XZ Utils package. It's probably a good idea to still package
the symlinks into a separate package so that users may choose if they
want to use XZ Utils or LZMA Utils for handling .lzma files.
8. Example
----------
Here is an example for i686 GNU/Linux that
- links xz and lzmainfo against shared liblzma;
- links size-optimized xzdec and lzmadec against static liblzma
while avoiding libpthread dependency;
- includes only shared liblzma in the final package; and
- copies also the "extra" directory to the package.
PKG=/tmp/xz-pkg
tar xf xz-x.y.z.tar.gz
cd xz-x.y.z
./configure \
--prefix=/usr \
--disable-static \
--disable-xzdec \
--disable-lzmadec \
CFLAGS='-march=i686 -mtune=generic -O2'
make
make DESTDIR=$PKG install-strip
make clean
./configure \
--prefix=/usr \
--disable-shared \
--disable-nls \
--disable-encoders \
--enable-small \
--disable-threads \
CFLAGS='-march=i686 -mtune=generic -Os'
make -C src/liblzma
make -C src/xzdec
make -C src/xzdec DESTDIR=$PKG install-strip
cp -a extra $PKG/usr/share/doc/xz

407
README
View File

@@ -1,151 +1,304 @@
LZMA Utils
----------
XZ Utils
========
Warning
This is an early alpha version. Don't trust the files produced by
this version of the software - not even if the software can
uncompress the files properly! This is because the file format
isn't completely frozen yet.
So please test a lot, but don't use for anything serious yet.
0. Overview
1. Documentation
1.1. Overall documentation
1.2. Documentation for command line tools
1.3. Documentation for liblzma
2. Version numbering
3. Reporting bugs
4. Translating the xz tool
5. Other implementations of the .xz format
6. Contact information
Overview
0. Overview
-----------
LZMA is a general purporse compression algorithm designed by
Igor Pavlov as part of 7-Zip. It provides high compression ratio
while keeping the decompression speed fast.
XZ Utils provide a general-purpose data compression library and
command line tools. The native file format is the .xz format, but
also the legacy .lzma format is supported. The .xz format supports
multiple compression algorithms, which are called "filters" in
context of XZ Utils. The primary filter is currently LZMA2. With
typical files, XZ Utils create about 30 % smaller files than gzip.
LZMA Utils are an attempt to make LZMA compression easy to use
on free (as in freedom) operating systems. This is achieved by
providing tools and libraries which are similar to use than the
equivalents of the most popular existing compression algorithms.
To ease adapting support for the .xz format into existing applications
and scripts, the API of liblzma is somewhat similar to the API of the
popular zlib library. For the same reason, the command line tool xz
has similar command line syntax than that of gzip.
LZMA Utils consist of a few relatively separate parts:
* liblzma is an encoder/decoder library with support for several
filters (algorithm implementations). The primary filter is LZMA.
* libzfile enables reading from and writing to gzip, bzip2 and
LZMA compressed and uncompressed files with an API similar to
the standard ANSI-C file I/O.
[ NOTE: libzfile is not implemented yet. ]
* lzma command line tool has almost identical syntax than gzip
and bzip2. It makes LZMA easy for average users, but also
provides advanced options to finetune the compression settings.
* A few shell scripts make diffing and grepping LZMA compressed
files easy. The scripts were adapted from gzip and bzip2.
When aiming for the highest compression ratio, LZMA2 encoder uses
a lot of CPU time and may use, depending on the settings, even
hundreds of megabytes of RAM. However, in fast modes, LZMA2 encoder
competes with bzip2 in compression speed, RAM usage, and compression
ratio.
LZMA2 is reasonably fast to decompress. It is a little slower than
gzip, but a lot faster than bzip2. Being fast to decompress means
that the .xz format is especially nice when the same file will be
decompressed very many times (usually on different computers), which
is the case e.g. when distributing software packages. In such
situations, it's not too bad if the compression takes some time,
since that needs to be done only once to benefit many people.
With some file types, combining (or "chaining") LZMA2 with an
additional filter can improve compression ratio. A filter chain may
contain up to four filters, although usually only one two is used.
For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2
in the filter chain can improve compression ratio of executable files.
Since the .xz format allows adding new filter IDs, it is possible that
some day there will be a filter that is, for example, much faster to
compress than LZMA2 (but probably with worse compression ratio).
Similarly, it is possible that some day there is a filter that will
compress better than LZMA2.
XZ Utils doesn't support multithreaded compression or decompression
yet. It has been planned though and taken into account when designing
the .xz file format.
Supported platforms
1. Documentation
----------------
LZMA Utils are developed on GNU+Linux, but they should work at
least on *BSDs and Solaris. They probably work on some other
POSIX-like operating systems too.
1.1. Overall documentation
If you use GCC to compile LZMA Utils, you need at least version
3.x.x. GCC version 2.xx.x doesn't support some C99 features used
in LZMA Utils source code, thus GCC 2 won't compile LZMA Utils.
README This file
If you have written patches to make LZMA Utils to work on previously
unsupported platform, please send the patches to me! I will consider
including them to the official version. It's nice to minimize the
need of third-party patching.
INSTALL.generic Generic install instructions for those not familiar
with packages using GNU Autotools
INSTALL Installation instructions specific to XZ Utils
PACKAGERS Information to packagers of XZ Utils
One exception: Don't request or send patches to change the whole
source package to C89. I find C99 substantially nicer to write and
maintain. However, the public library headers must be in C89 to
avoid frustrating those who maintain programs, which are strictly
in C89 or C++.
COPYING XZ Utils copyright and license information
COPYING.GPLv2 GNU General Public License version 2
COPYING.GPLv3 GNU General Public License version 3
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
AUTHORS The main authors of XZ Utils
THANKS Incomplete list of people who have helped making
this software
NEWS User-visible changes between XZ Utils releases
ChangeLog Detailed list of changes (commit log)
TODO Known bugs and some sort of to-do list
Note that only some of the above files are included in binary
packages.
configure options
1.2. Documentation for command line tools
If you are not familiar with `configure' scripts, read the file
INSTALL first.
In most cases, the default --enable/--disable/--with/--without options
are what you want. Don't touch them if you are unsure.
--disable-encoder
Do not compile the encoder component of liblzma. This
implies --disable-match-finders. If you need only
the decoder, you can decrease the library size
dramatically with this option.
The default is to build the encoder.
--disable-decoder
Do not compile the decoder component of liblzma.
The default is to build the decoder.
--enable-filters=
liblzma supports several filters. See liblzma-intro.txt
for a little more information about these.
The default is to build all the filters.
--enable-match-finders=
liblzma includes two categories of match finders:
hash chains and binary trees. Hash chains (hc3 and hc4)
are quite fast but they don't provide the best compression
ratio. Binary trees (bt2, bt3 and bt4) give excellent
compression ratio, but they are slower and need more
memory than hash chains.
You need to enable at least one match finder to build the
LZMA filter encoder. Usually hash chains are used only in
the fast mode, while binary trees are used to when the best
compression ratio is wanted.
The default is to build all the match finders.
--enable-checks=
liblzma support multiple integrity checks. CRC32 is
mandatory, and cannot be omitted. See liblzma-intro.txt
for more information about usage of the integrity checks.
--disable-assembler
liblzma includes some assembler optimizations. Currently
there is only assembler code for CRC32 and CRC64 for
32-bit x86.
All the assembler code in liblzma is position-independent
code, which is suitable for use in shared libraries and
position-independent executables.
--enable-small
Omits precomputed tables. This makes liblzma a few KiB
smaller. Startup time increases, because the tables need
to be computed first.
--enable-debug
This enables the assert() macro and possibly some other
run-time consistency checks. It slows down things somewhat,
so you normally don't want to have this enabled.
--enable-werror
Makes all compiler warnings an error, that abort the
compilation. This may help catching bugs, and should work
on most systems. This has no effect on the resulting
binaries.
The command line tools are documented as man pages. In source code
releases (and possibly also in some binary packages), the man pages
are also provided in plain text (ASCII only) and PDF formats in the
directory "doc/man" to make the man pages more accessible to those
whose operating system doesn't provide an easy way to view man pages.
Static vs. dynamic linking of the command line tools
1.3. Documentation for liblzma
By default, the command line tools are linked statically against
liblzma. There a are a few reasons:
The liblzma API headers include short docs about each function
and data type as Doxygen tags. These docs should be quite OK as
a quick reference.
- The executable(s) can be in /bin while the shared liblzma can still
be in /usr/lib (if the distro uses such file system hierachy).
I have planned to write a bunch of very well documented example
programs, which (due to comments) should work as a tutorial to
various features of liblzma. No such example programs have been
written yet.
- It's easier to copy the executables to other systems, since they
depend only on libc.
For now, if you have never used liblzma, libbzip2, or zlib, I
recommend learning *basics* of zlib API. Once you know that, it
should be easier to learn liblzma.
- It's slightly faster on some architectures like x86.
http://zlib.net/manual.html
http://zlib.net/zlib_how.html
If you don't like this, you can get the command line tools linked
against the shared liblzma by specifying --disable-static to configure.
This disables building static liblzma completely.
2. Version numbering
--------------------
The version number format of XZ Utils is X.Y.ZS:
- X is the major version. When this is incremented, the library
API and ABI break.
- Y is the minor version. It is incremented when new features are
added without breaking existing API or ABI. Even Y indicates
stable release and odd Y indicates unstable (alpha or beta
version).
- Z is the revision. This has different meaning for stable and
unstable releases:
* Stable: Z is incremented when bugs get fixed without adding
any new features.
* Unstable: Z is just a counter. API or ABI of features added
in earlier unstable releases having the same X.Y may break.
- S indicates stability of the release. It is missing from the
stable releases where Y is an even number. When Y is odd, S
is either "alpha" or "beta" to make it very clear that such
versions are not stable releases. The same X.Y.Z combination is
not used for more than one stability level i.e. after X.Y.Zalpha,
the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta.
3. Reporting bugs
-----------------
Naturally it is easiest for me if you already know what causes the
unexpected behavior. Even better if you have a patch to propose.
However, quite often the reason for unexpected behavior is unknown,
so here are a few things to do before sending a bug report:
1. Try to create a small example how to reproduce the issue.
2. Compile XZ Utils with debugging code using configure switches
--enable-debug and, if possible, --disable-shared. If you are
using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting
binaries.
3. Turn on core dumps. The exact command depends on your shell;
for example in GNU bash it is done with "ulimit -c unlimited",
and in tcsh with "limit coredumpsize unlimited".
4. Try to reproduce the suspected bug. If you get "assertion failed"
message, be sure to include the complete message in your bug
report. If the application leaves a coredump, get a backtrace
using gdb:
$ gdb /path/to/app-binary # Load the app to the debugger.
(gdb) core core # Open the coredump.
(gdb) bt # Print the backtrace. Copy & paste to bug report.
(gdb) quit # Quit gdb.
Report your bug via email or IRC (see Contact information below).
Don't send core dump files or any executables. If you have a small
example file(s) (total size less than 256 KiB), please include
it/them as an attachment. If you have bigger test files, put them
online somewhere and include an URL to the file(s) in the bug report.
Always include the exact version number of XZ Utils in the bug report.
If you are using a snapshot from the git repository, use "git describe"
to get the exact snapshot version. If you are using XZ Utils shipped
in an operating system distribution, mention the distribution name,
distribution version, and exact xz package version; if you cannot
repeat the bug with the code compiled from unpatched source code,
you probably need to report a bug to your distribution's bug tracking
system.
4. Translating the xz tool
--------------------------
The messages from the xz tool have been translated into a few
languages. Before starting to translate into a new language, ask
the author that someone else hasn't already started working on it.
Test your translation. Testing includes comparing the translated
output to the original English version by running the same commands
in both your target locale and with LC_ALL=C. Ask someone to
proof-read and test the translation.
Testing can be done e.g. by installing xz into a temporary directory:
./configure --disable-shared --prefix=/tmp/xz-test
# <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
Repeat the above as needed (no need to re-run configure though).
Note especially the following:
- The output of --help and --long-help must look nice on
a 80-column terminal. It's OK to add extra lines if needed.
- In contrast, don't add extra lines to error messages and such.
They are often preceded with e.g. a filename on the same line,
so you have no way to predict where to put a \n. Let the terminal
do the wrapping even if it looks ugly. Adding new lines will be
even uglier in the generic case even if it looks nice in a few
limited examples.
- Be careful with column alignment in tables and table-like output
(--list, --list --verbose --verbose, --info-memory, --help, and
--long-help):
* All descriptions of options in --help should start in the
same column (but it doesn't need to be the same column as
in the English messages; just be consistent if you change it).
Check that both --help and --long-help look OK, since they
share several strings.
* --list --verbose and --info-memory print lines that have
the format "Description: %s". If you need a longer
description, you can put extra space between the colon
and %s. Then you may need to add extra space to other
strings too so that the result as a whole looks good (all
values start at the same column).
* The columns of the actual tables in --list --verbose --verbose
should be aligned properly. Abbreviate if necessary. It might
be good to keep at least 2 or 3 spaces between column headings
and avoid spaces in the headings so that the columns stand out
better, but this is a matter of opinion. Do what you think
looks best.
- Be careful to put a period at the end of a sentence when the
original version has it, and don't put it when the original
doesn't have it. Similarly, be careful with \n characters
at the beginning and end of the strings.
- Read the TRANSLATORS comments that have been extracted from the
source code and included in xz.pot. If they suggest testing the
translation with some type of command, do it. If testing needs
input files, use e.g. tests/files/good-*.xz.
- When updating the translation, read the fuzzy (modified) strings
carefully, and don't mark them as updated before you actually
have updated them. Reading through the unchanged messages can be
good too; sometimes you may find a better wording for them.
- If you find language problems in the original English strings,
feel free to suggest improvements. Ask if something is unclear.
- The translated messages should be understandable (sometimes this
may be a problem with the original English messages too). Don't
make a direct word-by-word translation from English especially if
the result doesn't sound good in your language.
In short, take your time and pay attention to the details. Making
a good translation is not a quick and trivial thing to do. The
translated xz should look as polished as the English version.
5. Other implementations of the .xz format
------------------------------------------
7-Zip and the p7zip port of 7-Zip support the .xz format starting
from the version 9.00alpha.
http://7-zip.org/
http://p7zip.sourceforge.net/
XZ Embedded is a limited implementation written for use in the Linux
kernel, but it is also suitable for other embedded use.
http://tukaani.org/xz/embedded.html
6. Contact information
----------------------
If you have questions, bug reports, patches etc. related to XZ Utils,
contact Lasse Collin <lasse.collin@tukaani.org> (in Finnish or English).
I'm sometimes slow at replying. If you haven't got a reply within two
weeks, assume that your email has got lost and resend it or use IRC.
You can find me also from #tukaani on Freenode; my nick is Larhzu.
The channel tends to be pretty quiet, so just ask your question and
someone may wake up.

71
THANKS
View File

@@ -1,23 +1,78 @@
Thanks
------
======
Some people have helped more, some less, some don't even know they have
been helpful, but nevertheless everyone's help has been important. :-)
In alphabetical order:
Some people have helped more, some less, but nevertheless everyone's help
has been important. :-) In alphabetical order:
- Mark Adler
- H. Peter Anvin
- Nelson H. F. Beebe
- Karl Berry
- Anders F. Björklund
- Emmanuel Blot
- Martin Blumenstingl
- Jakub Bogusz
- Trent W. Buck
- David Burklund
- Daniel Mealha Cabrita
- Milo Casagrande
- Marek Černocký
- Andrew Dudman
- Markus Duft
- İsmail Dönmez
- Jean-loup Gailly
- Robert Elz
- Gilles Espinasse
- Denis Excoffier
- Mike Frysinger
- Juan Manuel Guerrero
- Joachim Henke
- Peter Ivanov
- Jouk Jansen
- Per Øyvind Karlsen
- Thomas Klausner
- Richard Koch
- Ville Koskinen
- Stephan Kulow
- Peter Lawler
- Hin-Tak Leung
- Andraž 'ruskie' Levstik
- Lorenzo De Liso
- Gregory Margo
- Jim Meyering
- Rafał Mużyło
- Adrien Nader
- Hongbo Ni
- Jonathan Nieder
- Andre Noll
- Peter O'Gorman
- Igor Pavlov
- Elbert Pol
- Mikko Pouru
- Robert Readman
- Bernhard Reutner-Fischer
- Cristian Rodríguez
- Christian von Roques
- Jukka Salmi
- Alexandre Sauvé
- Julian Seward
- Andreas Schwab
- Dan Shechter
- Stuart Shelton
- Jonathan Stott
- Paul Townsend
- Mohammed Adnène Trojette
- Alexey Tourbin
- Patrick J. Volkerding
- Christian Weisgerber
- Bert Wesarg
- Ralf Wildenhues
- Charles Wilson
- Lars Wirzenius
- Pilorz Wojciech
- Ryan Young
- Andreas Zieringer
Also thanks to all the people who have participated the Tukaani project
and others who I have forgot.
Also thanks to all the people who have participated in the Tukaani project.
I have probably forgot to add some names to the above list. Sorry about
that and thanks for your help.

130
TODO
View File

@@ -1,109 +1,67 @@
LZMA Utils TODO List
--------------------
XZ Utils To-Do List
===================
Major missing features
Known bugs
----------
Memory limits in the command line tool apply only to compression.
The test suite is too incomplete.
Threading support in the lzma command line tool is still primitive.
It cannot split a file in pieces yet.
If the memory usage limit is less than about 13 MiB, xz is unable to
automatically scale down the compression settings enough even though
it would be possible by switching from BT2/BT3/BT4 match finder to
HC3/HC4.
The --list mode isn't implemented in the command line tool.
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.
Handling of Multi-Block Stream information should be separated
from Stream encoder and decoder. Those would be useful to implement
multi-threaded coding in applications.
XZ Utils compress some files significantly worse than LZMA Utils.
This is due to faster compression presets used by XZ Utils, and
can often be worked around by using "xz --extreme". With some files
--extreme isn't enough though: it's most likely with files that
compress extremely well, so going from compression ratio of 0.003
to 0.004 means big relative increase in the compressed file size.
Buffer to buffer coding is not implemented in liblzma. Probably
a naive version should be written first, which would simply wrap
things around lzma_stream. Later, there should be separate buffer
coding functions, that are slightly faster (less memcpy()) and
have smaller memory usage than the functions using lzma_stream.
xz doesn't quote unprintable characters when it displays file names
given on the command line.
libzfile is not implemented.
tuklib_exit() doesn't block signals => EINTR is possible.
LZMA filter doesn't support predefined history buffer.
SIGTSTP is not handled. If xz is stopped, the estimated remaining
time and calculated (de)compression speed won't make sense in the
progress indicator (xz --verbose).
Security
Missing features
----------------
Search for bugs, especially security related issues. Security is
important in every piece of code in LZMA Utils, but it is extremely
important in the decoder part of liblzma.
xz doesn't support copying extended attributes, access control
lists etc. from source to target file.
Subblock: If there is LZMA as a Subfilter but without EOPM, can it
trigger infinite loop when Subblock's "Unset Subfilter" flag is hit?
Multithreaded compression
Similarly, can LZ decoder get stuck in infinite loop if the next
filter in the chain returns LZMA_STREAM_END but the decoded data
doesn't allow finishing the LZ decoding?
Multithreaded decompression
Buffer-to-buffer coding could use less RAM (especially when
decompressing LZMA1 or LZMA2).
Reliability
I/O library is not implemented (similar to gzopen() in zlib).
It will be a separate library that supports uncompressed, .gz,
.bz2, .lzma, and .xz files.
Create a test suite to be run with "make check".
Should we use strlimit() and getrlimit() for memory usage limitting?
Performance
Benchmark the CRC code on non-x86 CPUs. Won't have huge effect on
overall speed, but it would still be nice to know what algorithm
variant is the best on different CPUs.
Third party support
Add support for LZMA to various applications. This naturally requires
cooperating with the authors of the specific applications.
* GNU grep and GNU diffutils: BSD grep already uses zlib directly
instead of ugly shell scripts. It would be nice to get similar
feature into relevant GNU tools. With libzfile, multiple
compression formats would be easy to support.
* kioslave for KDE
* Magic for the `file' command
* GNU Midnight Commander
* GNU Texinfo
* The `man' command
* Package managers
Test the patches already written. The patches should be sent to
upstream developers _once_ LZMA Utils APIs are stable enough (so
people don't need to fix those patches all the time).
Mandriva has quite a few patches. Some of them are OK, some need
adapting for new LZMA Utils.
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.
Documentation
-------------
Revise the man page of lzma command line tool.
Some tutorial is needed for liblzma. I have planned to write some
extremely well commented example programs, which would work as
a tutorial. I suppose the Doxygen tags are quite OK as a quick
reference once one is familiar with the liblzma API.
If the Doxygen docs aren't enough, write good Texinfo manual for
liblzma. It's been a long time I've even tried to build the Doxygen
docs, so they may look quite bad at the moment.
Document LZMA as an algorithm. It would be great to have detailed
description of the algorithm in English. Many people think, that
reading the source code is not the optimal way to learn how LZMA
works.
Other
Some things return LZMA_PROG_ERROR with invalid options, some
LZMA_HEADER_ERROR. These must be checked carefully and made so
that LZMA_HEADER_ERROR is used only when the given option could
make sense in future version of libzma.
lzma_restrict vs. restrict
Usage of LZMA_RUN vs. LZMA_FINISH with Metadata coders.
Port the Deflate implementation from 7-Zip into liblzma. 7-Zip's
Deflate compresses better than zlib, gzip or Info-ZIP. I don't
know if Deflate will be included in .lzma format (probably not),
but it's still useful once we also add support for .gz file format.
Document the LZMA1 and LZMA2 algorithms.

View File

@@ -1,38 +1,22 @@
#!/bin/sh
###############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
# The result of using "autoreconf -fi" should be identical to using this
# script. I'm leaving this script here just in case someone finds it useful.
set -e -x
# autooint copies all kinds of crap even though we have told in
# configure.ac that we don't want the intl directory. It is able
# to omit the intl directory but still copies the m4 files needed
# only by the stuff in the non-existing intl directory.
autopoint -f
rm -f \
codeset.m4 \
glibc2.m4 \
glibc21.m4 \
intdiv0.m4 \
intl.m4 \
intldir.m4 \
intmax.m4 \
inttypes-pri.m4 \
inttypes_h.m4 \
lcmessage.m4 \
lock.m4 \
longdouble.m4 \
longlong.m4 \
printf-posix.m4 \
size_max.m4 \
stdint_h.m4 \
uintmax_t.m4 \
ulonglong.m4 \
visibility.m4 \
wchar_t.m4 \
wint_t.m4 \
xsize.m4
libtoolize -c -f || glibtoolize -c -f
aclocal -I m4
autoconf
autoheader
automake -acf --foreign
${AUTOPOINT:-autopoint} -f
${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f
${ACLOCAL:-aclocal} -I m4
${AUTOCONF:-autoconf}
${AUTOHEADER:-autoheader}
${AUTOMAKE:-automake} -acf --foreign

58
build-aux/manconv.sh Normal file
View File

@@ -0,0 +1,58 @@
#!/bin/sh
#
###############################################################################
#
# Wrapper for GNU groff to convert man pages to a few formats
#
# Usage: manconv.sh FORMAT [PAPER_SIZE] < in.1 > out.suffix
#
# FORMAT can be ascii, utf8, ps, or pdf. PAPER_SIZE can be anything that
# groff accepts, e.g. a4 or letter. See groff_font(5). PAPER_SIZE defaults
# to a4 and is used only when FORMAT is ps (PostScript) or pdf.
#
# Multiple man pages can be given at once e.g. to create a single PDF file
# with continuous page numbering.
#
###############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
FORMAT=$1
PAPER=${2-a4}
# Make PostScript and PDF output more readable:
# - Use 11 pt font instead of the default 10 pt.
# - Use larger paragraph spacing than the default 0.4v (man(7) only).
FONT=11
PD=0.8
SED_PD="
/^\\.TH /s/\$/\\
.PD $PD/
s/^\\.PD\$/.PD $PD/"
case $FORMAT in
ascii)
groff -t -mandoc -Tascii | col -bx
;;
utf8)
groff -t -mandoc -Tutf8 | col -bx
;;
ps)
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
-rC1 -rS$FONT -Tps -P-p$PAPER
;;
pdf)
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
-rC1 -rS$FONT -Tps -P-p$PAPER | ps2pdf - -
;;
*)
echo 'Invalid arguments' >&2
exit 1
;;
esac

24
build-aux/version.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
#
#############################################################################
#
# Get the version string from version.h and print it out without
# trailing newline. This makes it suitable for use in configure.ac.
#
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
s/LZMA_VERSION_STABILITY_BETA/beta/
s/LZMA_VERSION_STABILITY_STABLE//
s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
src/liblzma/api/lzma/version.h \
| tr '\n' '|' \
| sed 's/|/./; s/|/./; s/|//g' \
| tr -d '\n'

View File

@@ -3,17 +3,10 @@
###############################################################################
#
# Copyright (C) 2007 Lasse Collin
# Author: Lasse Collin
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
@@ -22,209 +15,202 @@
# of malloc(), stat(), or lstat(), since we don't use those functions in
# a way that would cause the problems the autoconf macros check.
AC_PREREQ(2.61)
# [LZMA] instead of [LZMA utils] since I prefer to have lzma-version.tar.gz
# instead of lzma-utils-version.tar.gz.
AC_INIT([LZMA], [4.42.2alpha], [lasse.collin@tukaani.org])
AC_PREREQ([2.64])
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
[lasse.collin@tukaani.org], [xz], [http://tukaani.org/xz/])
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
echo
echo "LZMA Utils $PACKAGE_VERSION"
echo "$PACKAGE_STRING"
echo
echo "System type:"
# This is needed to know if assembler optimizations can be used.
AC_CANONICAL_HOST
# We do some special things on Windows (32-bit or 64-bit) builds.
case $host_os in
mingw* | cygwin*) is_w32=yes ;;
*) is_w32=no ;;
esac
AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes])
# We need to use $EXEEXT with $(LN_S) when creating symlinks to
# executables. Cygwin is an exception to this, since it is recommended
# that symlinks don't have the .exe suffix. To make this work, we
# define LN_EXEEXT.
case $host_os in
cygwin) LN_EXEEXT= ;;
*) LN_EXEEXT='$(EXEEXT)' ;;
esac
AC_SUBST([LN_EXEEXT])
echo
echo "Configure options:"
AM_CFLAGS=
#############
# Debugging #
#############
# Enable/disable debugging code:
AC_MSG_CHECKING([if debugging code should be compiled])
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging code.]),
AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable debugging code.]),
[], enable_debug=no)
if test "x$enable_debug" = xyes; then
CFLAGS="-g $CFLAGS"
AC_MSG_RESULT([yes])
else
AC_DEFINE(NDEBUG, 1, [Define to disable debugging code.])
AC_DEFINE([NDEBUG], [1], [Define to 1 to disable debugging code.])
AC_MSG_RESULT([no])
fi
# Enable/disable the encoder components:
AC_MSG_CHECKING([if encoder components should be built])
AC_ARG_ENABLE(encoder, AC_HELP_STRING([--disable-encoder],
[Do not build the encoder components.]),
[], enable_encoder=yes)
if test "x$enable_encoder" = xyes; then
AC_DEFINE([HAVE_ENCODER], 1,
[Define to 1 if encoder components are enabled.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(COND_MAIN_ENCODER, test "x$enable_encoder" = xyes)
# Enable/disable the decoder components:
AC_MSG_CHECKING([if decoder components should be built])
AC_ARG_ENABLE(decoder, AC_HELP_STRING([--disable-decoder],
[Do not build the decoder components.]),
[], enable_decoder=yes)
if test "x$enable_decoder" = xyes; then
AC_DEFINE([HAVE_DECODER], 1,
[Define to 1 if decoder components are enabled.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
if test "x$enable_encoder" = xno; then
AC_MSG_ERROR([Do not disable both encoder and decoder.])
fi
fi
AM_CONDITIONAL(COND_MAIN_DECODER, test "x$enable_decoder" = xyes)
###########
# Filters #
###########
# Filters
AC_MSG_CHECKING([which filters to build])
AC_ARG_ENABLE(filters, AC_HELP_STRING([--enable-filters=],
[Comma-separated list of filters to build. Default=all.
Filters used in encoding are needed also in decoding.
Available filters: copy subblock x86 powerpc ia64
arm armthumb sparc delta lzma]),
[], [enable_filters=copy,subblock,x86,powerpc,ia64,arm,armthumb,sparc,delta,lzma])
enable_filters=`echo "$enable_filters" | sed 's/,/ /g'`
enable_filters_copy=no
enable_filters_subblock=no
enable_filters_x86=no
enable_filters_powerpc=no
enable_filters_ia64=no
enable_filters_arm=no
enable_filters_armthumb=no
enable_filters_sparc=no
enable_filters_delta=no
enable_filters_lzma=no
enable_simple_filters=no
if test "x$enable_filters" = xno || test "x$enable_filters" = x; then
AC_MSG_RESULT([])
AC_MSG_ERROR([Please enable at least one filter.])
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,sparc])dnl
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,sparc])
m4_define([LZ_FILTERS], [lzma1,lzma2])
m4_foreach([NAME], [SUPPORTED_FILTERS],
[enable_filter_[]NAME=no
enable_encoder_[]NAME=no
enable_decoder_[]NAME=no
])dnl
AC_MSG_CHECKING([which encoders to build])
AC_ARG_ENABLE([encoders], AC_HELP_STRING([--enable-encoders=LIST],
[Comma-separated list of encoders to build. Default=all.
Available encoders:]
m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])),
[], [enable_encoders=SUPPORTED_FILTERS])
enable_encoders=`echo "$enable_encoders" | sed 's/,/ /g'`
if test "x$enable_encoders" = xno || test "x$enable_encoders" = x; then
AC_MSG_RESULT([(none)])
else
for arg in $enable_filters
for arg in $enable_encoders
do
case $arg in
copy)
enable_filters_copy=yes
AC_DEFINE([HAVE_FILTER_COPY], 1,
[Define to 1 if support for the
Copy filter is enabled.])
;;
subblock)
enable_filters_subblock=yes
AC_DEFINE([HAVE_FILTER_SUBBLOCK], 1,
[Define to 1 if support for the
Subblock filter is enabled.])
;;
x86)
enable_filters_x86=yes
enable_simple_filters=yes
AC_DEFINE([HAVE_FILTER_X86], 1,
[Define to 1 if support for the
x86 (BCJ) filter is enabled.])
;;
powerpc)
enable_filters_powerpc=yes
enable_simple_filters=yes
AC_DEFINE([HAVE_FILTER_POWERPC], 1,
[Define to 1 if support for the
PowerPC filter is enabled.])
;;
ia64)
enable_filters_ia64=yes
enable_simple_filters=yes
AC_DEFINE([HAVE_FILTER_IA64], 1,
[Define to 1 if support for the
IA64 filter is enabled.])
;;
arm)
enable_filters_arm=yes
enable_simple_filters=yes
AC_DEFINE([HAVE_FILTER_ARM], 1,
[Define to 1 if support for the
ARM filter is enabled.])
;;
armthumb)
enable_filters_armthumb=yes
enable_simple_filters=yes
AC_DEFINE([HAVE_FILTER_ARMTHUMB], 1,
[Define to 1 if support for the
ARMThumb filter is enabled.])
;;
sparc)
enable_filters_sparc=yes
enable_simple_filters=yes
AC_DEFINE([HAVE_FILTER_SPARC], 1,
[Define to 1 if support for the
SPARC filter is enabled.])
;;
delta)
enable_filters_delta=yes
AC_DEFINE([HAVE_FILTER_DELTA], 1,
[Define to 1 if support for the
Delta filter is enabled.])
;;
lzma)
enable_filters_lzma=yes
AC_DEFINE([HAVE_FILTER_LZMA], 1,
[Define to 1 if support for the
LZMA filter is enabled.])
;;
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
NAME)
enable_filter_[]NAME=yes
enable_encoder_[]NAME=yes
AC_DEFINE(HAVE_ENCODER_[]m4_toupper(NAME), [1],
[Define to 1 if] NAME [encoder is enabled.])
;;])
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([unknown filter: $arg])
;;
esac
done
AC_MSG_RESULT([$enable_filters])
AC_MSG_RESULT([$enable_encoders])
fi
if test "x$enable_simple_filters" = xyes ; then
AC_DEFINE([HAVE_FILTER_SIMPLE], 1, [Define to 1 if support for any
of the so called simple filters is enabled.])
fi
AM_CONDITIONAL(COND_FILTER_COPY, test "x$enable_filters_copy" = xyes)
AM_CONDITIONAL(COND_FILTER_SUBBLOCK, test "x$enable_filters_subblock" = xyes)
AM_CONDITIONAL(COND_FILTER_X86, test "x$enable_filters_x86" = xyes)
AM_CONDITIONAL(COND_FILTER_POWERPC, test "x$enable_filters_powerpc" = xyes)
AM_CONDITIONAL(COND_FILTER_IA64, test "x$enable_filters_ia64" = xyes)
AM_CONDITIONAL(COND_FILTER_ARM, test "x$enable_filters_arm" = xyes)
AM_CONDITIONAL(COND_FILTER_ARMTHUMB, test "x$enable_filters_armthumb" = xyes)
AM_CONDITIONAL(COND_FILTER_SPARC, test "x$enable_filters_sparc" = xyes)
AM_CONDITIONAL(COND_FILTER_DELTA, test "x$enable_filters_delta" = xyes)
AM_CONDITIONAL(COND_FILTER_LZMA, test "x$enable_filters_lzma" = xyes)
AM_CONDITIONAL(COND_MAIN_SIMPLE, test "x$enable_simple_filters" = xyes)
# Which match finders should be enabled:
AC_MSG_CHECKING([which decoders to build])
AC_ARG_ENABLE([decoders], AC_HELP_STRING([--enable-decoders=LIST],
[Comma-separated list of decoders to build. Default=all.
Available decoders are the same as available encoders.]),
[], [enable_decoders=SUPPORTED_FILTERS])
enable_decoders=`echo "$enable_decoders" | sed 's/,/ /g'`
if test "x$enable_decoders" = xno || test "x$enable_decoders" = x; then
AC_MSG_RESULT([(none)])
else
for arg in $enable_decoders
do
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
NAME)
enable_filter_[]NAME=yes
enable_decoder_[]NAME=yes
AC_DEFINE(HAVE_DECODER_[]m4_toupper(NAME), [1],
[Define to 1 if] NAME [decoder is enabled.])
;;])
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([unknown filter: $arg])
;;
esac
done
# LZMA2 requires that LZMA1 is enabled.
test "x$enable_encoder_lzma2" = xyes && enable_encoder_lzma1=yes
test "x$enable_decoder_lzma2" = xyes && enable_decoder_lzma1=yes
AC_MSG_RESULT([$enable_decoders])
fi
if test "x$enable_encoder_lzma2$enable_encoder_lzma1" = xyesno \
|| test "x$enable_decoder_lzma2$enable_decoder_lzma1" = xyesno; then
AC_MSG_ERROR([LZMA2 requires that LZMA1 is also enabled.])
fi
AM_CONDITIONAL(COND_MAIN_ENCODER, test "x$enable_encoders" != xno && test "x$enable_encoders" != x)
AM_CONDITIONAL(COND_MAIN_DECODER, test "x$enable_decoders" != xno && test "x$enable_decoders" != x)
m4_foreach([NAME], [SUPPORTED_FILTERS],
[AM_CONDITIONAL(COND_FILTER_[]m4_toupper(NAME), test "x$enable_filter_[]NAME" = xyes)
AM_CONDITIONAL(COND_ENCODER_[]m4_toupper(NAME), test "x$enable_encoder_[]NAME" = xyes)
AM_CONDITIONAL(COND_DECODER_[]m4_toupper(NAME), test "x$enable_decoder_[]NAME" = xyes)
])dnl
# The so called "simple filters" share common code.
enable_filter_simple=no
enable_encoder_simple=no
enable_decoder_simple=no
m4_foreach([NAME], [SIMPLE_FILTERS],
[test "x$enable_filter_[]NAME" = xyes && enable_filter_simple=yes
test "x$enable_encoder_[]NAME" = xyes && enable_encoder_simple=yes
test "x$enable_decoder_[]NAME" = xyes && enable_decoder_simple=yes
])dnl
AM_CONDITIONAL(COND_FILTER_SIMPLE, test "x$enable_filter_simple" = xyes)
AM_CONDITIONAL(COND_ENCODER_SIMPLE, test "x$enable_encoder_simple" = xyes)
AM_CONDITIONAL(COND_DECODER_SIMPLE, test "x$enable_decoder_simple" = xyes)
# LZ-based filters share common code.
enable_filter_lz=no
enable_encoder_lz=no
enable_decoder_lz=no
m4_foreach([NAME], [LZ_FILTERS],
[test "x$enable_filter_[]NAME" = xyes && enable_filter_lz=yes
test "x$enable_encoder_[]NAME" = xyes && enable_encoder_lz=yes
test "x$enable_decoder_[]NAME" = xyes && enable_decoder_lz=yes
])dnl
AM_CONDITIONAL(COND_FILTER_LZ, test "x$enable_filter_lz" = xyes)
AM_CONDITIONAL(COND_ENCODER_LZ, test "x$enable_encoder_lz" = xyes)
AM_CONDITIONAL(COND_DECODER_LZ, test "x$enable_decoder_lz" = xyes)
#################
# Match finders #
#################
m4_define([SUPPORTED_MATCH_FINDERS], [hc3,hc4,bt2,bt3,bt4])
m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS],
[enable_match_finder_[]NAME=no
])
AC_MSG_CHECKING([which match finders to build])
AC_ARG_ENABLE(match-finders, AC_HELP_STRING([--enable-match-finders=],
AC_ARG_ENABLE([match-finders], AC_HELP_STRING([--enable-match-finders=LIST],
[Comma-separated list of match finders to build. Default=all.
At least one match finder is required for encoding with
the LZMA filter.
Available match finders: hc3 hc4 bt2 bt3 bt4]), [],
[enable_match_finders=hc3,hc4,bt2,bt3,bt4])
the LZMA1 and LZMA2 filters. Available match finders:]
m4_translit(m4_defn([SUPPORTED_MATCH_FINDERS]), [,], [ ])), [],
[enable_match_finders=SUPPORTED_MATCH_FINDERS])
enable_match_finders=`echo "$enable_match_finders" | sed 's/,/ /g'`
enable_match_finders_hc3=no
enable_match_finders_hc4=no
enable_match_finders_bt2=no
enable_match_finders_bt3=no
enable_match_finders_bt4=no
if test "x$enable_encoder" = xyes && test "x$enable_filters_lzma" = xyes ; then
if test "x$enable_encoder_lz" = xyes ; then
for arg in $enable_match_finders
do
case $arg in
hc3) enable_match_finders_hc3=yes ;;
hc4) enable_match_finders_hc4=yes ;;
bt2) enable_match_finders_bt2=yes ;;
bt3) enable_match_finders_bt3=yes ;;
bt4) enable_match_finders_bt4=yes ;;
case $arg in m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS], [
NAME)
enable_match_finder_[]NAME=yes
AC_DEFINE(HAVE_MF_[]m4_toupper(NAME), [1],
[Define to 1 to enable] NAME [match finder.])
;;])
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([unknown match finder: $arg])
@@ -233,48 +219,39 @@ if test "x$enable_encoder" = xyes && test "x$enable_filters_lzma" = xyes ; then
done
AC_MSG_RESULT([$enable_match_finders])
else
AC_MSG_RESULT([(none because not building the LZMA encoder)])
AC_MSG_RESULT([(none because not building any LZ-based encoder)])
fi
AM_CONDITIONAL(COND_MF_HC3, test "x$enable_match_finders_hc3" = xyes)
AM_CONDITIONAL(COND_MF_HC4, test "x$enable_match_finders_hc4" = xyes)
AM_CONDITIONAL(COND_MF_BT2, test "x$enable_match_finders_bt2" = xyes)
AM_CONDITIONAL(COND_MF_BT3, test "x$enable_match_finders_bt3" = xyes)
AM_CONDITIONAL(COND_MF_BT4, test "x$enable_match_finders_bt4" = xyes)
# Which integrity checks to build
####################
# Integrity checks #
####################
m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
m4_foreach([NAME], [SUPPORTED_FILTERS],
[enable_check_[]NAME=no
])dnl
AC_MSG_CHECKING([which integrity checks to build])
AC_ARG_ENABLE(checks, AC_HELP_STRING([--enable-checks=],
AC_ARG_ENABLE([checks], AC_HELP_STRING([--enable-checks=LIST],
[Comma-separated list of integrity checks to build.
Default=all. Available integrity checks: crc32 crc64 sha256]),
[], [enable_checks=crc32,crc64,sha256])
Default=all. Available integrity checks:]
m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])),
[], [enable_checks=SUPPORTED_CHECKS])
enable_checks=`echo "$enable_checks" | sed 's/,/ /g'`
enable_checks_crc32=no
enable_checks_crc64=no
enable_checks_sha256=no
if test "x$enable_checks" = xno || test "x$enable_checks" = x; then
AC_MSG_RESULT([(none)])
else
for arg in $enable_checks
do
case $arg in
crc32)
enable_checks_crc32=yes
AC_DEFINE([HAVE_CHECK_CRC32], 1,
[Define to 1 if CRC32 support
is enabled.])
;;
crc64)
enable_checks_crc64=yes
AC_DEFINE([HAVE_CHECK_CRC64], 1,
[Define to 1 if CRC64 support
is enabled.])
;;
sha256)
enable_checks_sha256=yes
AC_DEFINE([HAVE_CHECK_SHA256], 1,
[Define to 1 if SHA256 support
is enabled.])
;;
case $arg in m4_foreach([NAME], [SUPPORTED_CHECKS], [
NAME)
enable_check_[]NAME=yes
AC_DEFINE(HAVE_CHECK_[]m4_toupper(NAME), [1],
[Define to 1 if] NAME
[integrity check is enabled.])
;;])
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([unknown integrity check: $arg])
@@ -286,41 +263,58 @@ fi
if test "x$enable_checks_crc32" = xno ; then
AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
fi
AM_CONDITIONAL(COND_CHECK_CRC32, test "x$enable_checks_crc32" = xyes)
AM_CONDITIONAL(COND_CHECK_CRC64, test "x$enable_checks_crc64" = xyes)
AM_CONDITIONAL(COND_CHECK_SHA256, test "x$enable_checks_sha256" = xyes)
# Assembler optimizations
m4_foreach([NAME], [SUPPORTED_CHECKS],
[AM_CONDITIONAL(COND_CHECK_[]m4_toupper(NAME), test "x$enable_check_[]NAME" = xyes)
])dnl
###########################
# Assembler optimizations #
###########################
AC_MSG_CHECKING([if assembler optimizations should be used])
AC_ARG_ENABLE(assembler, AC_HELP_STRING([--disable-assembler],
AC_ARG_ENABLE([assembler], AC_HELP_STRING([--disable-assembler],
[Do not use assembler optimizations even if such exist
for the architecture.]),
[], [enable_assembler=yes])
[], [enable_assembler=yes])
if test "x$enable_assembler" = xyes; then
case $host_cpu in
i?86) enable_assembler=x86 ;;
*) enable_assembler=no ;;
enable_assembler=no
case $host_os in
# Darwin should work too but only if not creating universal
# binaries. Solaris x86 could work too but I cannot test.
linux* | *bsd* | mingw* | cygwin* | *djgpp*)
case $host_cpu in
i?86) enable_assembler=x86 ;;
x86_64) enable_assembler=x86_64 ;;
esac
;;
esac
fi
case $enable_assembler in
x86|no) ;;
x86 | x86_64 | no)
AC_MSG_RESULT([$enable_assembler])
;;
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', or \`x86'.])
AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', \`x86', or \`x86_64'.])
;;
esac
AC_MSG_RESULT([$enable_assembler])
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)
#####################
# Size optimization #
#####################
# Size optimization
AC_MSG_CHECKING([if small size is preferred over speed])
AC_ARG_ENABLE(small, AC_HELP_STRING([--enable-small],
[Omit precomputed tables to make liblzma a few kilobytes
smaller. This will increase startup time of applications
slightly, because the tables need to be computed first.]),
[], [enable_small=no])
AC_ARG_ENABLE([small], AC_HELP_STRING([--enable-small],
[Make liblzma smaller and a little slower.
This is disabled by default to optimize for speed.]),
[], [enable_small=no])
if test "x$enable_small" = xyes; then
AC_DEFINE([HAVE_SMALL], 1, [Define to 1 if optimizing for size.])
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
elif test "x$enable_small" != xno; then
AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-small accepts only \`yes' or \`no'])
@@ -328,33 +322,132 @@ fi
AC_MSG_RESULT([$enable_small])
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
echo
echo "Initializing Automake:"
# There's no C++ or Fortran in LZMA Utils:
CXX=no
F77=no
#############
# Threading #
#############
AM_INIT_AUTOMAKE
AC_MSG_CHECKING([if threading support is wanted])
AC_ARG_ENABLE([threads], AC_HELP_STRING([--disable-threads],
[Disable threading support.
This makes some things thread-unsafe.]),
[], [enable_threads=yes])
if test "x$enable_threads" != xyes && test "x$enable_threads" != xno; then
AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-threads accepts only \`yes' or \`no'])
fi
AC_MSG_RESULT([$enable_threads])
# We use the actual result a little later.
#########################
# Assumed amount of RAM #
#########################
# We use 128 MiB as default, because it will allow decompressing files
# created with "xz -9". It would be slightly safer to guess a lower value,
# but most systems, on which we don't have any way to determine the amount
# of RAM, will probably have at least 128 MiB of RAM.
AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown])
AC_ARG_ENABLE([assume-ram], AC_HELP_STRING([--enable-assume-ram=SIZE],
[If and only if the real amount of RAM cannot be determined,
assume SIZE MiB. The default is 128 MiB. This affects the
default memory usage limit.]),
[], [enable_assume_ram=128])
assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789`
if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then
AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-assume-ram accepts only an integer argument])
fi
AC_MSG_RESULT([$enable_assume_ram MiB])
AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram],
[How many MiB of RAM to assume if the real amount cannot
be determined.])
#########################
# Components to install #
#########################
AC_ARG_ENABLE([xz], [AC_HELP_STRING([--disable-xz],
[do not build the xz tool])],
[], [enable_xz=yes])
AM_CONDITIONAL([COND_XZ], [test x$enable_xz != xno])
AC_ARG_ENABLE([xzdec], [AC_HELP_STRING([--disable-xzdec],
[do not build xzdec])],
[], [enable_xzdec=yes])
AM_CONDITIONAL([COND_XZDEC], [test x$enable_xzdec != xno])
AC_ARG_ENABLE([lzmadec], [AC_HELP_STRING([--disable-lzmadec],
[do not build lzmadec
(it exists primarily for LZMA Utils compatibility)])],
[], [enable_lzmadec=yes])
AM_CONDITIONAL([COND_LZMADEC], [test x$enable_lzmadec != xno])
AC_ARG_ENABLE([lzmainfo], [AC_HELP_STRING([--disable-lzmainfo],
[do not build lzmainfo
(it exists primarily for LZMA Utils compatibility)])],
[], [enable_lzmainfo=yes])
AM_CONDITIONAL([COND_LZMAINFO], [test x$enable_lzmainfo != xno])
AC_ARG_ENABLE([lzma-links], [AC_HELP_STRING([--disable-lzma-links],
[do not create symlinks for LZMA Utils compatibility])],
[], [enable_lzma_links=yes])
AM_CONDITIONAL([COND_LZMALINKS], [test x$enable_lzma_links != xno])
AC_ARG_ENABLE([scripts], [AC_HELP_STRING([--disable-scripts],
[do not install the scripts xzdiff, xzgrep, xzless, xzmore,
and their symlinks])],
[], [enable_scripts=yes])
AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
AC_USE_SYSTEM_EXTENSIONS
###############################################################################
# Checks for programs.
###############################################################################
AM_PROG_CC_C_O
AM_PROG_AS
AC_PROG_LN_S
echo
gl_POSIX_SHELL
if test -z "$POSIX_SHELL" ; then
AC_MSG_ERROR([No POSIX conforming shell (sh) was found.])
fi
echo
echo "Threading support:"
ACX_PTHREAD
CC="$PTHREAD_CC"
echo "Initializing Automake:"
AM_INIT_AUTOMAKE([1.10 foreign tar-v7 filename-length-max=99])
AC_PROG_LN_S
AC_PROG_CC_C99
if test x$ac_cv_prog_cc_c99 = xno ; then
AC_MSG_ERROR([No C99 compiler was found.])
fi
AM_PROG_CC_C_O
AM_PROG_AS
AC_USE_SYSTEM_EXTENSIONS
if test "x$enable_threads" = xyes; then
echo
echo "Threading support:"
ACX_PTHREAD
LIBS="$LIBS $PTHREAD_LIBS"
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
fi
echo
echo "Initializing Libtool:"
AC_PROG_LIBTOOL
LT_PREREQ([2.2])
LT_INIT([win32-dll])
LT_LANG([Windows Resource])
# This is a bit wrong since it is possible to request that only some libs
# are built as shared. Using that feature isn't so common though, and this
# breaks only on Windows (at least for now) if the user enables only some
# libs as shared.
AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno])
###############################################################################
@@ -379,34 +472,38 @@ AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
[],
[AC_MSG_ERROR([Required header file(s) are missing.])])
# If any of these headers are missing, things should still work correctly:
AC_CHECK_HEADERS([assert.h errno.h byteswap.h sys/param.h sys/sysctl.h],
[], [], [
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
])
###############################################################################
# Checks for typedefs, structures, and compiler characteristics.
###############################################################################
dnl We don't need these as long as we need a C99 compiler anyway.
dnl AC_C_INLINE
dnl AC_C_RESTRICT
AC_HEADER_STDBOOL
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
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
# is used. Most systems seem to have st_xtim but BSDs have st_xtimespec.
AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec, struct stat.st_mtim.tv_nsec,
struct stat.st_atimespec.tv_nsec, struct stat.st_mtimespec.tv_nsec])
# is used.
AC_CHECK_MEMBERS([
struct stat.st_atim.tv_nsec,
struct stat.st_atimespec.tv_nsec,
struct stat.st_atimensec,
struct stat.st_uatime,
struct stat.st_atim.st__tim.tv_nsec])
# It is very unlikely that you want to build liblzma without
# large file support.
AC_SYS_LARGEFILE
# At the moment, the only endian-dependent part should be the integrity checks.
AC_C_BIGENDIAN
@@ -417,124 +514,35 @@ AC_C_BIGENDIAN
# Gnulib replacements as needed
gl_GETOPT
# Functions that are not mandatory i.e. we have alternatives for them
# or we can just drop some functionality:
AC_CHECK_FUNCS([memcpy memmove memset futimes futimesat])
# Find the best function to set timestamps.
AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
# Check how to find out the amount of physical memory in the system. The
# lzma command line tool uses this to automatically limits its memory usage.
# - sysconf() gives all the needed info on GNU+Linux and Solaris.
# - BSDs use sysctl().
AC_MSG_CHECKING([how to detect the amount of physical memory])
AC_COMPILE_IFELSE([
#include <unistd.h>
int
main()
{
long i;
i = sysconf(_SC_PAGESIZE);
i = sysconf(_SC_PHYS_PAGES);
return 0;
}
], [
AC_DEFINE([HAVE_PHYSMEM_SYSCONF], 1,
[Define to 1 if the amount of physical memory can be detected
with sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES).])
AC_MSG_RESULT([sysconf])
], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/sysctl.h>
int
main()
{
int name[2] = { CTL_HW, HW_PHYSMEM };
unsigned long mem;
size_t mem_ptr_size = sizeof(mem);
sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL);
return 0;
}
]])], [
AC_DEFINE([HAVE_PHYSMEM_SYSCTL], 1,
[Define to 1 if the amount of physical memory can be detected
with sysctl().])
AC_MSG_RESULT([sysctl])
], [
AC_MSG_RESULT([unknown])
])])
# Check how to find out the number of available CPU cores in the system.
# sysconf(_SC_NPROCESSORS_ONLN) works on most systems, except that BSDs
# use sysctl().
AC_MSG_CHECKING([how to detect the number of available CPU cores])
AC_COMPILE_IFELSE([
#include <unistd.h>
int
main()
{
long i;
i = sysconf(_SC_NPROCESSORS_ONLN);
return 0;
}
], [
AC_DEFINE([HAVE_NCPU_SYSCONF], 1,
[Define to 1 if the number of available CPU cores can be
detected with sysconf(_SC_NPROCESSORS_ONLN).])
AC_MSG_RESULT([sysconf])
], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/sysctl.h>
int
main()
{
int name[2] = { CTL_HW, HW_NCPU };
int cpus;
size_t cpus_size = sizeof(cpus);
sysctl(name, 2, &cpus, &cpus_size, NULL, NULL);
return 0;
}
]])], [
AC_DEFINE([HAVE_NCPU_SYSCTL], 1,
[Define to 1 if the number of available CPU cores can be
detected with sysctl().])
AC_MSG_RESULT([sysctl])
], [
AC_MSG_RESULT([unknown])
])])
TUKLIB_PROGNAME
TUKLIB_INTEGER
TUKLIB_PHYSMEM
TUKLIB_CPUCORES
TUKLIB_MBSTR
###############################################################################
# If using GCC, set some additional CFLAGS:
# If using GCC, set some additional AM_CFLAGS:
###############################################################################
Wno_uninitialized=no
if test -n "$GCC" ; then
if test "$GCC" = yes ; then
echo
echo "GCC extensions:"
gl_VISIBILITY
if test -n "$CFLAG_VISIBILITY" ; then
CFLAGS="$CFLAG_VISIBILITY $CFLAGS"
fi
fi
# -Wno-uninitialized is needed with -Werror with SHA256 code
# to omit a bogus warning.
AC_MSG_CHECKING([if $CC accepts -Wno-uninitialized])
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wno-uninitialized"
AC_COMPILE_IFELSE([void foo(void) { }], [Wno_uninitialized=yes])
CFLAGS="$OLD_CFLAGS"
AC_MSG_RESULT([$Wno_uninitialized])
# Always do the visibility check but don't set AM_CFLAGS on Windows.
# This way things get set properly even on Windows.
gl_VISIBILITY
if test -n "$CFLAG_VISIBILITY" && test "$is_w32" = no; then
AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
fi
if test "$GCC" = yes ; then
# Enable as much warnings as possible. These commented warnings won't
# work for LZMA Utils though:
# work for this package though:
# * -Wunreachable-code breaks several assert(0) cases, which are
# backed up with "return LZMA_PROG_ERROR".
# * -Wcast-qual would break various things where we need a non-const
@@ -545,23 +553,38 @@ if test -n "$GCC" ; then
# * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
# don't seem so useful here; at least the last one gives some
# warnings which are not bugs.
for NEW_FLAG in -Wextra -Wformat=2 -Winit-self -Wstrict-aliasing=2 \
-Wfloat-equal -Wshadow -Wpointer-arith \
-Wbad-function-cast -Wwrite-strings \
-Waggregate-return -Wstrict-prototypes \
-Wold-style-definition -Wmissing-prototypes \
-Wmissing-declarations -Wmissing-noreturn \
for NEW_FLAG in \
-Wall \
-Wextra \
-Wformat=2 \
-Winit-self \
-Wmissing-include-dirs \
-Wstrict-aliasing \
-Wfloat-equal \
-Wundef \
-Wshadow \
-Wpointer-arith \
-Wbad-function-cast \
-Wwrite-strings \
-Wlogical-op \
-Waggregate-return \
-Wstrict-prototypes \
-Wold-style-definition \
-Wmissing-prototypes \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wredundant-decls
do
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
OLD_CFLAGS="$CFLAGS"
CFLAGS="$NEW_FLAG $CFLAGS"
AC_COMPILE_IFELSE([void foo(void) { }], [
CFLAGS="$CFLAGS $NEW_FLAG"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo(void) { }])], [
AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
AC_MSG_RESULT([yes])
], [
CFLAGS="$OLD_CFLAGS"
AC_MSG_RESULT([no])
])
CFLAGS="$OLD_CFLAGS"
done
AC_ARG_ENABLE([werror],
@@ -569,15 +592,10 @@ if test -n "$GCC" ; then
compilation on all compiler warnings.]),
[], [enable_werror=no])
if test "x$enable_werror" = "xyes"; then
CFLAGS="-Werror $CFLAGS"
AM_CFLAGS="$AM_CFLAGS -Werror"
fi
# IIRC these work with all GCC versions that support -std=c99:
CFLAGS="-std=c99 -pedantic -Wall $CFLAGS"
fi
AM_CONDITIONAL([COND_WNO_UNINITIALIZED], test "x$Wno_uninitialized" = "xyes")
###############################################################################
# Create the makefiles and config.h
@@ -589,26 +607,48 @@ echo
# functions.
AM_CONDITIONAL([COND_GNULIB], test -n "$LIBOBJS")
# Add default AM_CFLAGS.
AC_SUBST([AM_CFLAGS])
# This is needed for src/scripts.
xz=`echo xz | sed "$program_transform_name"`
AC_SUBST([xz])
AC_CONFIG_FILES([
Doxyfile
Makefile
po/Makefile.in
lib/Makefile
src/Makefile
src/liblzma/lzma.pc
src/liblzma/liblzma.pc
src/liblzma/Makefile
src/liblzma/api/Makefile
src/liblzma/common/Makefile
src/liblzma/check/Makefile
src/liblzma/lz/Makefile
src/liblzma/lzma/Makefile
src/liblzma/simple/Makefile
src/liblzma/subblock/Makefile
src/liblzma/rangecoder/Makefile
src/lzma/Makefile
src/lzmadec/Makefile
src/xz/Makefile
src/xzdec/Makefile
src/lzmainfo/Makefile
src/scripts/Makefile
src/scripts/xzdiff
src/scripts/xzgrep
src/scripts/xzmore
src/scripts/xzless
tests/Makefile
debug/Makefile
])
AC_OUTPUT
# Some warnings
if test x$tuklib_cv_physmem_method = xunknown; then
echo
echo "WARNING:"
echo "No supported method to detect the amount of RAM."
echo "Consider using --enable-assume-ram (if you didn't already)"
echo "or make a patch to add support for this operating system."
fi
# Not threading yet so don't warn.
#if test x$tuklib_cv_cpucores_method = xunknown; then
# echo
# echo "WARNING:"
# echo "No supported method to detect the number of CPU cores."
#fi

27
debug/Makefile.am Normal file
View File

@@ -0,0 +1,27 @@
##
## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
noinst_PROGRAMS = \
repeat \
sync_flush \
full_flush \
memusage \
crc32 \
known_sizes \
hex2bin
AM_CPPFLAGS = \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/liblzma/api
LDADD = $(top_builddir)/src/liblzma/liblzma.la
if COND_GNULIB
LDADD += $(top_builddir)/lib/libgnu.a
endif
LDADD += $(LTLIBINTL)

17
debug/README Normal file
View File

@@ -0,0 +1,17 @@
Debug tools
-----------
This directory contains a few tiny programs that may be helpful when
debugging LZMA Utils.
These tools are not meant to be installed. Often one needs to edit
the source code a little to make the programs do the wanted things.
If you don't know how these programs could help you, it is likely
that they really are useless to you.
These aren't intended to be used as example programs. They take some
shortcuts here and there, which correct programs should not do. Many
possible errors (especially I/O errors) are ignored. Don't report
bugs or send patches to fix this kind of bugs.

39
debug/crc32.c Normal file
View File

@@ -0,0 +1,39 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32.c
/// \brief Primitive CRC32 calculation tool
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <stdio.h>
int
main(void)
{
uint32_t crc = 0;
do {
uint8_t buf[BUFSIZ];
const size_t size = fread(buf, 1, sizeof(buf), stdin);
crc = lzma_crc32(buf, size, crc);
} while (!ferror(stdin) && !feof(stdin));
//printf("%08" PRIX32 "\n", crc);
// I want it little endian so it's easy to work with hex editor.
printf("%02" PRIX32 " ", crc & 0xFF);
printf("%02" PRIX32 " ", (crc >> 8) & 0xFF);
printf("%02" PRIX32 " ", (crc >> 16) & 0xFF);
printf("%02" PRIX32 " ", crc >> 24);
printf("\n");
return 0;
}

102
debug/full_flush.c Normal file
View File

@@ -0,0 +1,102 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file full_flush.c
/// \brief Encode files using LZMA_FULL_FLUSH
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <stdio.h>
static lzma_stream strm = LZMA_STREAM_INIT;
static FILE *file_in;
static void
encode(size_t size, lzma_action action)
{
static const size_t CHUNK = 64;
uint8_t in[CHUNK];
uint8_t out[CHUNK];
lzma_ret ret;
do {
if (strm.avail_in == 0 && size > 0) {
const size_t amount = my_min(size, CHUNK);
strm.avail_in = fread(in, 1, amount, file_in);
strm.next_in = in;
size -= amount; // Intentionally not using avail_in.
}
strm.next_out = out;
strm.avail_out = CHUNK;
ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
fwrite(out, 1, CHUNK - strm.avail_out, stdout);
} while (size > 0 || strm.avail_out == 0);
if ((action == LZMA_RUN && ret != LZMA_OK)
|| (action != LZMA_RUN && ret != LZMA_STREAM_END)) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
}
int
main(int argc, char **argv)
{
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
// Config
lzma_options_lzma opt_lzma;
if (lzma_lzma_preset(&opt_lzma, 1)) {
fprintf(stderr, "preset failed\n");
exit(1);
}
lzma_filter filters[LZMA_FILTERS_MAX + 1];
filters[0].id = LZMA_FILTER_LZMA2;
filters[0].options = &opt_lzma;
filters[1].id = LZMA_VLI_UNKNOWN;
// Init
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
fprintf(stderr, "init failed\n");
exit(1);
}
// if (lzma_easy_encoder(&strm, 1)) {
// fprintf(stderr, "init failed\n");
// exit(1);
// }
// Encoding
encode(0, LZMA_FULL_FLUSH);
encode(6, LZMA_FULL_FLUSH);
encode(0, LZMA_FULL_FLUSH);
encode(7, LZMA_FULL_FLUSH);
encode(0, LZMA_FULL_FLUSH);
encode(0, LZMA_FINISH);
// Clean up
lzma_end(&strm);
return 0;
}

53
debug/hex2bin.c Normal file
View File

@@ -0,0 +1,53 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file hex2bin.c
/// \brief Converts hexadecimal input strings to binary
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include <stdio.h>
#include <ctype.h>
static int
getbin(int x)
{
if (x >= '0' && x <= '9')
return x - '0';
if (x >= 'A' && x <= 'F')
return x - 'A' + 10;
return x - 'a' + 10;
}
int
main(void)
{
while (true) {
int byte = getchar();
if (byte == EOF)
return 0;
if (!isxdigit(byte))
continue;
const int digit = getchar();
if (digit == EOF || !isxdigit(digit)) {
fprintf(stderr, "Invalid input\n");
return 1;
}
byte = (getbin(byte) << 4) | getbin(digit);
if (putchar(byte) == EOF) {
perror(NULL);
return 1;
}
}
}

129
debug/known_sizes.c Normal file
View File

@@ -0,0 +1,129 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file known_sizes.c
/// \brief Encodes .lzma Stream with sizes known in Block Header
///
/// The input file is encoded in RAM, and the known Compressed Size
/// and/or Uncompressed Size values are stored in the Block Header.
/// As of writing there's no such Stream encoder in liblzma.
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/unistd.h>
#include <stdio.h>
// Support file sizes up to 1 MiB. We use this for output space too, so files
// close to 1 MiB had better compress at least a little or we have a buffer
// overflow.
#define BUFFER_SIZE (1U << 20)
int
main(void)
{
// Allocate the buffers.
uint8_t *in = malloc(BUFFER_SIZE);
uint8_t *out = malloc(BUFFER_SIZE);
if (in == NULL || out == NULL)
return 1;
// Fill the input buffer.
const size_t in_size = fread(in, 1, BUFFER_SIZE, stdin);
// Filter setup
lzma_options_lzma opt_lzma;
if (lzma_lzma_preset(&opt_lzma, 1))
return 1;
lzma_filter filters[] = {
{
.id = LZMA_FILTER_LZMA2,
.options = &opt_lzma
},
{
.id = LZMA_VLI_UNKNOWN
}
};
lzma_block block = {
.check = LZMA_CHECK_CRC32,
.compressed_size = BUFFER_SIZE, // Worst case reserve
.uncompressed_size = in_size,
.filters = filters,
};
lzma_stream strm = LZMA_STREAM_INIT;
if (lzma_block_encoder(&strm, &block) != LZMA_OK)
return 1;
// Reserve space for Stream Header and Block Header. We need to
// calculate the size of the Block Header first.
if (lzma_block_header_size(&block) != LZMA_OK)
return 1;
size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size;
strm.next_in = in;
strm.avail_in = in_size;
strm.next_out = out + out_size;
strm.avail_out = BUFFER_SIZE - out_size;
if (lzma_code(&strm, LZMA_FINISH) != LZMA_STREAM_END)
return 1;
out_size += strm.total_out;
if (lzma_block_header_encode(&block, out + LZMA_STREAM_HEADER_SIZE)
!= LZMA_OK)
return 1;
lzma_index *idx = lzma_index_init(NULL);
if (idx == NULL)
return 1;
if (lzma_index_append(idx, NULL, block.header_size + strm.total_out,
strm.total_in) != LZMA_OK)
return 1;
if (lzma_index_encoder(&strm, idx) != LZMA_OK)
return 1;
if (lzma_code(&strm, LZMA_RUN) != LZMA_STREAM_END)
return 1;
out_size += strm.total_out;
lzma_end(&strm);
lzma_index_end(idx, NULL);
// Encode the Stream Header and Stream Footer. backwards_size is
// needed only for the Stream Footer.
lzma_stream_flags sf = {
.backward_size = strm.total_out,
.check = block.check,
};
if (lzma_stream_header_encode(&sf, out) != LZMA_OK)
return 1;
if (lzma_stream_footer_encode(&sf, out + out_size) != LZMA_OK)
return 1;
out_size += LZMA_STREAM_HEADER_SIZE;
// Write out the file.
fwrite(out, 1, out_size, stdout);
return 0;
}

51
debug/memusage.c Normal file
View File

@@ -0,0 +1,51 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file memusage.c
/// \brief Calculates memory usage using lzma_memory_usage()
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <stdio.h>
int
main(void)
{
lzma_options_lzma lzma = {
.dict_size = (1U << 30) + (1U << 29),
.lc = 3,
.lp = 0,
.pb = 2,
.preset_dict = NULL,
.preset_dict_size = 0,
.mode = LZMA_MODE_NORMAL,
.nice_len = 48,
.mf = LZMA_MF_BT4,
.depth = 0,
};
/*
lzma_options_filter filters[] = {
{ LZMA_FILTER_LZMA1,
(lzma_options_lzma *)&lzma_preset_lzma[6 - 1] },
{ UINT64_MAX, NULL }
};
*/
lzma_filter filters[] = {
{ LZMA_FILTER_LZMA1, &lzma },
{ UINT64_MAX, NULL }
};
printf("Encoder: %10" PRIu64 " B\n",
lzma_raw_encoder_memusage(filters));
printf("Decoder: %10" PRIu64 " B\n",
lzma_raw_decoder_memusage(filters));
return 0;
}

36
debug/repeat.c Normal file
View File

@@ -0,0 +1,36 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file repeat.c
/// \brief Repeats given string given times
///
/// This program can be useful when debugging run-length encoder in
/// the Subblock filter, especially the condition when repeat count
/// doesn't fit into 28-bit integer.
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include <stdio.h>
int
main(int argc, char **argv)
{
if (argc != 3) {
fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]);
exit(1);
}
unsigned long long count = strtoull(argv[1], NULL, 10);
const size_t size = strlen(argv[2]);
while (count-- != 0)
fwrite(argv[2], 1, size, stdout);
return !!(ferror(stdout) || fclose(stdout));
}

124
debug/sync_flush.c Normal file
View File

@@ -0,0 +1,124 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file sync_flush.c
/// \brief Encode files using LZMA_SYNC_FLUSH
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <stdio.h>
static lzma_stream strm = LZMA_STREAM_INIT;
static FILE *file_in;
static void
encode(size_t size, lzma_action action)
{
static const size_t CHUNK = 64;
uint8_t in[CHUNK];
uint8_t out[CHUNK];
lzma_ret ret;
do {
if (strm.avail_in == 0 && size > 0) {
const size_t amount = my_min(size, CHUNK);
strm.avail_in = fread(in, 1, amount, file_in);
strm.next_in = in;
size -= amount; // Intentionally not using avail_in.
}
strm.next_out = out;
strm.avail_out = CHUNK;
ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
fwrite(out, 1, CHUNK - strm.avail_out, stdout);
} while (size > 0 || strm.avail_out == 0);
if ((action == LZMA_RUN && ret != LZMA_OK)
|| (action != LZMA_RUN && ret != LZMA_STREAM_END)) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
}
int
main(int argc, char **argv)
{
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
// Config
lzma_options_lzma opt_lzma = {
.dict_size = 1U << 16,
.lc = LZMA_LC_DEFAULT,
.lp = LZMA_LP_DEFAULT,
.pb = LZMA_PB_DEFAULT,
.preset_dict = NULL,
.mode = LZMA_MODE_NORMAL,
.nice_len = 32,
.mf = LZMA_MF_HC3,
.depth = 0,
};
lzma_options_delta opt_delta = {
.dist = 16
};
lzma_filter filters[LZMA_FILTERS_MAX + 1];
filters[0].id = LZMA_FILTER_LZMA2;
filters[0].options = &opt_lzma;
filters[1].id = LZMA_VLI_UNKNOWN;
// Init
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
fprintf(stderr, "init failed\n");
exit(1);
}
// Encoding
encode(0, LZMA_SYNC_FLUSH);
encode(6, LZMA_SYNC_FLUSH);
encode(0, LZMA_SYNC_FLUSH);
encode(7, LZMA_SYNC_FLUSH);
encode(0, LZMA_SYNC_FLUSH);
encode(0, LZMA_FINISH);
/*
encode(53, LZMA_SYNC_FLUSH);
opt_lzma.lc = 2;
opt_lzma.lp = 1;
opt_lzma.pb = 0;
if (lzma_filters_update(&strm, filters) != LZMA_OK) {
fprintf(stderr, "update failed\n");
exit(1);
}
encode(404, LZMA_FINISH);
*/
// Clean up
lzma_end(&strm);
return 0;
// Prevent useless warnings so we don't need to have special CFLAGS
// to disable -Werror.
(void)opt_lzma;
(void)opt_delta;
}

100
debug/translation.bash Normal file
View File

@@ -0,0 +1,100 @@
#!/bin/bash
###############################################################################
#
# Script to check output of some translated messages
#
# This should be useful for translators to check that the translated strings
# look good. This doesn't make xz print all possible strings, but it should
# cover most of the cases where mistakes can easily happen.
#
# Give the path and filename of the xz executable as an argument. If no
# arguments are given, this script uses ../src/xz/xz (relative to the
# location of this script).
#
# You may want to pipe the output of this script to less -S to view the
# tables printed by xz --list on a 80-column terminal. On the other hand,
# viewing the other messages may be better without -S.
#
###############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
set -e
# If an argument was given, use it to set the location of the xz executable.
unset XZ
if [ -n "$1" ]; then
XZ=$1
[ "x${XZ:0:1}" != "x/" ] && XZ="$PWD/$XZ"
fi
# Locate top_srcdir and go there.
top_srcdir="$(cd -- "$(dirname -- "$0")" && cd .. && pwd)"
cd -- "$top_srcdir"
# If XZ wasn't already set, use the default location.
XZ=${XZ-"$PWD/src/xz/xz"}
if [ "$(type -t "$XZ" || true)" != "file" ]; then
echo "Give the location of the xz executable as an argument" \
"to this script."
exit 1
fi
XZ=$(type -p -- "$XZ")
# Print the xz version and locale information.
echo "$XZ --version"
"$XZ" --version
echo
if [ -d .git ] && type git > /dev/null 2>&1; then
echo "Source code version in $PWD:"
git describe --abbrev=4
fi
echo
locale
echo
# Make the test files directory the current directory.
cd tests/files
# Put xz in PATH so that argv[0] stays short.
PATH=${XZ%/*}:$PATH
# Some of the test commands are error messages and thus don't
# return successfully.
set +e
for CMD in \
"xz --foobarbaz" \
"xz --memlimit=123abcd" \
"xz --memlimit=40MiB -6 /dev/null" \
"xz --memlimit=0 --info-memory" \
"xz --memlimit-compress=1234MiB --memlimit-decompress=50MiB --info-memory" \
"xz --verbose --verbose /dev/null | cat" \
"xz --lzma2=foobarbaz" \
"xz --lzma2=foobarbaz=abcd" \
"xz --lzma2=mf=abcd" \
"xz --lzma2=preset=foobarbaz" \
"xz --lzma2=mf=bt4,nice=2" \
"xz --lzma2=nice=50000" \
"xz --help" \
"xz --long-help" \
"xz --list good-*lzma2*" \
"xz --list good-1-check*" \
"xz --list --verbose good-*lzma2*" \
"xz --list --verbose good-1-check*" \
"xz --list --verbose --verbose good-*lzma2*" \
"xz --list --verbose --verbose good-1-check*" \
"xz --list --verbose --verbose unsupported-check.xz"
do
echo "-----------------------------------------------------------"
echo
echo "\$ $CMD"
eval "$CMD"
echo
done 2>&1

View File

@@ -1,46 +0,0 @@
Reporting bugs
--------------
Naturally it is easiest for me if you already know what causes the
unexpected behavior. Even better if you have a patch to propose.
However, quite often the reason for unexpected behavior is unknown,
so below are a few things what to do before sending a bug report.
In case of a crash (usually segmentation violation):
1. Try to create a small example how to reprocude the issue.
2. If you are writing an application using liblzma or libzfile,
double check that you are using the libraries correctly (for
example, that you didn't forget to call lzma_init()). If it is
the command line tool included in LZMA Utils that is crashing,
ignore this step.
3. Compile LZMA Utils with debugging code using configure switch
`--enable-debug'. If you are using GCC as the compiler, use
CFLAGS='-O0 -ggdb'. Don't strip the resulting binaries.
4. Turn on core dumps. The exact command depends on your shell;
for example in GNU bash it is done with `ulimit -c unlimited',
and in tcsh with `limit coredumpsize unlimited'.
5. Try to reproduce the suspected bug. If you get `assertion failed'
message, be sure to include the complete message in your bug
report. If the application leaves a coredump, get a backtrace
using gdb:
$ gdb /path/to/app-binary # Loads the app to the debugger.
(gdb) core core # Opens the coredump.
(gdb) bt # Prints the backtrace. Copy & paste to bug report.
(gdb) quit # Quits gdb.
Send your bug report to Lasse Collin <lasse.collin@tukaani.org>. Don't
send the core dump file or the actual executables. If you have a small
example file(s) (total size less than 100 KiB), please include it/them
as an attachment.
Do NOT complain about problems with LZMA Utils to Igor Pavlov.
Although the code of LZMA Utils is derived from his code, there are
a lot of changes, which may have introduced bugs not present in
the original version.

127
doc/examples/xz_pipe_comp.c Normal file
View File

@@ -0,0 +1,127 @@
/*
* xz_pipe_comp.c
* A simple example of pipe-only xz compressor implementation.
* version: 2010-07-12 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp
*
* Usage example:
* $ cat some_file | ./xz_pipe_comp > some_file.xz
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* COMPRESSION SETTINGS */
/* analogous to xz CLI options: -0 to -9 */
#define COMPRESSION_LEVEL 6
/* boolean setting, analogous to xz CLI option: -e */
#define COMPRESSION_EXTREME true
/* see: /usr/include/lzma/check.h LZMA_CHECK_* */
#define INTEGRITY_CHECK LZMA_CHECK_CRC64
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_COMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_compress (FILE *in_file, FILE *out_file)
{
uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0);
lzma_check check = INTEGRITY_CHECK;
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz encoder */
ret_xz = lzma_easy_encoder (&strm, preset, check);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the xz data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending compressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* compress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_COMPRESSION;
} else {
/* write compressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_compress (stdin, stdout);
return ret;
}

View File

@@ -0,0 +1,115 @@
/*
* xz_pipe_decomp.c
* A simple example of pipe-only xz decompressor implementation.
* version: 2010-07-12 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp
*
* Usage example:
* $ cat some_file.xz | ./xz_pipe_decomp > some_file
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_DECOMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_decompress (FILE *in_file, FILE *out_file)
{
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED;
const uint64_t memory_limit = UINT64_MAX; /* no memory limit */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz decoder */
ret_xz = lzma_stream_decoder (&strm, memory_limit, flags);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the decompressed data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending decompressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* decompress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_DECOMPRESSION;
} else {
/* write decompressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_decompress (stdin, stdout);
return ret;
}

View File

@@ -1,247 +1,224 @@
LZMA Utils FAQ
--------------
XZ Utils FAQ
============
Copyright (C) 2007 Lasse Collin
Q: What do the letters XZ mean?
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
A: Nothing. They are just two letters, which come from the file format
suffix .xz. The .xz suffix was selected, because it seemed to be
pretty much unused. It has no deeper meaning.
Q: What are LZMA, LZMA Utils, lzma, .lzma, liblzma, LZMA SDK, LZMA_Alone,
7-Zip and p7zip?
Q: What are LZMA and LZMA2?
A: LZMA stands for Lempel-Ziv-Markov chain-Algorithm. LZMA is the name
of the compression algorithm designed by Igor Pavlov. He is the author
of 7-Zip, which is a great LGPL'd compression tool for Microsoft
Windows operating systems. In addition to 7-Zip itself, also LZMA SDK
is available on the website of 7-Zip. LZMA SDK contains LZMA
implementations in C++, Java and C#. The C++ version is the original
implementation which is used also in 7-Zip itself.
A: LZMA stands for Lempel-Ziv-Markov chain-Algorithm. It is the name
of the compression algorithm designed by Igor Pavlov for 7-Zip.
LZMA is based on LZ77 and range encoding.
Excluding the unrar plugin, 7-Zip is free software (free as in
freedom). Thanks to this, it was possible to port it to POSIX
platforms. The port was done and is maintained by myspace (TODO:
myspace's real name?). p7zip is a port of 7-Zip's command line version;
p7zip doesn't include the 7-Zip's GUI.
In POSIX world, users are used to gzip and bzip2 command line tools.
Developers know APIs of zlib and libbzip2. LZMA Utils try to ease
adoption of LZMA on free operating systems by providing a compression
library and a set of command line tools. The library is called liblzma.
It provides a zlib-like API making it easy to adapt LZMA compression in
existing applications. The main command line tool is known as lzma,
whose command line syntax is very similar to that of gzip and bzip2.
The original command line tool from LZMA SDK (lzma.exe) was found from
a directory called LZMA_Alone in the LZMA SDK. It used a simple header
format in .lzma files. This format was also used by LZMA Utils up to
and including 4.32.x. In LZMA Utils documentation, LZMA_Alone refers
to both the file format and the command line tool from LZMA SDK.
Because of various limitations of the LZMA_Alone file format, a new
file format was developed. Extending some existing format such as .gz
used by gzip was considered, but these formats were found to be too
limited. The filename suffix for the new .lzma format is `.lzma'. The
same suffix is also used for files in the LZMA_Alone format. To make
the transition to the new format as transparent as possible, LZMA Utils
support both the new and old formats transparently.
7-Zip and LZMA SDK: <http://7-zip.org/>
p7zip: <http://p7zip.sourceforge.net/>
LZMA Utils: <http://tukaani.org/lzma/>
LZMA2 is an updated version of the original LZMA to fix a couple of
practical issues. In context of XZ Utils, LZMA is called LZMA1 to
emphasize that LZMA is not the same thing as LZMA2. LZMA2 is the
primary compression algorithm in the .xz file format.
Q: What LZMA implementations there are available?
Q: There are many LZMA related projects. How does XZ Utils relate to them?
A: LZMA SDK contains implementations in C++, Java and C#. The C++ version
is the original implementation which is part of 7-Zip. LZMA SDK
contains also a small LZMA decoder in C.
A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly
a subset of the 7-Zip source tree.
A port of LZMA SDK to Pascal was made by Alan Birtles
<http://www.birtles.org.uk/programming/>. It should work with
multiple Pascal programming language implementations.
p7zip is 7-Zip's command line tools ported to POSIX-like systems.
LZMA Utils includes liblzma, which is directly based on LZMA SDK.
liblzma is written in C (C99, not C89). In contrast to C++ callback
API used by LZMA SDK, liblzma uses zlib-like stateful C API. I do not
want to comment whether both/former/latter/neither API(s) are good or
bad. The only reason to implement a zlib-like API was, that many
developers are already familiar with zlib, and very many applications
already use zlib. Having a similar API makes it easier to include LZMA
support in existing applications.
LZMA Utils provide a gzip-like lzma tool for POSIX-like systems.
LZMA Utils are based on LZMA SDK. XZ Utils are the successor to
LZMA Utils.
See also <http://en.wikipedia.org/wiki/LZMA#External_links>.
There are several other projects using LZMA. Most are more or less
based on LZMA SDK. See <http://7-zip.org/links.html>.
Q: Which file formats are supported by LZMA Utils?
Q: Why is liblzma named liblzma if its primary file format is .xz?
Shouldn't it be e.g. libxz?
A: Even when the raw LZMA stream is always the same, it can be wrapped
in different container formats. The preferred format is the new .lzma
format. It has magic bytes (the first six bytes: 0xFF 'L' 'Z' 'M'
'A' 0x00). The format supports chaining up to seven filters filters,
splitting data to multiple blocks for easier multi-threading and rough
random-access reading. The file integrity is verified using CRC32,
CRC64, or SHA256, and by verifying the uncompressed size of the file.
LZMA SDK includes a tool called LZMA_Alone. It supports uses a
primitive header which includes only the mandatory stream information
required by the LZMA decoder. This format can be both read and
written by liblzma and the command line tool (use --format=alone to
create such files).
.7z is the native archive format used by 7-Zip. This format is not
supported by liblzma, and probably will never be supported. You
should use e.g. p7zip to extract .7z files.
It is possible to implement custom file formats by using raw filter
mode in liblzma. In this mode the application needs to store the filter
properties and provide them to liblzma before starting to uncompress
the data.
A: When the designing of the .xz format began, the idea was to replace
the .lzma format and use the same .lzma suffix. It would have been
quite OK to reuse the suffix when there were very few .lzma files
around. However, the old .lzma format become popular before the
new format was finished. The new format was renamed to .xz but the
name of liblzma wasn't changed.
Q: How can I identify files containing LZMA compressed data?
Q: Do XZ Utils support the .7z format?
A: The preferred filename suffix for .lzma files is `.lzma'. `.tar.lzma'
may be abbreviated to `.tlz'. The same suffixes are used for files in
LZMA_Alone format. In practice this should be no problem since tools
included in LZMA Utils support both formats transparently.
Checking the magic bytes is easy way to detect files in the new .lzma
format (the first six bytes: 0xFF 'L' 'Z' 'M' 'A' 0x00). The "file"
command version FIXME contains magic strings for this format.
The old LZMA_Alone format has no magic bytes. Its header cannot contain
arbitrary bytes, thus it is possible to make a guess. Unfortunately the
guessing is usually too hard to be reliable, so don't try it unless you
are desperate.
A: No. Use 7-Zip (Windows) or p7zip (POSIX-like systems) to handle .7z
files.
Q: Does the lzma command line tool support sparse files?
Q: I have many .tar.7z files. Can I convert them to .tar.xz without
spending hours recompressing the data?
A: Sparse files can (of course) be compressed like normal files, but
uncompression will not restore sparseness of the file. Use an archiver
tool to take care of sparseness before compressing the data with lzma.
The reason for this is that archiver tools handle files, while
compression tools handle streams or buffers. Being a sparse file is
a property of the file on the disk, not a property of the stream or
buffer.
A: In the "extra" directory, there is a script named 7z2lzma.bash which
is able to convert some .7z files to the .lzma format (not .xz). It
needs the 7za (or 7z) command from p7zip. The script may silently
produce corrupt output if certain assumptions are not met, so
decompress the resulting .lzma file and compare it against the
original before deleting the original file!
Q: Can I recover parts of a broken LZMA file (e.g. corrupted CD-R)?
Q: I have many .lzma files. Can I quickly convert them to the .xz format?
A: With LZMA_Alone and single-block .lzma files, you can uncompress the
file until you hit the first broken byte. The data after the broken
position is lost. LZMA relies on the uncompression history, and if
bytes are missing in the middle of the file, it is impossible to
reliably continue after the broken section.
A: For now, no. Since XZ Utils supports the .lzma format, it's usually
not too bad to keep the old files in the old format. If you want to
do the conversion anyway, you need to decompress the .lzma files and
then recompress to the .xz format.
With multi-block .lzma files it may be possible to locale the next
block in the file and continue decoding there. A limited recovery
tool for this kind of situations is planned.
Technically, there is a way to make the conversion relatively fast
(roughly twice the time that normal decompression takes). Writing
such a tool would take quite a bit time though, and would probably
be useful to only a few people. If you really want such a conversion
tool, contact Lasse Collin and offer some money.
Q: Is LZMA patented?
Q: I have installed xz, but my tar doesn't recognize .tar.xz files.
How can I extract .tar.xz files?
A: No, the authors are not aware of any patents that could affect LZMA.
However, due to nature of software patents, the authors cannot
guarantee, that LZMA isn't affected by any third party patent.
A: xz -dc foo.tar.xz | tar xf -
Q: Where can I find documentation about how LZMA works as an algorithm?
Q: Can I recover parts of a broken .xz file (e.g. corrupted CD-R)?
A: Read the source code, Luke. There is no documentation about LZMA
internals. It is possible that Igor Pavlov is the only person on
the Earth that completely knows and understands the algorithm.
You could begin by downloading LZMA SDK, and start reading from
the LZMA decoder to get some idea about the bitstream format.
Before you begin, you should know the basics of LZ77 and
range coding algorithms. LZMA is based on LZ77, but LZMA is
*a lot* more complex. Range coding is used to compress the
final bitstream like Huffman coding is used in Deflate.
A: It may be possible if the file consists of multiple blocks, which
typically is not the case if the file was created in single-threaded
mode. There is no recovery program yet.
Q: What are filters?
Q: Is (some part of) XZ Utils patented?
A: In context of .lzma files, a filter means an implementation of a
compression algorithm. The primary filter is LZMA, which is why
the names of the tools contain the letters LZMA.
A: Lasse Collin is not aware of any patents that could affect XZ Utils.
However, due to nature of software patents, it's not possible to
guarantee that XZ Utils isn't affected by any third party patent(s).
liblzma and the new .lzma format support also other filters than LZMA.
There are different types of filters, which are suitable for different
types of data. Thus, to select the optimal filter and settings, the
type of the input data being compressed needs to be known.
Some filters are most useful when combined with another filter like
LZMA. These filters increase redundancy in the data, without changing
the size of the data, by taking advantage of properties specific to
the data being compressed.
Q: Where can I find documentation about the file format and algorithms?
So far, all the filters are always reversible. That is, no matter what
data you pass to a filter encoder, it can be always defiltered back to
the original form. Because of this, it is safe to compress for example
a software package that contains other file types than executables
using a filter specific to the architechture of the package being
compressed.
A: The .xz format is documented in xz-file-format.txt. It is a container
format only, and doesn't include descriptions of any non-trivial
filters.
The old LZMA_Alone format supports only the LZMA filter.
Documenting LZMA and LZMA2 is planned, but for now, there is no other
documentation that the source code. Before you begin, you should know
the basics of LZ77 and range coding algorithms. LZMA is based on LZ77,
but LZMA is a lot more complex. Range coding is used to compress
the final bitstream like Huffman coding is used in Deflate.
Q: I cannot find BCJ and BCJ2 filters. Don't they exist in liblzma?
A: BCJ filter is called "x86" in liblzma. BCJ2 is not included,
because it requires using more than one encoded output stream.
A streamable version of BCJ2-style filtering is planned.
Q: Can I use LZMA in proprietary, non-free applications?
Q: I need to use a script that runs "xz -9". On a system with 256 MiB
of RAM, xz says that it cannot allocate memory. Can I make the
script work without modifying it?
A: liblzma is under the GNU LGPL version 2.1 or (at your opinion) any
later version. To summarise (*NOTE* This summary is not legally
binding, that is, it doesn't give you any extra permissions compared
to the LGPL. Read the GNU LGPL carefully for the exact license
conditions.):
* All the changes made into the library itself must be published
under the same license.
* End users must be able to replace the used liblzma. Easiest way
to assure this is to link dynamically against liblzma so users
can replace the shared library file if they want.
* You must make it clear to your users, that your application uses
liblzma, and that liblzma is free software under the GNU LGPL.
A copy of GNU LGPL must be included.
A: Set a default memory usage limit for compression. You can do it e.g.
in a shell initialization script such as ~/.bashrc or /etc/profile:
LZMA SDK contains a special exception which allows linking *unmodified*
code statically with a non-free application. This exception does *not*
apply to liblzma.
XZ_DEFAULTS=--memlimit-compress=150MiB
export XZ_DEFAULTS
As an alternative, you can support the development of LZMA and 7-Zip
by buying a proprietary license from Igor Pavlov. See homepage of
LZMA SDK <http://7-zip.org/sdk.html> for more information. Note that
having a proprietary license from Igor Pavlov doesn't allow you to use
liblzma in a way that contradicts with the GNU LGPL, because liblzma
contains code that is not copyrighted by Igor Pavlov. Please contact
both Lasse Collin and Igor Pavlov if the license conditions of liblzma
are not suitable for you.
xz will then scale the compression settings down so that the given
memory usage limit is not reached. This way xz shouldn't run out
of memory.
Check also that memory-related resource limits are high enough.
On most systems, "ulimit -a" will show the current resource limits.
Q: I would like to help. What can I do?
Q: How do I create files that can be decompressed with XZ Embedded?
A: See the TODO file. Please contact Lasse Collin before starting to do
anything, because it is possible that someone else is already working
on the same thing.
A: See the documentation in XZ Embedded. In short, something like
this is a good start:
xz --check=crc32 --lzma2=preset=6e,dict=64KiB
Or if a BCJ filter is needed too, e.g. if compressing
a kernel image for PowerPC:
xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB
Adjust dictionary size to get a good compromise between
compression ratio and decompressor memory usage. Note that
in single-call decompression mode of XZ Embedded, a big
dictionary doesn't increase memory usage.
Q: How can I contact the authors?
Q: Will xz support threaded compression?
A: Lasse Collin is the maintainer of LZMA Utils. You can contact him
either via IRC (Larhzu on #tukaani at Freenode or IRCnet). Email
should work too, <lasse.collin@tukaani.org>.
A: It is planned and has been taken into account when designing
the .xz file format. Eventually there will probably be three types
of threading, each method having its own advantages and disadvantages.
Igor Pavlov is the father of LZMA. He is the author of 7-Zip
and LZMA SDK. <http://7-zip.org/>
The simplest method is splitting the uncompressed data into blocks
and compressing them in parallel independent from each other.
Since the blocks are compressed independently, they can also be
decompressed independently. Together with the index feature in .xz,
this allows using threads to create .xz files for random-access
reading. This also makes threaded decompression possible, although
it is not clear if threaded decompression will ever be implemented.
NOTE: Please don't bother Igor Pavlov with questions specific
to LZMA Utils.
The independent blocks method has a couple of disadvantages too. It
will compress worse than a single-block method. Often the difference
is not too big (maybe 1-2 %) but sometimes it can be too big. Also,
the memory usage of the compressor increases linearly when adding
threads.
Match finder parallelization is another threading method. It has
been in 7-Zip for ages. It doesn't affect compression ratio or
memory usage significantly. Among the three threading methods, only
this is useful when compressing small files (files that are not
significantly bigger than the dictionary). Unfortunately this method
scales only to about two CPU cores.
The third method is pigz-style threading (I use that name, because
pigz <http://www.zlib.net/pigz/> uses that method). It doesn't
affect compression ratio significantly and scales to many cores.
The memory usage scales linearly when threads are added. It isn't
significant with pigz, because Deflate uses only 32 KiB dictionary,
but with LZMA2 the memory usage will increase dramatically just like
with the independent blocks method. There is also a constant
computational overhead, which may make pigz-method a bit dull on
dual-core compared to the parallel match finder method, but with more
cores the overhead is not a big deal anymore.
Combining the threading methods will be possible and also useful.
E.g. combining match finder parallelization with pigz-style threading
can cut the memory usage by 50 %.
It is possible that the single-threaded method will be modified to
create files indentical to the pigz-style method. We'll see once
pigz-style threading has been implemented in liblzma.
Q: How do I build a program that needs liblzmadec (lzmadec.h)?
A: liblzmadec is part of LZMA Utils. XZ Utils has liblzma, but no
liblzmadec. The code using liblzmadec should be ported to use
liblzma instead. If you cannot or don't want to do that, download
LZMA Utils from <http://tukaani.org/lzma/>.
Q: The default build of liblzma is too big. How can I make it smaller?
A: Give --enable-small to the configure script. Use also appropriate
--enable or --disable options to include only those filter encoders
and decoders and integrity checks that you actually need. Use
CFLAGS=-Os (with GCC) or equivalent to tell your compiler to optimize
for size. See INSTALL for information about configure options.
If the result is still too big, take a look at XZ Embedded. It is
a separate project, which provides a limited but significantly
smaller XZ decoder implementation than XZ Utils. You can find it
at <http://tukaani.org/xz/embedded.html>.

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
LZMA Utils history
------------------
History of LZMA Utils and XZ Utils
==================================
Tukaani distribution
@@ -15,10 +15,10 @@ Tukaani distribution
which is an abbreviation of .tar.gz. A logical naming for LZMA
compressed packages was .tlz, being an abbreviation of .tar.lzma.
At the end of the year 2007, there's no distribution under the Tukaani
project anymore. Development of LZMA Utils still continues. Still,
there are .tlz packages around, because at least Vector Linux (a
Slackware based distribution) uses LZMA for its packages.
At the end of the year 2007, there was no distribution under the
Tukaani project anymore, but development of LZMA Utils was kept going.
Still, there were .tlz packages around, because at least Vector Linux
(a Slackware based distribution) used LZMA for its packages.
First versions of the modified pkgtools used the LZMA_Alone tool from
Igor Pavlov's LZMA SDK as is. It was fine, because users wouldn't need
@@ -59,8 +59,8 @@ Second generation
command line tool, but they had completely different command line
interface. The file format was still the same.
Lasse wrote liblzmadec, which was a small decoder-only library based on
the C code found from LZMA SDK. liblzmadec had API similar to zlib,
Lasse wrote liblzmadec, which was a small decoder-only library based
on the C code found from LZMA SDK. liblzmadec had API similar to zlib,
although there were some significant differences, which made it
non-trivial to use it in some applications designed for zlib and
libbzip2.
@@ -77,8 +77,8 @@ Second generation
but appeared to work well enough, so some people started using it too.
Because the development of the third generation of LZMA Utils was
delayed considerably (roughly two years), the 4.32.x branch had to be
kept maintained. It got some bug fixes now and then, and finally it was
delayed considerably (3-4 years), the 4.32.x branch had to be kept
maintained. It got some bug fixes now and then, and finally it was
decided to call it stable, although most of the missing features were
never added.
@@ -90,51 +90,60 @@ File format problems
features. The two biggest problems for non-embedded use were lack of
magic bytes and integrity check.
Igor and Lasse started developing a new file format with some help from
Ville Koskinen, Mark Adler and Mikko Pouru. Designing the new format
took quite a long time. It was mostly because Lasse was quite slow at
getting things done due to personal reasons.
Igor and Lasse started developing a new file format with some help
from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin,
and Lars Wirzenius helped with some minor things at some point of the
development. Designing the new format took quite a long time (actually,
too long time would be more appropriate expression). It was mostly
because Lasse was quite slow at getting things done due to personal
reasons.
Near the end of the year 2007 the new format was practically finished.
Compared to LZMA_Alone format and the .gz format used by gzip, the new
.lzma format is quite complex as a whole. This means that tools having
*full* support for the new format would be larger and more complex than
the tools supporting only the old LZMA_Alone format.
Originally the new format was supposed to use the same .lzma suffix
that was already used by the old file format. Switching to the new
format wouldn't have caused much trouble when the old format wasn't
used by many people. But since the development of the new format took
so long time, the old format got quite popular, and it was decided
that the new file format must use a different suffix.
For the situations where the full support for the .lzma format wouldn't
be required (embedded systems, operating system kernels), the new
format has a well-defined subset, which is easy to support with small
amount of code. It wouldn't be as small as an implementation using the
LZMA_Alone format, but the difference shouldn't be significant.
It was decided to use .xz as the suffix of the new file format. The
first stable .xz file format specification was finally released in
December 2008. In addition to fixing the most obvious problems of
the old .lzma format, the .xz format added some new features like
support for multiple filters (compression algorithms), filter chaining
(like piping on the command line), and limited random-access reading.
The new .lzma format allows dividing the data in multiple independent
blocks, which can be compressed and uncompressed independenly. This
makes multi-threading possible with algorithms that aren't inherently
parallel (such as LZMA). There's also a central index of the sizes of
the blocks, which makes it possible to do limited random-access reading
with granularity of the block size.
The new .lzma format uses the same filename suffix that was used for
LZMA_Alone files. The advantage is that users using the new tools won't
notice the change to the new format. The disadvantage is that the old
tools won't work with the new files.
Currently the primary compression algorithm used in .xz is LZMA2.
It is an extension on top of the original LZMA to fix some practical
problems: LZMA2 adds support for flushing the encoder, uncompressed
chunks, eases stateful decoder implementations, and improves support
for multithreading. Since LZMA2 is better than the original LZMA, the
original LZMA is not supported in .xz.
Third generation
Transition to XZ Utils
LZMA Utils 4.42.0alphas drop the rest of the C++ LZMA SDK. The LZMA and
other included filters (algorithm implementations) are still directly
based on LZMA SDK, but ported to C.
The early versions of XZ Utils were called LZMA Utils. The first
releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK.
The code was still directly based on LZMA SDK but ported to C and
converted from callback API to stateful API. Later, Igor Pavlov made
C version of the LZMA encoder too; these ports from C++ to C were
independent in LZMA SDK and LZMA Utils.
liblzma is now the core of LZMA Utils. It has zlib-like API, which
doesn't suffer from the problems of the API of liblzmadec. liblzma
supports not only LZMA, but several other filters, which together
can improve compression ratio even further with certain file types.
The core of the new LZMA Utils was liblzma, a compression library with
zlib-like API. liblzma supported both the old and new file format. The
gzip-like lzma command line tool was rewritten to use liblzma.
The lzma and lzmadec command line tools have been rewritten. They uses
liblzma to do the actual compressing or uncompressing.
The new LZMA Utils code base was renamed to XZ Utils when the name
of the new file format had been decided. The liblzma compression
library retained its name though, because changing it would have
caused unnecessary breakage in applications already using the early
liblzma snapshots.
The development of LZMA Utils 4.42.x is still in alpha stage. Several
features are still missing or don't fully work yet. Documentation is
also very minimal.
The xz command line tool can emulate the gzip-like lzma tool by
creating appropriate symlinks (e.g. lzma -> xz). Thus, practically
all scripts using the lzma tool from LZMA Utils will work as is with
XZ Utils (and will keep using the old .lzma format). Still, the .lzma
format is more or less deprecated. XZ Utils will keep supporting it,
but new applications should use the .xz format, and migrating old
applications to .xz is often a good idea too.

View File

@@ -1,324 +0,0 @@
Advanced features of liblzma
----------------------------
0. Introduction
Most developers need only the basic features of liblzma. These
features allow single-threaded encoding and decoding of .lzma files
in streamed mode.
In some cases developers want more. The .lzma file format is
designed to allow multi-threaded encoding and decoding and limited
random-access reading. These features are possible in non-streamed
mode and limitedly also in streamed mode.
To take advange of these features, the application needs a custom
.lzma file format handler. liblzma provides a set of tools to ease
this task, but it's still quite a bit of work to get a good custom
.lzma handler done.
1. Where to begin
Start by reading the .lzma file format specification. Understanding
the basics of the .lzma file structure is required to implement a
custom .lzma file handler and to understand the rest of this document.
2. The basic components
2.1. Stream Header and tail
Stream Header begins the .lzma Stream and Stream tail ends it. Stream
Header is defined in the file format specification, but Stream tail
isn't (thus I write "tail" with a lower-case letter). Stream tail is
simply the Stream Flags and the Footer Magic Bytes fields together.
It was done this way in liblzma, because the Block coders take care
of the rest of the stuff in the Stream Footer.
For now, the size of Stream Header is fixed to 11 bytes. The header
<lzma/stream_flags.h> defines LZMA_STREAM_HEADER_SIZE, which you
should use instead of a hardcoded number. Similarly, Stream tail
is fixed to 3 bytes, and there is a constant LZMA_STREAM_TAIL_SIZE.
It is possible, that a future version of the .lzma format will have
variable-sized Stream Header and tail. As of writing, this seems so
unlikely though, that it was considered simplest to just use a
constant instead of providing a functions to get and store the sizes
of the Stream Header and tail.
2.x. Stream tail
For now, the size of Stream tail is fixed to 3 bytes. The header
<lzma/stream_flags.h> defines LZMA_STREAM_TAIL_SIZE, which you
should use instead of a hardcoded number.
3. Keeping track of size information
The lzma_info_* functions found from <lzma/info.h> should ease the
task of keeping track of sizes of the Blocks and also the Stream
as a whole. Using these functions is strongly recommended, because
there are surprisingly many situations where an error can occur,
and these functions check for possible errors every time some new
information becomes available.
If you find lzma_info_* functions lacking something that you would
find useful, please contact the author.
3.1. Start offset of the Stream
If you are storing the .lzma Stream inside anothe file format, or
for some other reason are placing the .lzma Stream to somewhere
else than to the beginning of the file, you should tell the starting
offset of the Stream using lzma_info_start_offset_set().
The start offset of the Stream is used for two distinct purporses.
First, knowing the start offset of the Stream allows
lzma_info_alignment_get() to correctly calculate the alignment of
every Block. This information is given to the Block encoder, which
will calculate the size of Header Padding so that Compressed Data
is alignment at an optimal offset.
Another use for start offset of the Stream is in random-access
reading. If you set the start offset of the Stream, lzma_info_locate()
will be able to calculate the offset relative to the beginning of the
file containing the Stream (instead of offset relative to the
beginning of the Stream).
3.2. Size of Stream Header
While the size of Stream Header is constant (11 bytes) in the current
version of the .lzma file format, this may change in future.
3.3. Size of Header Metadata Block
This information is needed when doing random-access reading, and
to verify the value of this field stored in Footer Metadata Block.
3.4. Total Size of the Data Blocks
3.5. Uncompressed Size of Data Blocks
3.6. Index
x. Alignment
There are a few slightly different types of alignment issues when
working with .lzma files.
The .lzma format doesn't strictly require any kind of alignment.
However, if the encoder carefully optimizes the alignment in all
situations, it can improve compression ratio, speed of the encoder
and decoder, and slightly help if the files get damaged and need
recovery.
Alignment has the most significant effect compression ratio FIXME
x.1. Compression ratio
Some filters take advantage of the alignment of the input data.
To get the best compression ratio, make sure that you feed these
filters correctly aligned data.
Some filters (e.g. LZMA) don't necessarily mind too much if the
input doesn't match the preferred alignment. With these filters
the penalty in compression ratio depends on the specific type of
data being compressed.
Other filters (e.g. PowerPC executable filter) won't work at all
with data that is improperly aligned. While the data can still
be de-filtered back to its original form, the benefit of the
filtering (better compression ratio) is completely lost, because
these filters expect certain patterns at properly aligned offsets.
The compression ratio may even worse with incorrectly aligned input
than without the filter.
x.1.1. Inter-filter alignment
When there are multiple filters chained, checking the alignment can
be useful not only with the input of the first filter and output of
the last filter, but also between the filters.
Inter-filter alignment important especially with the Subblock filter.
x.1.2. Further compression with external tools
This is relatively rare situation in practice, but still worth
understanding.
Let's say that there are several SPARC executables, which are each
filtered to separate .lzma files using only the SPARC filter. If
Uncompressed Size is written to the Block Header, the size of Block
Header may vary between the .lzma files. If no Padding is used in
the Block Header to correct the alignment, the starting offset of
the Compressed Data field will be differently aligned in different
.lzma files.
All these .lzma files are archived into a single .tar archive. Due
to nature of the .tar format, every file is aligned inside the
archive to an offset that is a multiple of 512 bytes.
The .tar archive is compressed into a new .lzma file using the LZMA
filter with options, that prefer input alignment of four bytes. Now
if the independent .lzma files don't have the same alignment of
the Compressed Data fields, the LZMA filter will be unable to take
advantage of the input alignment between the files in the .tar
archive, which reduces compression ratio.
Thus, even if you have only single Block per file, it can be good for
compression ratio to align the Compressed Data to optimal offset.
x.2. Speed
Most modern computers are faster when multi-byte data is located
at aligned offsets in RAM. Proper alignment of the Compressed Data
fields can slightly increase the speed of some filters.
x.3. Recovery
Aligning every Block Header to start at an offset with big enough
alignment may ease or at least speed up recovery of broken files.
y. Typical usage cases
y.x. Parsing the Stream backwards
You may need to parse the Stream backwards if you need to get
information such as the sizes of the Stream, Index, or Extra.
The basic procedure to do this follows.
Locate the end of the Stream. If the Stream is stored as is in a
standalone .lzma file, simply seek to the end of the file and start
reading backwards using appropriate buffer size. The file format
specification allows arbitrary amount of Footer Padding (zero or more
NUL bytes), which you skip before trying to decode the Stream tail.
Once you have located the end of the Stream (a non-NULL byte), make
sure you have at least the last LZMA_STREAM_TAIL_SIZE bytes of the
Stream in a buffer. If there isn't enough bytes left from the file,
the file is too small to contain a valid Stream. Decode the Stream
tail using lzma_stream_tail_decoder(). Store the offset of the first
byte of the Stream tail; you will need it later.
You may now want to do some internal verifications e.g. if the Check
type is supported by the liblzma build you are using.
Decode the Backward Size field with lzma_vli_reverse_decode(). The
field is at maximum of LZMA_VLI_BYTES_MAX bytes long. Check that
Backward Size is not zero. Store the offset of the first byte of
the Backward Size; you will need it later.
Now you know the Total Size of the last Block of the Stream. It's the
value of Backward Size plus the size of the Backward Size field. Note
that you cannot use lzma_vli_size() to calculate the size since there
might be padding; you need to use the real observed size of the
Backward Size field.
At this point, the operation continues differently for Single-Block
and Multi-Block Streams.
y.x.1. Single-Block Stream
There might be Uncompressed Size field present in the Stream Footer.
You cannot know it for sure unless you have already parsed the Block
Header earlier. For security reasons, you probably want to try to
decode the Uncompressed Size field, but you must not indicate any
error if decoding fails. Later you can give the decoded Uncompressed
Size to Block decoder if Uncopmressed Size isn't otherwise known;
this prevents it from producing too much output in case of (possibly
intentionally) corrupt file.
Calculate the the start offset of the Stream:
backward_offset - backward_size - LZMA_STREAM_HEADER_SIZE
backward_offset is the offset of the first byte of the Backward Size
field. Remember to check for integer overflows, which can occur with
invalid input files.
Seek to the beginning of the Stream. Decode the Stream Header using
lzma_stream_header_decoder(). Verify that the decoded Stream Flags
match the values found from Stream tail. You can use the
lzma_stream_flags_is_equal() macro for this.
Decode the Block Header. Verify that it isn't a Metadata Block, since
Single-Block Streams cannot have Metadata. If Uncompressed Size is
present in the Block Header, the value you tried to decode from the
Stream Footer must be ignored, since Uncompressed Size wasn't actually
present there. If Block Header doesn't have Uncompressed Size, and
decoding the Uncompressed Size field from the Stream Footer failed,
the file is corrupt.
If you were only looking for the Uncompressed Size of the Stream,
you now got that information, and you can stop processing the Stream.
To decode the Block, the same instructions apply as described in
FIXME. However, because you have some extra known information decoded
from the Stream Footer, you should give this information to the Block
decoder so that it can verify it while decoding:
- If Uncompressed Size is not present in the Block Header, set
lzma_options_block.uncompressed_size to the value you decoded
from the Stream Footer.
- Always set lzma_options_block.total_size to backward_size +
size_of_backward_size (you calculated this sum earlier already).
y.x.2. Multi-Block Stream
Calculate the start offset of the Footer Metadata Block:
backward_offset - backward_size
backward_offset is the offset of the first byte of the Backward Size
field. Remember to check for integer overflows, which can occur with
broken input files.
Decode the Block Header. Verify that it is a Metadata Block. Set
lzma_options_block.total_size to backward_size + size_of_backward_size
(you calculated this sum earlier already). Then decode the Footer
Metadata Block.
Store the decoded Footer Metadata to lzma_info structure using
lzma_info_set_metadata(). Set also the offset of the Backward Size
field using lzma_info_size_set(). Then you can get the start offset
of the Stream using lzma_info_size_get(). Note that any of these steps
may fail so don't omit error checking.
Seek to the beginning of the Stream. Decode the Stream Header using
lzma_stream_header_decoder(). Verify that the decoded Stream Flags
match the values found from Stream tail. You can use the
lzma_stream_flags_is_equal() macro for this.
If you were only looking for the Uncompressed Size of the Stream,
it's possible that you already have it now. If Uncompressed Size (or
whatever information you were looking for) isn't available yet,
continue by decoding also the Header Metadata Block. (If some
information is missing, the Header Metadata Block has to be present.)
Decoding the Data Blocks goes the same way as described in FIXME.
y.x.3. Variations
If you know the offset of the beginning of the Stream, you may want
to parse the Stream Header before parsing the Stream tail.

View File

@@ -1,112 +0,0 @@
Hacking liblzma
---------------
0. Preface
This document gives some overall information about the internals of
liblzma, which should make it easier to start reading and modifying
the code.
1. Programming language
liblzma was written in C99. If you use GCC, this means that you need
at least GCC 3.x.x. GCC 2 isn't and won't be supported.
Some GCC-specific extensions are used *conditionally*. They aren't
required to build a full-featured library. Don't make the code rely
on any non-standard compiler extensions or even C99 features that
aren't portable between almost-C99 compatible compilers (for example
non-static inlines).
The public API headers are in C89. This is to avoid frustrating those
who maintain programs, which are strictly in C89 or C++.
An assumption about sizeof(size_t) is made. If this assumption is
wrong, some porting is probably needed:
sizeof(uint32_t) <= sizeof(size_t) <= sizeof(uint64_t)
2. Internal vs. external API
Input Output
v Application ^
| liblzma public API |
| Stream coder |
| Block coder |
| Filter coder |
| ... |
v Filter coder ^
Application
`-- liblzma public API
`-- Stream coder
|-- Stream info handler
|-- Stream Header coder
|-- Block Header coder
| `-- Filter Flags coder
|-- Metadata coder
| `-- Block coder
| `-- Filter 0
| `-- Filter 1
| ...
|-- Data Block coder
| `-- Filter 0
| `-- Filter 1
| ...
`-- Stream tail coder
x. Designing new filters
All filters must be designed so that the decoder cannot consume
arbitrary amount input without producing any decoded output. Failing
to follow this rule makes liblzma vulnerable to DoS attacks if
untrusted files are decoded (usually they are untrusted).
An example should clarify the reason behind this requirement: There
are two filters in the chain. The decoder of the first filter produces
huge amount of output (many gigabytes or more) with a few bytes of
input, which gets passed to the decoder of the second filter. If the
data passed to the second filter is interpreted as something that
produces no output (e.g. padding), the filter chain as a whole
produces no output and consumes no input for a long period of time.
The above problem was present in the first versions of the Subblock
filter. A tiny .lzma file could have taken several years to decode
while it wouldn't produce any output at all. The problem was fixed
by adding limits for number of consecutive Padding bytes, and requiring
that some decoded output must be produced between Set Subfilter and
Unset Subfilter.
x. Implementing new filters
If the filter supports embedding End of Payload Marker, make sure that
when your filter detects End of Payload Marker,
- the usage of End of Payload Marker is actually allowed (i.e. End
of Input isn't used); and
- it also checks that there is no more input coming from the next
filter in the chain.
The second requirement is slightly tricky. It's possible that the next
filter hasn't returned LZMA_STREAM_END yet. It may even need a few
bytes more input before it will do so. You need to give it as much
input as it needs, and verify that it doesn't produce any output.
Don't call the next filter in the chain after it has returned
LZMA_STREAM_END (except in encoder if action == LZMA_SYNC_FLUSH).
It will result undefined behavior.
Be pedantic. If the input data isn't exactly valid, reject it.
At the moment, liblzma isn't modular. You will need to edit several
files in src/liblzma/common to include support for a new filter. grep
for LZMA_FILTER_LZMA to locate the files needing changes.

View File

@@ -1,188 +0,0 @@
Introduction to liblzma
-----------------------
Writing applications to work with liblzma
liblzma API is split in several subheaders to improve readability and
maintainance. The subheaders must not be #included directly; simply
use `#include <lzma.h>' instead.
Those who have used zlib should find liblzma's API easy to use.
To developers who haven't used zlib before, I recommend learning
zlib first, because zlib has excellent documentation.
While the API is similar to that of zlib, there are some major
differences, which are summarized below.
For basic stream encoding, zlib has three functions (deflateInit(),
deflate(), and deflateEnd()). Similarly, there are three functions
for stream decoding (inflateInit(), inflate(), and inflateEnd()).
liblzma has only single coding and ending function. Thus, to
encode one may use, for example, lzma_stream_encoder_single(),
lzma_code(), and lzma_end(). Simlarly for decoding, one may
use lzma_auto_decoder(), lzma_code(), and lzma_end().
zlib has deflateReset() and inflateReset() to reset the stream
structure without reallocating all the memory. In liblzma, all
coder initialization functions are like zlib's reset functions:
the first-time initializations are done with the same functions
as the reinitializations (resetting).
To make all this work, liblzma needs to know when lzma_stream
doesn't already point to an allocated and initialized coder.
This is achieved by initializing lzma_stream structure with
LZMA_STREAM_INIT (static initialization) or LZMA_STREAM_INIT_VAR
(for exampple when new lzma_stream has been allocated with malloc()).
This initialization should be done exactly once per lzma_stream
structure to avoid leaking memory. Calling lzma_end() will leave
lzma_stream into a state comparable to the state achieved with
LZMA_STREAM_INIT and LZMA_STREAM_INIT_VAR.
Example probably clarifies a lot. With zlib, compression goes
roughly like this:
z_stream strm;
deflateInit(&strm, level);
deflate(&strm, Z_RUN);
deflate(&strm, Z_RUN);
...
deflate(&strm, Z_FINISH);
deflateEnd(&strm) or deflateReset(&strm)
With liblzma, it's slightly different:
lzma_stream strm = LZMA_STREAM_INIT;
lzma_stream_encoder_single(&strm, &options);
lzma_code(&strm, LZMA_RUN);
lzma_code(&strm, LZMA_RUN);
...
lzma_code(&strm, LZMA_FINISH);
lzma_end(&strm) or reinitialize for new coding work
Reinitialization in the last step can be any function that can
initialize lzma_stream; it doesn't need to be the same function
that was used for the previous initialization. If it is the same
function, liblzma will usually be able to re-use most of the
existing memory allocations (depends on how much the initialization
options change). If you reinitialize with different function,
liblzma will automatically free the memory of the previous coder.
File formats
liblzma supports multiple container formats for the compressed data.
Different initialization functions initialize the lzma_stream to
process different container formats. See the details from the public
header files.
The following functions are the most commonly used:
- lzma_stream_encoder_single(): Encodes Single-Block Stream; this
the recommended format for most purporses.
- lzma_alone_encoder(): Useful if you need to encode into the
legacy LZMA_Alone format.
- lzma_auto_decoder(): Decoder that automatically detects the
file format; recommended when you decode compressed files on
disk, because this way compatibility with the legacy LZMA_Alone
format is transparent.
- lzma_stream_decoder(): Decoder for Single- and Multi-Block
Streams; this is good if you want to accept only .lzma Streams.
Filters
liblzma supports multiple filters (algorithm implementations). The new
.lzma format supports filter-chain having up to seven filters. In the
filter chain, the output of one filter is input of the next filter in
the chain. The legacy LZMA_Alone format supports only one filter, and
that must always be LZMA.
General-purporse compression:
LZMA The main algorithm of liblzma (surprise!)
Branch/Call/Jump filters for executables:
x86 This filter is known as BCJ in 7-Zip
IA64 IA-64 (Itanium)
PowerPC Big endian PowerPC
ARM
ARM-Thumb
SPARC
Other filters:
Copy Dummy filter that simply copies all the data
from input to output.
Subblock Multi-purporse filter, that can
- embed End of Payload Marker if the previous
filter in the chain doesn't support it; and
- apply Subfilters, which filter only part
of the same compressed Block in the Stream.
Branch/Call/Jump filters never change the size of the data. They
should usually be used as a pre-filter for some compression filter
like LZMA.
Integrity checks
The .lzma Stream format uses CRC32 as the integrity check for
different file format headers. It is possible to omit CRC32 from
the Block Headers, but not from Stream Header. This is the reason
why CRC32 code cannot be disabled when building liblzma (in addition,
the LZMA encoder uses CRC32 for hashing, so that's another reason).
The integrity check of the actual data is calculated from the
uncompressed data. This check can be CRC32, CRC64, or SHA256.
It can also be omitted completely, although that usually is not
a good thing to do. There are free IDs left, so support for new
checks algorithms can be added later.
API and ABI stability
The API and ABI of liblzma isn't stable yet, although no huge
changes should happen. One potential place for change is the
lzma_options_subblock structure.
In the 4.42.0alpha phase, the shared library version number won't
be updated even if ABI breaks. I don't want to track the ABI changes
yet. Just rebuild everything when you upgrade liblzma until we get
to the beta stage.
Size of the library
While liblzma isn't huge, it is quite far from the smallest possible
LZMA implementation: full liblzma binary (with support for all
filters and other features) is way over 100 KiB, but the plain raw
LZMA decoder is only 5-10 KiB.
To decrease the size of the library, you can omit parts of the library
by passing certain options to the `configure' script. Disabling
everything but the decoders of the require filters will usually give
you a small enough library, but if you need a decoder for example
embedded in the operating system kernel, the code from liblzma probably
isn't suitable as is.
If you need a minimal implementation supporting .lzma Streams, you
may need to do partial rewrite. liblzma uses stateful API like zlib.
That increases the size of the library. Using callback API or even
simpler buffer-to-buffer API would allow smaller implementation.
LZMA SDK contains smaller LZMA decoder written in ANSI-C than
liblzma, so you may want to take a look at that code. However,
it doesn't (at least not yet) support the new .lzma Stream format.
Documentation
There's no other documentation than the public headers and this
text yet. Real docs will be written some day, I hope.

View File

@@ -1,219 +0,0 @@
Using liblzma securely
----------------------
0. Introduction
This document discusses how to use liblzma securely. There are issues
that don't apply to zlib or libbzip2, so reading this document is
strongly recommended even for those who are very familiar with zlib
or libbzip2.
While making liblzma itself as secure as possible is essential, it's
out of scope of this document.
1. Memory usage
The memory usage of liblzma varies a lot.
1.1. Problem sources
1.1.1. Block coder
The memory requirements of Block encoder depend on the used filters
and their settings. The memory requirements of the Block decoder
depend on the which filters and with which filter settings the Block
was encoded. Usually the memory requirements of a decoder are equal
or less than the requirements of the encoder with the same settings.
While the typical memory requirements to decode a Block is from a few
hundred kilobytes to tens of megabytes, a maliciously constructed
files can require a lot more RAM to decode. With the current filters,
the maximum amount is about 7 GiB. If you use multi-threaded decoding,
every Block can require this amount of RAM, thus a four-threaded
decoder could suddenly try to allocate 28 GiB of RAM.
If you don't limit the maximum memory usage in any way, and there are
no resource limits set on the operating system side, one malicious
input file can run the system out of memory, or at least make it swap
badly for a long time. This is exceptionally bad on servers e.g.
email server doing virus scanning on incoming messages.
1.1.2. Metadata decoder
Multi-Block .lzma files contain at least one Metadata Block.
Externally the Metadata Blocks are similar to Data Blocks, so all
the issues mentioned about memory usage of Data Blocks applies to
Metadata Blocks too.
The uncompressed content of Metadata Blocks contain information about
the Stream as a whole, and optionally some Extra Records. The
information about the Stream is kept in liblzma's internal data
structures in RAM. Extra Records can contain arbitrary data. They are
not interpreted by liblzma, but liblzma will provide them to the
application in uninterpreted form if the application wishes so.
Usually the Uncompressed Size of a Metadata Block is small. Even on
extreme cases, it shouldn't be much bigger than a few megabytes. Once
the Metadata has been parsed into native data structures in liblzma,
it usually takes a little more memory than in the encoded form. For
all normal files, this is no problem, since the resulting memory usage
won't be too much.
The problem is that a maliciously constructed Metadata Block can
contain huge amount of "information", which liblzma will try to store
in its internal data structures. This may cause liblzma to allocate
all the available RAM unless some kind of resource usage limits are
applied.
Note that the Extra Records in Metadata are always parsed but, but
memory is allocated for them only if the application has requested
liblzma to provide the Extra Records to the application.
1.2. Solutions
If you need to decode files from untrusted sources (most people do),
you must limit the memory usage to avoid denial of service (DoS)
conditions caused by malicious input files.
The first step is to find out how much memory you are allowed consume
at maximum. This may be a hardcoded constant or derived from the
available RAM; whatever is appropriate in the application.
The simplest solution is to use setrlimit() if the kernel supports
RLIMIT_AS, which limits the memory usage of the whole process.
For more portable and fine-grained limitting, you can use
memory limitter functions found from <lzma/memlimit.h>.
1.2.1. Encoder
lzma_memory_usage() will give you a rough estimate about the memory
usage of the given filter chain. To dramatically simplify the internal
implementation, this function doesn't take into account all the small
helper data structures needed in various places; only the structures
with significant memory usage are taken into account. Still, the
accuracy of this function should be well within a mebibyte.
The Subblock filter is a special case. If a Subfilter has been
specified, it isn't taken into account when lzma_memory_usage()
calculates the memory usage. You need to calculate the memory usage
of the Subfilter separately.
Keeping track of Blocks in a Multi-Block Stream takes a few dozen
bytes of RAM per Block (size of the lzma_index structure plus overhead
of malloc()). It isn't a good idea to put tens of thousands of Blocks
into a Stream unless you have a very good reason to do so (compressed
dictionary could be an example of such situation).
Also keep the number and sizes of Extra Records sane. If you produce
the list of Extra Records automatically from some untrusted source,
you should not only validate the content of these Records, but also
their memory usage.
1.2.2. Decoder
A single-threaded decoder should simply use a memory limitter and
indicate an error if it runs out of memory.
Memory-limitting with multi-threaded decoding is tricky. The simple
solution is to divide the maximum allowed memory usage with the
maximum allowed threads, and give each Block decoder their own
independent lzma_memory_limitter. The drawback is that if one Block
needs notably more RAM than any other Block, the decoder will run out
of memory when in reality there would be plenty of free RAM.
An attractive alternative would be using shared lzma_memory_limitter.
Depending on the application and the expected type of input, this may
either be the best solution or a source of hard-to-repeat problems.
Consider the following requirements:
- You use at maximum of n threads.
- x(i) is the decoder memory requirements of the Block number i
in an expected input Stream.
- The memory limitter is set to higher value than the sum of n
highest values x(i).
(If you are better at explaining the above conditions, please
contribute your improved version.)
If the above conditions aren't met, it is possible that the decoding
will fail unpredictably. That is, on the same machine using the same
settings, the decoding may sometimes succeed and sometimes fail. This
is because sometimes threads may run so that the Blocks with highest
memory usage are tried to be decoded at the same time.
Most .lzma files have all the Blocks encoded with identical settings,
or at least the memory usage won't vary dramatically. That's why most
multi-threaded decoders probably want to use the simple "separate
lzma_memory_limitter for each thread" solution, possibly fallbacking
to single-threaded mode in case the per-thread memory limits aren't
enough in multi-threaded mode.
FIXME: Memory usage of Stream info.
[
]
2. Huge uncompressed output
2.1. Data Blocks
Decoding a tiny .lzma file can produce huge amount of uncompressed
output. There is an example file of 45 bytes, which decodes to 64 PiB
(that's 2^56 bytes). Uncompressing such a file to disk is likely to
fill even a bigger disk array. If the data is written to a pipe, it
may not fill the disk, but would still take very long time to finish.
To avoid denial of service conditions caused by huge amount of
uncompressed output, applications using liblzma should use some method
to limit the amount of output produced. The exact method depends on
the application.
All valid .lzma Streams make it possible to find out the uncompressed
size of the Stream without actually uncompressing the data. This
information is available in at least one of the Metadata Blocks.
Once the uncompressed size is parsed, the decoder can verify that
it doesn't exceed certain limits (e.g. available disk space).
When the uncompressed size is known, the decoder can actively keep
track of the amount of output produced so far, and that it doesn't
exceed the known uncompressed size. If it does exceed, the file is
known to be corrupt and an error should be indicated without
continuing to decode the rest of the file.
Unfortunately, finding the uncompressed size beforehand is often
possible only in non-streamed mode, because the needed information
could be in the Footer Metdata Block, which (obviously) is at the
end of the Stream. In purely streamed mode decoding, one may need to
use some rough arbitrary limits to prevent the problems described in
the beginning of this section.
2.2. Metadata
Metadata is stored in Metadata Blocks, which are very similar to
Data Blocks. Thus, the uncompressed size can be huge just like with
Data Blocks. The difference is, that the contents of Metadata Blocks
aren't given to the application as is, but parsed by liblzma. Still,
reading through a huge Metadata can take very long time, effectively
creating a denial of service like piping decoded a Data Block to
another process would do.
At first it would seem that using a memory limitter would prevent
this issue as a side effect. But it does so only if the application
requests liblzma to allocate the Extra Records and provide them to
the application. If Extra Records aren't requested, they aren't
allocated either. Still, the Extra Records are being read through
to validate that the Metadata is in proper format.
The solution is to limit the Uncompressed Size of a Metadata Block
to some relatively large value. This will make liblzma to give an
error when the given limit is reached.

166
doc/lzma-file-format.txt Normal file
View File

@@ -0,0 +1,166 @@
The .lzma File Format
=====================
0. Preface
0.1. Notices and Acknowledgements
0.2. Changes
1. File Format
1.1. Header
1.1.1. Properties
1.1.2. Dictionary Size
1.1.3. Uncompressed Size
1.2. LZMA Compressed Data
2. References
0. Preface
This document describes the .lzma file format, which is
sometimes also called LZMA_Alone format. It is a legacy file
format, which is being or has been replaced by the .xz format.
The MIME type of the .lzma format is `application/x-lzma'.
The most commonly used software to handle .lzma files are
LZMA SDK, LZMA Utils, 7-Zip, and XZ Utils. This document
describes some of the differences between these implementations
and gives hints what subset of the .lzma format is the most
portable.
0.1. Notices and Acknowledgements
This file format was designed by Igor Pavlov for use in
LZMA SDK. This document was written by Lasse Collin
<lasse.collin@tukaani.org> using the documentation found
from the LZMA SDK.
This document has been put into the public domain.
0.2. Changes
Last modified: 2009-05-01 11:15+0300
1. File Format
+-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+
| Header | LZMA Compressed Data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+
The .lzma format file consist of 13-byte Header followed by
the LZMA Compressed Data.
Unlike the .gz, .bz2, and .xz formats, it is not possible to
concatenate multiple .lzma files as is and expect the
decompression tool to decode the resulting file as if it were
a single .lzma file.
For example, the command line tools from LZMA Utils and
LZMA SDK silently ignore all the data after the first .lzma
stream. In contrast, the command line tool from XZ Utils
considers the .lzma file to be corrupt if there is data after
the first .lzma stream.
1.1. Header
+------------+----+----+----+----+--+--+--+--+--+--+--+--+
| Properties | Dictionary Size | Uncompressed Size |
+------------+----+----+----+----+--+--+--+--+--+--+--+--+
1.1.1. Properties
The Properties field contains three properties. An abbreviation
is given in parentheses, followed by the value range of the
property. The field consists of
1) the number of literal context bits (lc, [0, 8]);
2) the number of literal position bits (lp, [0, 4]); and
3) the number of position bits (pb, [0, 4]).
The properties are encoded using the following formula:
Properties = (pb * 5 + lp) * 9 + lc
The following C code illustrates a straightforward way to
decode the Properties field:
uint8_t lc, lp, pb;
uint8_t prop = get_lzma_properties();
if (prop > (4 * 5 + 4) * 9 + 8)
return LZMA_PROPERTIES_ERROR;
pb = prop / (9 * 5);
prop -= pb * 9 * 5;
lp = prop / 9;
lc = prop - lp * 9;
XZ Utils has an additional requirement: lc + lp <= 4. Files
which don't follow this requirement cannot be decompressed
with XZ Utils. Usually this isn't a problem since the most
common lc/lp/pb values are 3/0/2. It is the only lc/lp/pb
combination that the files created by LZMA Utils can have,
but LZMA Utils can decompress files with any lc/lp/pb.
1.1.2. Dictionary Size
Dictionary Size is stored as an unsigned 32-bit little endian
integer. Any 32-bit value is possible, but for maximum
portability, only sizes of 2^n and 2^n + 2^(n-1) should be
used.
LZMA Utils creates only files with dictionary size 2^n,
16 <= n <= 25. LZMA Utils can decompress files with any
dictionary size.
XZ Utils creates and decompresses .lzma files only with
dictionary sizes 2^n and 2^n + 2^(n-1). If some other
dictionary size is specified when compressing, the value
stored in the Dictionary Size field is a rounded up, but the
specified value is still used in the actual compression code.
1.1.3. Uncompressed Size
Uncompressed Size is stored as unsigned 64-bit little endian
integer. A special value of 0xFFFF_FFFF_FFFF_FFFF indicates
that Uncompressed Size is unknown. End of Payload Marker (*)
is used if and only if Uncompressed Size is unknown.
XZ Utils rejects files whose Uncompressed Size field specifies
a known size that is 256 GiB or more. This is to reject false
positives when trying to guess if the input file is in the
.lzma format. When Uncompressed Size is unknown, there is no
limit for the uncompressed size of the file.
(*) Some tools use the term End of Stream (EOS) marker
instead of End of Payload Marker.
1.2. LZMA Compressed Data
Detailed description of the format of this field is out of
scope of this document.
2. References
LZMA SDK - The original LZMA implementation
http://7-zip.org/sdk.html
7-Zip
http://7-zip.org/
LZMA Utils - LZMA adapted to POSIX-like systems
http://tukaani.org/lzma/
XZ Utils - The next generation of LZMA Utils
http://tukaani.org/xz/
The .xz file format - The successor of the the .lzma format
http://tukaani.org/xz/xz-file-format.txt

View File

@@ -1,107 +0,0 @@
Introduction to the lzma command line tool
------------------------------------------
Overview
The lzma command line tool is similar to gzip and bzip2, but for
compressing and uncompressing .lzma files.
Supported file formats
By default, the tool creates files in the new .lzma format. This can
be overriden with --format=FMT command line option. Use --format=alone
to create files in the old LZMA_Alone format.
By default, the tool uncompresses both the new .lzma format and
LZMA_Alone format. This is to make it transparent to switch from
the old LZMA_Alone format to the new .lzma format. Since both
formats use the same filename suffix, average user should never
notice which format was used.
Differences to gzip and bzip2
Standard input and output
Both gzip and bzip2 refuse to write compressed data to a terminal and
read compressed data from a terminal. With gzip (but not with bzip2),
this can be overriden with the `--force' option. lzma follows the
behavior of gzip here.
Usage of LZMA_OPT environment variable
gzip and bzip2 read GZIP and BZIP2 environment variables at startup.
These variables may contain extra command line options.
gzip and bzip2 allow passing not only options, but also end-of-options
indicator (`--') and filenames via the environment variable. No quoting
is supported with the filenames.
Here are examples with gzip. bzip2 behaves identically.
bash$ echo asdf > 'foo bar'
bash$ GZIP='"foo bar"' gzip
gzip: "foo: No such file or directory
gzip: bar": No such file or directory
bash$ GZIP=-- gzip --help
gzip: --help: No such file or directory
lzma silently ignores all non-option arguments given via the
environment variable LZMA_OPT. Like on the command line, everything
after `--' is taken as non-options, and thus ignored in LZMA_OPT.
bash$ LZMA_OPT='--help' lzma --version # Displays help
bash$ LZMA_OPT='-- --help' lzma --version # Displays version
Filter chain presets
Like in gzip and bzip2, lzma supports numbered presets from 1 to 9
where 1 is the fastest and 9 the best compression. 1 and 2 are for
fast compressing with small memory usage, 3 to 6 for good compression
ratio with medium memory usage, and 7 to 9 for excellent compression
ratio with higher memory requirements. The default is 7 if memory
usage limit allows.
In future, there will probably be an option like --preset=NAME, which
will contain more special presets for specific file types.
It's also possible that there will be some heuristics to select good
filters. For example, the tool could detect when a .tar archive is
being compressed, and enable x86 filter only for those files in the
.tar archive that are ELF or PE executables for x86.
Specifying custom filter chains
Custom filter chains are specified by using long options with the name
of the filters in correct order. For example, to pass the input data to
the x86 filter and the output of that to the LZMA filter, the following
command will do:
lzma --x86 --lzma filename
Some filters accept options, which are specified as a comma-separated
list of key=value pairs:
lzma --delta=distance=4 --lzma=dict=4Mi,lc=8,lp=2 filename
Memory usage control
By default, the command line tool limits memory usage to 1/3 of the
available physical RAM. If no preset or custom filter chain has been
given, the default preset will be used. If the memory limit is too
low for the default preset, the tool will silently switch to lower
preset.
When a preset or a custom filter chain has been specified and the
memory limit is too low, an error message is displayed and no files
are processed.
If the decoder hits the memory usage limit, an error is displayed and
no more files are processed.

1150
doc/xz-file-format.txt Normal file

File diff suppressed because it is too large Load Diff

146
dos/Makefile Normal file
View File

@@ -0,0 +1,146 @@
###############################################################################
#
# Makefile to build XZ Utils using DJGPP
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
# For debugging, set comment "#define NDEBUG 1" from config.h to enable
# the assert() macro, set STRIP=rem to disable stripping, and finally
# e.g. CFLAGS="-g -O0".
CC = gcc
STRIP = strip
CPPFLAGS =
CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
LDFLAGS =
# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC >= 4.3.0
# because time.h uses GNU-style "extern inline".
ALL_CFLAGS = -std=gnu99 -fgnu89-inline
ALL_CPPFLAGS = \
-I. \
-I../lib \
-I../src/common \
-I../src/liblzma/api \
-I../src/liblzma/common \
-I../src/liblzma/check \
-I../src/liblzma/rangecoder \
-I../src/liblzma/lz \
-I../src/liblzma/lzma \
-I../src/liblzma/delta \
-I../src/liblzma/simple \
-DHAVE_CONFIG_H
ALL_CPPFLAGS += $(CPPFLAGS)
ALL_CFLAGS += $(CFLAGS)
.PHONY: all
all: xz.exe
SRCS_C = \
../lib/getopt.c \
../lib/getopt1.c \
../src/common/tuklib_cpucores.c \
../src/common/tuklib_exit.c \
../src/common/tuklib_mbstr_fw.c \
../src/common/tuklib_mbstr_width.c \
../src/common/tuklib_open_stdxxx.c \
../src/common/tuklib_physmem.c \
../src/common/tuklib_progname.c \
../src/liblzma/check/check.c \
../src/liblzma/check/crc32_table.c \
../src/liblzma/check/crc64_table.c \
../src/liblzma/check/sha256.c \
../src/liblzma/common/alone_decoder.c \
../src/liblzma/common/alone_encoder.c \
../src/liblzma/common/block_decoder.c \
../src/liblzma/common/block_encoder.c \
../src/liblzma/common/block_header_decoder.c \
../src/liblzma/common/block_header_encoder.c \
../src/liblzma/common/block_util.c \
../src/liblzma/common/common.c \
../src/liblzma/common/filter_common.c \
../src/liblzma/common/filter_decoder.c \
../src/liblzma/common/filter_encoder.c \
../src/liblzma/common/filter_flags_decoder.c \
../src/liblzma/common/filter_flags_encoder.c \
../src/liblzma/common/hardware_physmem.c \
../src/liblzma/common/index.c \
../src/liblzma/common/index_decoder.c \
../src/liblzma/common/index_encoder.c \
../src/liblzma/common/index_hash.c \
../src/liblzma/common/stream_decoder.c \
../src/liblzma/common/stream_encoder.c \
../src/liblzma/common/stream_flags_common.c \
../src/liblzma/common/stream_flags_decoder.c \
../src/liblzma/common/stream_flags_encoder.c \
../src/liblzma/common/vli_decoder.c \
../src/liblzma/common/vli_encoder.c \
../src/liblzma/common/vli_size.c \
../src/liblzma/delta/delta_common.c \
../src/liblzma/delta/delta_decoder.c \
../src/liblzma/delta/delta_encoder.c \
../src/liblzma/lz/lz_decoder.c \
../src/liblzma/lz/lz_encoder.c \
../src/liblzma/lz/lz_encoder_mf.c \
../src/liblzma/lzma/fastpos_table.c \
../src/liblzma/lzma/lzma2_decoder.c \
../src/liblzma/lzma/lzma2_encoder.c \
../src/liblzma/lzma/lzma_decoder.c \
../src/liblzma/lzma/lzma_encoder.c \
../src/liblzma/lzma/lzma_encoder_optimum_fast.c \
../src/liblzma/lzma/lzma_encoder_optimum_normal.c \
../src/liblzma/lzma/lzma_encoder_presets.c \
../src/liblzma/rangecoder/price_table.c \
../src/liblzma/simple/arm.c \
../src/liblzma/simple/armthumb.c \
../src/liblzma/simple/ia64.c \
../src/liblzma/simple/powerpc.c \
../src/liblzma/simple/simple_coder.c \
../src/liblzma/simple/simple_decoder.c \
../src/liblzma/simple/simple_encoder.c \
../src/liblzma/simple/sparc.c \
../src/liblzma/simple/x86.c \
../src/xz/args.c \
../src/xz/coder.c \
../src/xz/file_io.c \
../src/xz/hardware.c \
../src/xz/list.c \
../src/xz/main.c \
../src/xz/message.c \
../src/xz/options.c \
../src/xz/signals.c \
../src/xz/suffix.c \
../src/xz/util.c
SRCS_ASM = \
../src/liblzma/check/crc32_x86.S \
../src/liblzma/check/crc64_x86.S
OBJS_C = $(SRCS_C:.c=.o)
OBJS_ASM = $(SRCS_ASM:.S=.o)
OBJS = $(OBJS_C) $(OBJS_ASM)
getopt.h:
update ../lib/getopt.in.h getopt.h
$(OBJS): getopt.h
$(OBJS_C): %.o: %.c
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
$(OBJS_ASM): %.o: %.S
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
# Make xz.exe not depend on an external DPMI server.
xz.exe: $(OBJS)
$(CC) $(ALL_CFLAGS) $(OBJS) $(LDFLAGS) -o $@
$(STRIP) --strip-all $@
exe2coff $@
del $@
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
del $(@:.exe=)

88
dos/README Normal file
View File

@@ -0,0 +1,88 @@
XZ Utils on DOS
===============
Introduction
This document explains how to build XZ Utils for DOS using DJGPP.
The resulting binaries should run at least on various DOS versions
and under Windows 95/98/98SE/ME, although the Windows version of
XZ Utils is recommended under Windows 95 and later.
This is currently experimental and has got very little testing.
Note: Makefile and config.h are updated only now and then. This
means that especially if you checked out a development version,
building for DOS probably won't work without updating Makefile
and config.h first.
Getting and Installing DJGPP
You may use <http://www.delorie.com/djgpp/zip-picker.html> to help
deciding what to download, but as of writing (2010-10-09) that may
not be the most convenient way taking into account what components
are actually required to build XZ Utils. However, using the
zip-picker can still be worth doing to get nice short summary of
installation instructions (they can be found from readme.1st too).
For a more manual method, first select a mirror from
<http://www.delorie.com/djgpp/getting.html>. You need
the following files:
unzip32.exe (if you don't already have a LFN-capable unzipper)
beta/v2/djdev204.zip
v2gnu/bnu219b.zip
v2gnu/gcc444b.zip
v2gnu/mak3791b.zip
v2misc/csdpmi7b.zip
If newer versions are available, probably you should try them first.
Note that djdev203.zip is too old to build XZ Utils; you need at
least djdev204.zip. Also note that you want csdpmi7b.zip even if you
run under Windows or DOSEMU, because the XZ Utils Makefile will embed
cwsdstub.exe to the resulting binaries.
See the instructions in readme.1st found from djdev204.zip. Here's
a short summary, but you should still read readme.1st.
C:\> mkdir DJGPP
C:\> cd DJGPP
C:\DJGPP> c:\download\unzip32 c:\download\djdev204.zip
C:\DJGPP> c:\download\unzip32 c:\download\bnu219b.zip
C:\DJGPP> c:\download\unzip32 c:\download\gcc444b.zip
C:\DJGPP> c:\download\unzip32 c:\download\mak3791b.zip
C:\DJGPP> c:\download\unzip32 c:\download\csdpmi7b.zip
C:\DJGPP> set PATH=C:\DJGPP\BIN;%PATH%
C:\DJGPP> set DJGPP=C:\DJGPP\DJGPP.ENV
You may want to add the last two lines into AUTOEXEC.BAT or have,
for example, DJGPP.BAT which you can run before using DJGPP.
Make sure you use completely upper case path in the DJGPP environment
variable. This is not required by DJGPP, but the XZ Utils Makefile is
a bit stupid and expects that everything in DJGPP environment variable
is uppercase.
Building
You need to have an environment that supports long filenames (LFN).
Once you have built XZ Utils, the resulting binaries can be run
without long filename support.
Run "make" in this directory (the directory containing this README).
You should get xz.exe (and a bunch of temporary files). Other tools
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.

130
dos/config.h Normal file
View File

@@ -0,0 +1,130 @@
/* How many MiB of RAM to assume if the real amount cannot be determined. */
#define ASSUME_RAM 32
/* Define to 1 if crc32 integrity check is enabled. */
#define HAVE_CHECK_CRC32 1
/* Define to 1 if crc64 integrity check is enabled. */
#define HAVE_CHECK_CRC64 1
/* Define to 1 if sha256 integrity check is enabled. */
#define HAVE_CHECK_SHA256 1
/* Define to 1 if arm decoder is enabled. */
#define HAVE_DECODER_ARM 1
/* Define to 1 if armthumb decoder is enabled. */
#define HAVE_DECODER_ARMTHUMB 1
/* Define to 1 if delta decoder is enabled. */
#define HAVE_DECODER_DELTA 1
/* Define to 1 if ia64 decoder is enabled. */
#define HAVE_DECODER_IA64 1
/* Define to 1 if lzma1 decoder is enabled. */
#define HAVE_DECODER_LZMA1 1
/* Define to 1 if lzma2 decoder is enabled. */
#define HAVE_DECODER_LZMA2 1
/* Define to 1 if powerpc decoder is enabled. */
#define HAVE_DECODER_POWERPC 1
/* Define to 1 if sparc decoder is enabled. */
#define HAVE_DECODER_SPARC 1
/* Define to 1 if x86 decoder is enabled. */
#define HAVE_DECODER_X86 1
/* Define to 1 if arm encoder is enabled. */
#define HAVE_ENCODER_ARM 1
/* Define to 1 if armthumb encoder is enabled. */
#define HAVE_ENCODER_ARMTHUMB 1
/* Define to 1 if delta encoder is enabled. */
#define HAVE_ENCODER_DELTA 1
/* Define to 1 if ia64 encoder is enabled. */
#define HAVE_ENCODER_IA64 1
/* Define to 1 if lzma1 encoder is enabled. */
#define HAVE_ENCODER_LZMA1 1
/* Define to 1 if lzma2 encoder is enabled. */
#define HAVE_ENCODER_LZMA2 1
/* Define to 1 if powerpc encoder is enabled. */
#define HAVE_ENCODER_POWERPC 1
/* Define to 1 if sparc encoder is enabled. */
#define HAVE_ENCODER_SPARC 1
/* Define to 1 if x86 encoder is enabled. */
#define HAVE_ENCODER_X86 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 to enable bt2 match finder. */
#define HAVE_MF_BT2 1
/* Define to 1 to enable bt3 match finder. */
#define HAVE_MF_BT3 1
/* Define to 1 to enable bt4 match finder. */
#define HAVE_MF_BT4 1
/* Define to 1 to enable hc3 match finder. */
#define HAVE_MF_HC3 1
/* Define to 1 to enable hc4 match finder. */
#define HAVE_MF_HC4 1
/* Define to 1 if stdbool.h conforms to C99. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the `utimes' function. */
#define HAVE_UTIMES 1
/* Define to 1 or 0, depending whether the compiler supports simple visibility
declarations. */
#define HAVE_VISIBILITY 0
/* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 1
/* Define to 1 to disable debugging code. */
#define NDEBUG 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "XZ Utils"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://tukaani.org/xz/"
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4
/* Define to 1 if the system supports fast unaligned access to 16-bit and
32-bit integers. */
#define TUKLIB_FAST_UNALIGNED_ACCESS 1

115
extra/7z2lzma/7z2lzma.bash Executable file
View File

@@ -0,0 +1,115 @@
#!/bin/bash
#
#############################################################################
#
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
# have exactly one LZMA compressed stream, which has been created with the
# default lc, lp, and pb values. The CRC32 in the .7z archive is not checked,
# and the script may seem to succeed while it actually created a corrupt .lzma
# file. You should always try uncompressing both the original .7z and the
# created .lzma and compare that the output is identical.
#
# This script requires basic GNU tools and 7z or 7za tool from p7zip.
#
# Last modified: 2009-01-15 14:25+0200
#
#############################################################################
#
# Author: Lasse Collin <lasse.collin@tukaani.org>
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
# You can use 7z or 7za, both will work.
SEVENZIP=7za
if [ $# != 2 -o -z "$1" -o -z "$2" ]; then
echo "Usage: $0 input.7z output.lzma"
exit 1
fi
# Converts an integer variable to little endian binary integer.
int2bin()
{
local LEN=$1
local NUM=$2
local HEX=(0 1 2 3 4 5 6 7 8 9 A B C D E F)
local I
for ((I=0; I < "$LEN"; ++I)); do
printf "\\x${HEX[(NUM >> 4) & 0x0F]}${HEX[NUM & 0x0F]}"
NUM=$((NUM >> 8))
done
}
# Make sure we get possible errors from pipes.
set -o pipefail
# Get information about the input file. At least older 7z and 7za versions
# may return with zero exit status even when an error occurred, so check
# if the output has any lines beginning with "Error".
INFO=$("$SEVENZIP" l -slt "$1")
if [ $? != 0 ] || printf '%s\n' "$INFO" | grep -q ^Error; then
printf '%s\n' "$INFO"
exit 1
fi
# Check if the input file has more than one compressed block.
if printf '%s\n' "$INFO" | grep -q '^Block = 1'; then
echo "Cannot convert, because the input file has more than"
echo "one compressed block."
exit 1
fi
# Get compressed, uncompressed, and dictionary size.
CSIZE=$(printf '%s\n' "$INFO" | sed -rn 's|^Packed Size = ([0-9]+$)|\1|p')
USIZE=$(printf '%s\n' "$INFO" | sed -rn 's|^Size = ([0-9]+$)|\1|p')
DICT=$(printf '%s\n' "$INFO" | sed -rn 's|^Method = LZMA:([0-9]+[bkm]?)$|\1|p')
if [ -z "$CSIZE" -o -z "$USIZE" -o -z "$DICT" ]; then
echo "Parsing output of $SEVENZIP failed. Maybe the file uses some"
echo "other compression method than plain LZMA."
exit 1
fi
# The following assumes that the default lc, lp, and pb settings were used.
# Otherwise the output will be corrupt.
printf '\x5D' > "$2"
# Dictionary size can be either was power of two, bytes, kibibytes, or
# mebibytes. We need to convert it to bytes.
case $DICT in
*b)
DICT=${DICT%b}
;;
*k)
DICT=${DICT%k}
DICT=$((DICT << 10))
;;
*m)
DICT=${DICT%m}
DICT=$((DICT << 20))
;;
*)
DICT=$((1 << DICT))
;;
esac
int2bin 4 "$DICT" >> "$2"
# Uncompressed size
int2bin 8 "$USIZE" >> "$2"
# Copy the actual compressed data. Using multiple dd commands to avoid
# copying large amount of data with one-byte block size, which would be
# annoyingly slow.
BS=8192
BIGSIZE=$((CSIZE / BS))
CSIZE=$((CSIZE % BS))
{
dd of=/dev/null bs=32 count=1 \
&& dd bs="$BS" count="$BIGSIZE" \
&& dd bs=1 count="$CSIZE"
} < "$1" >> "$2"
exit $?

View File

@@ -64,11 +64,11 @@ int main(int argc, char *argv[]) {
ret = fread(buf, BUFSIZE, 1, stdin);
if (ret != 1)
break;
/* Scan for signature. */
for (i = 0; i<BUFSIZE-23; i++) {
if (find_lzma_header(buf+i) && numlzma-- <= 0) {
fwrite(buf+i, (BUFSIZE-i), 1, stdout);
fwrite(buf+i, (BUFSIZE-i), 1, stdout);
for (;;) {
int ch;
ch = getchar();
@@ -76,7 +76,6 @@ int main(int argc, char *argv[]) {
exit(0);
putchar(ch);
}
}
}
blocks++;

View File

@@ -1,40 +1,32 @@
##
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
## Copyright (C) 2007 Lasse Collin
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## Not using gnulib-tool, at least for now. Less mess this way.
## Not using gnulib-tool, at least for now. It is likely that we won't
## need anything else from Gnulib than getopt_long().
## We need two builds of libgnu: one with NLS and one without.
## This is because lzma uses NLS but lzmadec doesn't, while
## both need GNU getopt_long().
noinst_LIBRARIES = libgnu.a libgnu_nls.a
noinst_LIBRARIES = libgnu.a
libgnu_a_SOURCES =
libgnu_a_DEPENDENCIES = $(LIBOBJS)
libgnu_a_LIBADD = $(LIBOBJS)
libgnu_a_CPPFLAGS = -DDISABLE_NLS=1
libgnu_nls_a_SOURCES =
libgnu_nls_a_DEPENDENCIES = $(LIBOBJS)
libgnu_nls_a_LIBADD = $(LIBOBJS)
EXTRA_DIST = gettext.h getopt_.h getopt.c getopt1.c getopt_int.h
EXTRA_DIST = getopt.in.h getopt.c getopt1.c getopt_int.h
BUILT_SOURCES = $(GETOPT_H)
MOSTLYCLEANFILES = getopt.h getopt.h-t
getopt.h: getopt_.h
getopt.h: getopt.in.h
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/getopt_.h; \
cat $(srcdir)/getopt.in.h; \
} > $@-t
mv -f $@-t $@

View File

@@ -7,16 +7,16 @@
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License along
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
@@ -35,12 +35,18 @@
# include <unixlib.h>
#endif
/* Completely disable NLS for getopt. We won't include translations for it
anyway. If the system lacks getopt_long, missing translations probably
aren't a problem. */
/*
#ifdef _LIBC
# include <libintl.h>
#else
# include "gettext.h"
# define _(msgid) gettext (msgid)
#endif
*/
#define _(msgid) (msgid)
#if defined _LIBC && defined USE_IN_LIBIO
# include <wchar.h>

View File

@@ -4,16 +4,16 @@
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License along
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */

View File

@@ -4,16 +4,16 @@
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License along
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */

View File

@@ -1,240 +0,0 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _LIBGETTEXT_H
#define _LIBGETTEXT_H 1
/* NLS can be disabled through the configure --disable-nls option.
*
* Extra hack in LZMA Utils: if DISABLE_NLS is defined, NLS is disabled
* even if ENABLE_NLS is true. See Makefile.am for more information.
*/
#if ENABLE_NLS && !defined(DISABLE_NLS)
/* Get declarations of GNU message catalog functions. */
# include <libintl.h>
/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
the gettext() and ngettext() macros. This is an alternative to calling
textdomain(), and is useful for libraries. */
# ifdef DEFAULT_TEXT_DOMAIN
# undef gettext
# define gettext(Msgid) \
dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
# undef ngettext
# define ngettext(Msgid1, Msgid2, N) \
dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
# endif
#else
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
chokes if dcgettext is defined as a macro. So include it now, to make
later inclusions of <locale.h> a NOP. We don't include <libintl.h>
as well because people using "gettext.h" will not include <libintl.h>,
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
is OK. */
#if defined(__sun)
# include <locale.h>
#endif
/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
<libintl.h>, which chokes if dcgettext is defined as a macro. So include
it now, to make later inclusions of <libintl.h> a NOP. */
#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
# include <cstdlib>
# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
# include <libintl.h>
# endif
#endif
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.
On pre-ANSI systems without 'const', the config.h file is supposed to
contain "#define const". */
# define gettext(Msgid) ((const char *) (Msgid))
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define textdomain(Domainname) ((const char *) (Domainname))
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
#endif
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
The argument, String, should be a literal string. Concatenated strings
and other string expressions won't work.
The macro's expansion is not parenthesized, so that it is suitable as
initializer for static 'char[]' or 'const char[]' variables. */
#define gettext_noop(String) String
/* The separator between msgctxt and msgid in a .mo file. */
#define GETTEXT_CONTEXT_GLUE "\004"
/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
short and rarely need to change.
The letter 'p' stands for 'particular' or 'special'. */
#ifdef DEFAULT_TEXT_DOMAIN
# define pgettext(Msgctxt, Msgid) \
pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#else
# define pgettext(Msgctxt, Msgid) \
pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#endif
#define dpgettext(Domainname, Msgctxt, Msgid) \
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
#ifdef DEFAULT_TEXT_DOMAIN
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#else
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#endif
#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
static inline const char *
pgettext_aux (const char *domain,
const char *msg_ctxt_id, const char *msgid,
int category)
{
const char *translation = dcgettext (domain, msg_ctxt_id, category);
if (translation == msg_ctxt_id)
return msgid;
else
return translation;
}
static inline const char *
npgettext_aux (const char *domain,
const char *msg_ctxt_id, const char *msgid,
const char *msgid_plural, unsigned long int n,
int category)
{
const char *translation =
dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
if (translation == msg_ctxt_id || translation == msgid_plural)
return (n == 1 ? msgid : msgid_plural);
else
return translation;
}
/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
can be arbitrary expressions. But for string literals these macros are
less efficient than those above. */
#include <string.h>
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
#include <stdlib.h>
#endif
#define pgettext_expr(Msgctxt, Msgid) \
dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
static inline const char *
dcpgettext_expr (const char *domain,
const char *msgctxt, const char *msgid,
int category)
{
size_t msgctxt_len = strlen (msgctxt) + 1;
size_t msgid_len = strlen (msgid) + 1;
const char *translation;
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
char msg_ctxt_id[msgctxt_len + msgid_len];
#else
char buf[1024];
char *msg_ctxt_id =
(msgctxt_len + msgid_len <= sizeof (buf)
? buf
: (char *) malloc (msgctxt_len + msgid_len));
if (msg_ctxt_id != NULL)
#endif
{
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
msg_ctxt_id[msgctxt_len - 1] = '\004';
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
translation = dcgettext (domain, msg_ctxt_id, category);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
if (msg_ctxt_id != buf)
free (msg_ctxt_id);
#endif
if (translation != msg_ctxt_id)
return translation;
}
return msgid;
}
#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
static inline const char *
dcnpgettext_expr (const char *domain,
const char *msgctxt, const char *msgid,
const char *msgid_plural, unsigned long int n,
int category)
{
size_t msgctxt_len = strlen (msgctxt) + 1;
size_t msgid_len = strlen (msgid) + 1;
const char *translation;
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
char msg_ctxt_id[msgctxt_len + msgid_len];
#else
char buf[1024];
char *msg_ctxt_id =
(msgctxt_len + msgid_len <= sizeof (buf)
? buf
: (char *) malloc (msgctxt_len + msgid_len));
if (msg_ctxt_id != NULL)
#endif
{
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
msg_ctxt_id[msgctxt_len - 1] = '\004';
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
if (msg_ctxt_id != buf)
free (msg_ctxt_id);
#endif
if (!(translation == msg_ctxt_id || translation == msgid_plural))
return translation;
}
return (n == 1 ? msgid : msgid_plural);
}
#endif /* _LIBGETTEXT_H */

35
m4/.gitignore vendored Normal file
View File

@@ -0,0 +1,35 @@
codeset.m4
gettext.m4
glibc2.m4
glibc21.m4
iconv.m4
intdiv0.m4
intl.m4
intldir.m4
intmax.m4
inttypes-pri.m4
inttypes_h.m4
lcmessage.m4
lib-ld.m4
lib-link.m4
lib-prefix.m4
libtool.m4
lock.m4
longdouble.m4
longlong.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
nls.m4
po.m4
printf-posix.m4
progtest.m4
size_max.m4
stdint_h.m4
uintmax_t.m4
ulonglong.m4
visibility.m4
wchar_t.m4
wint_t.m4
xsize.m4

View File

@@ -1,5 +1,5 @@
# getopt.m4 serial 13
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# getopt.m4 serial 14 (modified version)
dnl Copyright (C) 2002-2006, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -13,7 +13,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE],
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_GETOPT_SUBSTITUTE_HEADER
gl_PREREQ_GETOPT
])
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
@@ -32,40 +31,35 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
fi
if test -z "$GETOPT_H"; then
AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
AC_CHECK_FUNCS([getopt_long], [], [GETOPT_H=getopt.h])
fi
dnl BSD getopt_long uses an incompatible method to reset option processing,
dnl and (as of 2004-10-15) mishandles optional option-arguments.
dnl BSD getopt_long uses a way to reset option processing, that is different
dnl from GNU and Solaris (which copied the GNU behavior). We support both
dnl GNU and BSD style resetting of getopt_long(), so there's no need to use
dnl GNU getopt_long() on BSD due to different resetting style.
dnl
dnl With getopt_long(), some BSD versions have a bug in handling optional
dnl arguments. This bug appears only if the environment variable
dnl POSIXLY_CORRECT has been set, so it shouldn't be too bad in most
dnl cases; probably most don't have that variable set. But if we actually
dnl hit this bug, it is a real problem due to our heavy use of optional
dnl arguments.
dnl
dnl According to CVS logs, the bug was introduced in OpenBSD in 2003-09-22
dnl and copied to FreeBSD in 2004-02-24. It was fixed in both in 2006-09-22,
dnl so the affected versions shouldn't be popular anymore anyway. NetBSD
dnl never had this bug. TODO: What about Darwin and others?
if test -z "$GETOPT_H"; then
AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
AC_CHECK_DECL([optreset],
[AC_DEFINE([HAVE_OPTRESET], 1,
[Define to 1 if getopt.h declares extern int optreset.])],
[], [#include <getopt.h>])
fi
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
dnl option string (as of 2005-05-05).
if test -z "$GETOPT_H"; then
AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([#include <getopt.h>],
[[
char *myargv[3];
myargv[0] = "conftest";
myargv[1] = "-+";
myargv[2] = 0;
return getopt (2, myargv, "+a") != '?';
]])],
[gl_cv_func_gnu_getopt=yes],
[gl_cv_func_gnu_getopt=no],
[dnl cross compiling - pessimistically guess based on decls
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
dnl option string (as of 2005-05-05).
AC_CHECK_DECL([getopt_clip],
[gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
[#include <getopt.h>])])])
if test "$gl_cv_func_gnu_getopt" = "no"; then
GETOPT_H=getopt.h
fi
fi
dnl option string (as of 2005-05-05). We don't use that feature, so this
dnl is not a problem for us. Thus, the respective test was removed here.
])
AC_DEFUN([gl_GETOPT_IFELSE],
@@ -75,9 +69,3 @@ AC_DEFUN([gl_GETOPT_IFELSE],
])
AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
# Prerequisites of lib/getopt*.
AC_DEFUN([gl_PREREQ_GETOPT],
[
AC_CHECK_DECLS_ONCE([getenv])
])

63
m4/posix-shell.m4 Normal file
View File

@@ -0,0 +1,63 @@
# Find a POSIX-conforming shell.
# Copyright (C) 2007-2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
# If a POSIX-conforming shell can be found, set POSIX_SHELL and
# PREFERABLY_POSIX_SHELL to it. If not, set POSIX_SHELL to the
# empty string and PREFERABLY_POSIX_SHELL to '/bin/sh'.
AC_DEFUN([gl_POSIX_SHELL],
[
AC_CACHE_CHECK([for a shell that conforms to POSIX], [gl_cv_posix_shell],
[gl_test_posix_shell_script='
func_return () {
(exit [$]1)
}
func_success () {
func_return 0
}
func_failure () {
func_return 1
}
func_ret_success () {
return 0
}
func_ret_failure () {
return 1
}
subshell_umask_sanity () {
(umask 22; (umask 0); test $(umask) -eq 22)
}
test "[$](echo foo)" = foo &&
func_success &&
! func_failure &&
func_ret_success &&
! func_ret_failure &&
(set x && func_ret_success y && test x = "[$]1") &&
subshell_umask_sanity
'
for gl_cv_posix_shell in \
"$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do
case $gl_cv_posix_shell in
/*)
"$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \
&& break;;
esac
done])
if test "$gl_cv_posix_shell" != no; then
POSIX_SHELL=$gl_cv_posix_shell
PREFERABLY_POSIX_SHELL=$POSIX_SHELL
else
POSIX_SHELL=
PREFERABLY_POSIX_SHELL=/bin/sh
fi
AC_SUBST([POSIX_SHELL])
AC_SUBST([PREFERABLY_POSIX_SHELL])
])

22
m4/tuklib_common.m4 Normal file
View File

@@ -0,0 +1,22 @@
#
# SYNOPSIS
#
# TUKLIB_COMMON
#
# DESCRIPTION
#
# Common checks for tuklib.
#
# COPYING
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
AC_DEFUN_ONCE([TUKLIB_COMMON], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC_C99])
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
])dnl

105
m4/tuklib_cpucores.m4 Normal file
View File

@@ -0,0 +1,105 @@
#
# SYNOPSIS
#
# TUKLIB_CPUCORES
#
# DESCRIPTION
#
# Check how to find out the number of available CPU cores in the system.
# This information is used by tuklib_cpucores.c.
#
# Supported methods:
# - sysctl(): BSDs, OS/2
# - sysconf(): GNU/Linux, Solaris, Tru64, IRIX, AIX, Cygwin
# - pstat_getdynamic(): HP-UX
#
# COPYING
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
AC_DEFUN_ONCE([TUKLIB_CPUCORES], [
AC_REQUIRE([TUKLIB_COMMON])
# sys/param.h might be needed by sys/sysctl.h.
AC_CHECK_HEADERS([sys/param.h])
AC_CACHE_CHECK([how to detect the number of available CPU cores],
[tuklib_cv_cpucores_method], [
# Look for sysctl() solution first, because on OS/2, both sysconf()
# and sysctl() pass the tests in this file, but only sysctl()
# actually works.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/sysctl.h>
int
main(void)
{
int name[2] = { CTL_HW, HW_NCPU };
int cpus;
size_t cpus_size = sizeof(cpus);
sysctl(name, 2, &cpus, &cpus_size, NULL, 0);
return 0;
}
]])], [tuklib_cv_cpucores_method=sysctl], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
int
main(void)
{
long i;
#ifdef _SC_NPROCESSORS_ONLN
/* Many systems using sysconf() */
i = sysconf(_SC_NPROCESSORS_ONLN);
#else
/* IRIX */
i = sysconf(_SC_NPROC_ONLN);
#endif
return 0;
}
]])], [tuklib_cv_cpucores_method=sysconf], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/param.h>
#include <sys/pstat.h>
int
main(void)
{
struct pst_dynamic pst;
pstat_getdynamic(&pst, sizeof(pst), 1, 0);
(void)pst.psd_proc_cnt;
return 0;
}
]])], [tuklib_cv_cpucores_method=pstat_getdynamic], [
tuklib_cv_cpucores_method=unknown
])])])])
case $tuklib_cv_cpucores_method in
sysctl)
AC_DEFINE([TUKLIB_CPUCORES_SYSCTL], [1],
[Define to 1 if the number of available CPU cores
can be detected with sysctl().])
;;
sysconf)
AC_DEFINE([TUKLIB_CPUCORES_SYSCONF], [1],
[Define to 1 if the number of available CPU cores
can be detected with sysconf(_SC_NPROCESSORS_ONLN)
or sysconf(_SC_NPROC_ONLN).])
;;
pstat_getdynamic)
AC_DEFINE([TUKLIB_CPUCORES_PSTAT_GETDYNAMIC], [1],
[Define to 1 if the number of available CPU cores
can be detected with pstat_getdynamic().])
;;
esac
])dnl

74
m4/tuklib_integer.m4 Normal file
View File

@@ -0,0 +1,74 @@
#
# SYNOPSIS
#
# TUKLIB_INTEGER
#
# DESCRIPTION
#
# Checks for tuklib_integer.h:
# - Endianness
# - Does operating system provide byte swapping macros
# - Does the hardware support fast unaligned access to 16-bit
# and 32-bit integers
#
# COPYING
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
AC_REQUIRE([TUKLIB_COMMON])
AC_REQUIRE([AC_C_BIGENDIAN])
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
# Even if we have byteswap.h, we may lack the specific macros/functions.
if test x$ac_cv_header_byteswap_h = xyes ; then
m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
AC_MSG_CHECKING([if FUNC is available])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <byteswap.h>
int
main(void)
{
FUNC[](42);
return 0;
}
])], [
AC_DEFINE(HAVE_[]m4_toupper(FUNC), [1],
[Define to 1 if] FUNC [is available.])
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
])dnl
fi
AC_MSG_CHECKING([if unaligned memory access should be used])
AC_ARG_ENABLE([unaligned-access], AC_HELP_STRING([--enable-unaligned-access],
[Enable if the system supports *fast* unaligned memory access
with 16-bit and 32-bit integers. By default, this is enabled
only on x86, x86_64, and big endian PowerPC.]),
[], [enable_unaligned_access=auto])
if test "x$enable_unaligned_access" = xauto ; then
# TODO: There may be other architectures, on which unaligned access
# is OK.
case $host_cpu in
i?86|x86_64|powerpc|powerpc64)
enable_unaligned_access=yes
;;
*)
enable_unaligned_access=no
;;
esac
fi
if test "x$enable_unaligned_access" = xyes ; then
AC_DEFINE([TUKLIB_FAST_UNALIGNED_ACCESS], [1], [Define to 1 if
the system supports fast unaligned access to 16-bit and
32-bit integers.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
])dnl

30
m4/tuklib_mbstr.m4 Normal file
View File

@@ -0,0 +1,30 @@
#
# SYNOPSIS
#
# TUKLIB_MBSTR
#
# DESCRIPTION
#
# Check if multibyte and wide character functionality is available
# for use by tuklib_mbstr_* functions. If not enough multibyte string
# support is available in the C library, the functions keep working
# with the assumption that all strings are a in single-byte character
# set without combining characters, e.g. US-ASCII or ISO-8859-*.
#
# This .m4 file and tuklib_mbstr.h are common to all tuklib_mbstr_*
# functions, but each function is put into a separate .c file so
# that it is possible to pick only what is strictly needed.
#
# COPYING
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
AC_DEFUN_ONCE([TUKLIB_MBSTR], [
AC_REQUIRE([TUKLIB_COMMON])
AC_FUNC_MBRTOWC
AC_CHECK_FUNCS([wcwidth])
])dnl

211
m4/tuklib_physmem.m4 Normal file
View File

@@ -0,0 +1,211 @@
#
# SYNOPSIS
#
# TUKLIB_PHYSMEM
#
# DESCRIPTION
#
# Check how to get the amount of physical memory.
# This information is used in tuklib_physmem.c.
#
# Supported methods:
#
# - Windows (including Cygwin), OS/2, DJGPP (DOS), and OpenVMS have
# operating-system specific functions.
#
# - AIX has _system_configuration.physmem.
#
# - sysconf() works on GNU/Linux and Solaris, and possibly on
# some BSDs.
#
# - BSDs use sysctl().
#
# - Tru64 uses getsysinfo().
#
# - HP-UX uses pstat_getstatic().
#
# - IRIX has setinvent_r(), getinvent_r(), and endinvent_r().
#
# - sysinfo() works on Linux/dietlibc and probably on other Linux
# systems whose libc may lack sysconf().
#
# COPYING
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [
AC_REQUIRE([TUKLIB_COMMON])
# sys/param.h might be needed by sys/sysctl.h.
AC_CHECK_HEADERS([sys/param.h])
AC_CACHE_CHECK([how to detect the amount of physical memory],
[tuklib_cv_physmem_method], [
# Maybe checking $host_os would be enough but this matches what
# tuklib_physmem.c does.
#
# NOTE: IRIX has a compiler that doesn't error out with #error, so use
# a non-compilable text instead of #error to generate an error.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \
|| defined(__DJGPP__) || defined(__VMS)
int main(void) { return 0; }
#else
compile error
#endif
]])], [tuklib_cv_physmem_method=special], [
# Look for AIX-specific solution before sysconf(), because the test
# for sysconf() will pass on AIX but won't actually work
# (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX).
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/systemcfg.h>
int
main(void)
{
(void)_system_configuration.physmem;
return 0;
}
]])], [tuklib_cv_physmem_method=aix], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
int
main(void)
{
long i;
i = sysconf(_SC_PAGESIZE);
i = sysconf(_SC_PHYS_PAGES);
return 0;
}
]])], [tuklib_cv_physmem_method=sysconf], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/sysctl.h>
int
main(void)
{
int name[2] = { CTL_HW, HW_PHYSMEM };
unsigned long mem;
size_t mem_ptr_size = sizeof(mem);
sysctl(name, 2, &mem, &mem_ptr_size, NULL, 0);
return 0;
}
]])], [tuklib_cv_physmem_method=sysctl], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/sysinfo.h>
#include <machine/hal_sysinfo.h>
int
main(void)
{
int memkb;
int start = 0;
getsysinfo(GSI_PHYSMEM, (caddr_t)&memkb, sizeof(memkb), &start);
return 0;
}
]])], [tuklib_cv_physmem_method=getsysinfo],[
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/param.h>
#include <sys/pstat.h>
int
main(void)
{
struct pst_static pst;
pstat_getstatic(&pst, sizeof(pst), 1, 0);
(void)pst.physical_memory;
(void)pst.page_size;
return 0;
}
]])], [tuklib_cv_physmem_method=pstat_getstatic],[
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <invent.h>
int
main(void)
{
inv_state_t *st = NULL;
setinvent_r(&st);
getinvent_r(st);
endinvent_r(st);
return 0;
}
]])], [tuklib_cv_physmem_method=getinvent_r], [
# This version of sysinfo() is Linux-specific. Some non-Linux systems have
# different sysinfo() so we must check $host_os.
case $host_os in
linux*)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/sysinfo.h>
int
main(void)
{
struct sysinfo si;
sysinfo(&si);
return 0;
}
]])], [
tuklib_cv_physmem_method=sysinfo
], [
tuklib_cv_physmem_method=unknown
])
;;
*)
tuklib_cv_physmem_method=unknown
;;
esac
])])])])])])])])
case $tuklib_cv_physmem_method in
aix)
AC_DEFINE([TUKLIB_PHYSMEM_AIX], [1],
[Define to 1 if the amount of physical memory
can be detected with _system_configuration.physmem.])
;;
sysconf)
AC_DEFINE([TUKLIB_PHYSMEM_SYSCONF], [1],
[Define to 1 if the amount of physical memory can
be detected with sysconf(_SC_PAGESIZE) and
sysconf(_SC_PHYS_PAGES).])
;;
sysctl)
AC_DEFINE([TUKLIB_PHYSMEM_SYSCTL], [1],
[Define to 1 if the amount of physical memory can
be detected with sysctl().])
;;
getsysinfo)
AC_DEFINE([TUKLIB_PHYSMEM_GETSYSINFO], [1],
[Define to 1 if the amount of physical memory can
be detected with getsysinfo().])
;;
pstat_getstatic)
AC_DEFINE([TUKLIB_PHYSMEM_PSTAT_GETSTATIC], [1],
[Define to 1 if the amount of physical memory can
be detected with pstat_getstatic().])
;;
getinvent_r)
AC_DEFINE([TUKLIB_PHYSMEM_GETINVENT_R], [1],
[Define to 1 if the amount of physical memory
can be detected with getinvent_r().])
;;
sysinfo)
AC_DEFINE([TUKLIB_PHYSMEM_SYSINFO], [1],
[Define to 1 if the amount of physical memory
can be detected with Linux sysinfo().])
;;
esac
])dnl

25
m4/tuklib_progname.m4 Normal file
View File

@@ -0,0 +1,25 @@
#
# SYNOPSIS
#
# TUKLIB_PROGNAME
#
# DESCRIPTION
#
# Put argv[0] into a global variable progname. On DOS-like systems,
# modify it so that it looks nice (no full path or .exe suffix).
#
# This .m4 file is needed allow this module to use glibc's
# program_invocation_name.
#
# COPYING
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
AC_DEFUN_ONCE([TUKLIB_PROGNAME], [
AC_REQUIRE([TUKLIB_COMMON])
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
])dnl

31
po/.gitignore vendored Normal file
View File

@@ -0,0 +1,31 @@
# autopoint
Makefile.in.in
Makevars.template
Rules-quot
boldquot.sed
en@boldquot.header
en@quot.header
insert-header.sin
quot.sed
remove-potcdate.sin
# configure
Makefile.in
Makefile
POTFILES
# intermediate files (make)
stamp-poT
xz.po
xz.1po
xz.2po
*.new.po
# make
remove-potcdate.sed
xz.mo
stamp-po
*.gmo
# cached templates (make)
xz.pot

View File

@@ -1 +1,4 @@
fi
cs
de
it
pl

View File

@@ -1,13 +1,13 @@
# List of source files which contain translatable strings.
src/lzma/help.c
src/lzma/alloc.c
src/lzma/args.c
src/lzma/error.c
src/lzma/io.c
src/lzma/list.c
src/lzma/main.c
src/lzma/options.c
src/lzma/process.c
src/lzma/suffix.c
src/lzma/util.c
lib/getopt.c
src/xz/args.c
src/xz/coder.c
src/xz/file_io.c
src/xz/hardware.c
src/xz/list.c
src/xz/main.c
src/xz/message.c
src/xz/options.c
src/xz/signals.c
src/xz/suffix.c
src/xz/util.c
src/common/tuklib_exit.c

949
po/cs.po Normal file
View File

@@ -0,0 +1,949 @@
# XZ Utils Czech translation
# This file is put in the public domain.
# Marek Černocký <marek@manet.cz>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: xz-utils\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2010-12-03 11:25+0100\n"
"PO-Revision-Date: 2010-12-03 11:32+0100\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: Czech <diskuze@lists.l10n.cz>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
"X-Poedit-Language: Czech\n"
"X-Poedit-SourceCharset: utf-8\n"
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Neznámý typ formátu souboru"
#: src/xz/args.c:356 src/xz/args.c:364
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s: Neznámý typ kontroly integrity"
#: src/xz/args.c:382
msgid "Only one file can be specified with `--files' or `--files0'."
msgstr ""
"Spolu s přepínači „--files“ nebo „--files0“ může být zadán pouze jeden soubor"
#: src/xz/args.c:445
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "Proměnná prostředí %s obsahuje příliš mnoho argumentů"
#: src/xz/coder.c:95
msgid "Maximum number of filters is four"
msgstr "Maximální počet filtrů je čtyři"
#: src/xz/coder.c:108
msgid "Memory usage limit is too low for the given filter setup."
msgstr "Omezení použitelné paměti je příliš malé pro dané nastavení filtru."
#: src/xz/coder.c:129
msgid "Using a preset in raw mode is discouraged."
msgstr "Použití přednastavení v režimu raw je nevhodné."
#: src/xz/coder.c:131
msgid "The exact options of the presets may vary between software versions."
msgstr ""
"Přesné volby u přednastavení se mohou lišit mezi různými verzemi softwaru."
#: src/xz/coder.c:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Formát .lzma podporuje pouze filtr LZMA1"
#: src/xz/coder.c:165
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 nelze použít s formátem .xz"
#: src/xz/coder.c:182
msgid "Unsupported filter chain or filter options"
msgstr "Nepodporovaný omezující filtr nebo volby filtru"
#: src/xz/coder.c:190
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "Dekomprimace bude vyžadovat %s MiB paměti."
#: 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 ""
"Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo "
"překročeno omezení použitelné paměti %s MiB"
#. TRANSLATORS: When compression or decompression finishes,
#. and xz is going to remove the source file, xz first checks
#. if the source file still exists, and if it does, does its
#. device and inode numbers match what xz saw when it opened
#. the source file. If these checks fail, this message is
#. shown, %s being the filename, and the file is not deleted.
#. The check for device and inode numbers is there, because
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c:137
#, c-format
msgid "%s: File seems to have been moved, not removing"
msgstr "%s: Vypadá to, že soubor byl přesunut, proto nebude odstraněn"
#: src/xz/file_io.c:144 src/xz/file_io.c:590
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: Nelze odstranit: %s"
#: src/xz/file_io.c:169
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s: Nelze nastavit vlastníka souboru: %s"
#: src/xz/file_io.c:175
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: Nelze nastavit skupinu souboru: %s"
#: src/xz/file_io.c:194
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s: Nelze nastavit oprávnění souboru: %s"
#: src/xz/file_io.c:337 src/xz/file_io.c:420
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s: Jedná se o symbolický odkaz, vynechává se"
#: src/xz/file_io.c:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Jedná se o složku, vynechává se"
#: src/xz/file_io.c:462
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: Nejedná se o běžný soubor, vynechává se"
#: src/xz/file_io.c:479
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: Soubor má nastavený bit setuid nebo setgid, vynechává se"
#: src/xz/file_io.c:486
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Soubor má nastavený bit sticky, vynechává se"
#: src/xz/file_io.c:493
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: Vstupní soubor má více než jeden pevný odkaz, vynechává se"
#: src/xz/file_io.c:714
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "Chyba při obnovení příznaku O_APPEND na standardní výstup: %s"
#: src/xz/file_io.c:726
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: Selhalo zavření souboru: %s"
#: src/xz/file_io.c:762 src/xz/file_io.c:946
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr ""
"%s: Selhalo nastavení pozice při pokusu o vytvoření souboru řídké matice: %s"
#: src/xz/file_io.c:821
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Chyba čtení: %s"
#: src/xz/file_io.c:844
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: Chyba při posunu v rámci souboru: %s"
#: src/xz/file_io.c:854
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: Neočekávaný konec souboru"
#: src/xz/file_io.c:904
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Chyba zápisu: %s"
#: src/xz/hardware.c:100
msgid "Disabled"
msgstr "Vypnuto"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: src/xz/hardware.c:119
msgid "Total amount of physical memory (RAM): "
msgstr "Celkové množství fyzické paměti (RAM): "
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Omezení použitelné paměti pro komprimaci: "
#: src/xz/hardware.c:123
msgid "Memory usage limit for decompression: "
msgstr "Omezení použitelné paměti pro dekomprimaci:"
#. 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
msgid "None"
msgstr "žádná"
#. TRANSLATORS: Indicates that integrity check name is not known,
#. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter, but don't use spaces.
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "neznámá-2"
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "neznámá-3"
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "neznámá-5"
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "neznámá-6"
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "neznámá-7"
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "neznámá-8"
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "neznámá-9"
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "neznámá-11"
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "neznámá-12"
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "neznámá-13"
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "neznámá-14"
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "neznámá-15"
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s: Soubor je prázdný"
#: src/xz/list.c:131
#, c-format
msgid "%s: Too small to be a valid .xz file"
msgstr "%s: Je příliš malý na to, aby to mohl být platný soubor .xz"
#. TRANSLATORS: These are column headings. From Strms (Streams)
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:612
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr "Proud Bloky Komprim Nekomprim Poměr Kontrl Název souboru"
#: src/xz/list.c:652
#, c-format
msgid " Streams: %s\n"
msgstr " Proudů: %s\n"
#: src/xz/list.c:654
#, c-format
msgid " Blocks: %s\n"
msgstr " Bloků: %s\n"
#: src/xz/list.c:656
#, c-format
msgid " Compressed size: %s\n"
msgstr " Komprimovaná velikost: %s\n"
#: src/xz/list.c:659
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Nekomprimovaná velikost: %s\n"
#: src/xz/list.c:662
#, c-format
msgid " Ratio: %s\n"
msgstr " Poměr komprimace: %s\n"
#: src/xz/list.c:664
#, c-format
msgid " Check: %s\n"
msgstr " Typ kontroly: %s\n"
#: src/xz/list.c:665
#, c-format
msgid " Stream padding: %s\n"
msgstr " Zarovnání proudu: %s\n"
#. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz".
#: src/xz/list.c:693
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize "
"UncompSize Ratio Check Padding"
msgstr ""
" Proudy:\n"
" Proud Bloky KomprPozice NekomprPozice KomprVelikost "
"NekomprVelikost Poměr Kontrola Zarovnání"
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:748
#, c-format
msgid ""
" Blocks:\n"
" Stream Block CompOffset UncompOffset TotalSize "
"UncompSize Ratio Check"
msgstr ""
" Bloky:\n"
" Proud Blok KomprPozice NekomprPozice CelkVelikost "
"NekomprVelikost Poměr Kontrola"
#. TRANSLATORS: These are additional column headings
#. for the most verbose listing mode. CheckVal
#. (Check value), Flags, and Filters are left aligned.
#. Header (Block Header Size), CompSize, and MemUsage
#. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz".
#: src/xz/list.c:760
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " KontrHod %*s Hlavič Příznaky KomprVel PoužiPam Filtry"
#: src/xz/list.c:838 src/xz/list.c:1007
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Potřebná paměť: %s MiB\n"
#: src/xz/list.c:840 src/xz/list.c:1009
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Velikosti v hlavičkách: %s\n"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "Yes"
msgstr "Ano"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "No"
msgstr "Ne"
#. 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
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s soubor\n"
msgstr[1] "%s soubory\n"
msgstr[2] "%s souborů\n"
#: src/xz/list.c:999
msgid "Totals:"
msgstr "Celkem:"
#: src/xz/list.c:1000
#, c-format
msgid " Number of files: %s\n"
msgstr " Počet souborů: %s\n"
#: src/xz/list.c:1072
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list pracuje pouze se soubory .xz (--format=xz nebo --format=auto)"
#: src/xz/list.c:1078
msgid "--list does not support reading from standard input"
msgstr "--list nepodporuje čtení ze standardního vstupu"
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s: Chyba při čtení názvů souborů: %s"
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s: Neočekávaný konec vstupu při čtení názvů souborů"
#: src/xz/main.c:120
#, c-format
msgid ""
"%s: Null character found when reading filenames; maybe you meant to use `--"
"files0' instead of `--files'?"
msgstr ""
"%s: Byl nalezen nulový znak při čtení názvů souborů; nechtěli jste náhodou "
"použít „--files0“ místo „--files“?"
#: src/xz/main.c:174
msgid "Compression and decompression with --robot are not supported yet."
msgstr "Komprimace a dekomprimace s přepínačem --robot není zatím podporovaná."
#: src/xz/main.c:231
msgid ""
"Cannot read data from standard input when reading filenames from standard "
"input"
msgstr ""
"Ze standardního vstupu nelze číst data, když se ze standardního vstupu "
"načítají názvy souborů"
#: src/xz/message.c:792 src/xz/message.c:842
msgid "Internal error (bug)"
msgstr "Interní chyba"
#: src/xz/message.c:799
msgid "Cannot establish signal handlers"
msgstr "Nelze ustanovit ovladač signálu"
#: src/xz/message.c:808
msgid "No integrity check; not verifying file integrity"
msgstr "Žádná kontrola integrity; integrita souboru se nebude ověřovat"
#: src/xz/message.c:811
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr ""
"Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat"
#: src/xz/message.c:818
msgid "Memory usage limit reached"
msgstr "Dosaženo omezení použitelné paměti"
#: src/xz/message.c:821
msgid "File format not recognized"
msgstr "Formát souboru nebyl rozpoznán"
#: src/xz/message.c:824
msgid "Unsupported options"
msgstr "Nepodporovaná volba"
#: src/xz/message.c:827
msgid "Compressed data is corrupt"
msgstr "Komprimovaná data jsou poškozená"
#: src/xz/message.c:830
msgid "Unexpected end of input"
msgstr "Neočekávaný konec vstupu"
#: src/xz/message.c:881
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "Je vyžadováno %s MiB paměti. Limit je %s."
#: src/xz/message.c:1048
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s: Omezující filtr: %s\n"
#: src/xz/message.c:1058
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Zkuste „%s --help“ pro více informací"
#: src/xz/message.c:1084
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .xz format.\n"
"\n"
msgstr ""
"Použití: %s [PŘEPÍNAČ]... [SOUBOR]...\n"
"Komprimuje nebo dekomprimuje SOUBORy ve formátu xz.\n"
"\n"
#: src/xz/message.c:1091
msgid ""
"Mandatory arguments to long options are mandatory for short options too.\n"
msgstr ""
"Povinné argumenty pro dlouhé přepínače jsou povinné rovněž pro krátké "
"přepínače.\n"
#: src/xz/message.c:1095
msgid " Operation mode:\n"
msgstr "Operační režim:\n"
#: src/xz/message.c:1098
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list information about .xz files"
msgstr ""
" -z, --compress provést komprimaci\n"
" -d, --decompress provést dekomprimaci\n"
" -t, --test testovat integritu komprimovaného souboru\n"
" -l, --list vypsat informace o souborech .xz"
#: src/xz/message.c:1104
msgid ""
"\n"
" Operation modifiers:\n"
msgstr ""
"\n"
"Modifikátory operací:\n"
#: src/xz/message.c:1107
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"
msgstr ""
" -k, --keep zachovat (nemazat) vstupní soubory\n"
" -f, --force vynutit přepis výstupního souboru a de/komprimovat "
"odkazy\n"
" -c, --stdout zapisovat na standardní výstup a nemazat vstupní "
"soubory"
#: src/xz/message.c:1113
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline "
"character\n"
" --files0[=FILE] like --files but use the null character as terminator"
msgstr ""
" --no-sparse nevytvářet při dekomprimaci soubory řídkých matic\n"
" -S, --suffix=.PRIP použít u komprimovaných souborů příponu „.PRIP“\n"
" --files[=SOUBOR] číst názvy souborů, které se mají zpracovat, ze "
"SOUBORu;\n"
" pokud není SOUBOR zadán, čte se ze standardního "
"vstupu;\n"
" názvy souborů musí být zakončeny znakem nového řádku\n"
" --files0[=SOUBOR] stejné jako --files, ale použít k zakončování nulový "
"znak"
#: src/xz/message.c:1121
msgid ""
"\n"
" Basic file format and compression options:\n"
msgstr ""
"\n"
"Základní přepínače pro formát souboru a komprimaci:\n"
#: src/xz/message.c:1123
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
" -F, --format=FORMÁT formát souboru k zakódování nebo dekódování; možné\n"
" hodnoty jsou „auto“ (výchozí), „xz“, „lzma“ a „raw“\n"
" -C, --check=KONTROLA typ kontroly integrity: „none“ (používejte s "
"rozmyslem),\n"
" „crc32“, „crc64“ (výchozí) nebo „sha256“"
#: src/xz/message.c:1130
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor "
"*and*\n"
" decompressor memory usage into account before using "
"7-9!"
msgstr ""
" -0 .. -9 přednastavení komprimace; výchozí je 6; než "
"použijete\n"
" hodnoty 7 9, vezměte do úvahy množství použité "
"paměti"
#: src/xz/message.c:1134
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU "
"time;\n"
" does not affect decompressor memory requirements"
msgstr ""
" -e, --extreme zkusit zlepšit poměr komprimace využitím více času\n"
" procesoru; nemá vliv na paměťové nároky dekomprimace"
#: src/xz/message.c:1139
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" set memory usage limit for compression, "
"decompression,\n"
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
msgstr ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" nastaví omezení použitelné paměti pro komprimaci,\n"
" dekomprimaci nebo obojí; LIMIT je v bajtech, % z "
"paměti\n"
" RAM nebo 0 pro výchozí"
#: src/xz/message.c:1146
msgid ""
" --no-adjust if compression settings exceed the memory usage "
"limit,\n"
" give an error instead of adjusting the settings "
"downwards"
msgstr ""
" --no-adjust pokud nastavení komprimace přesáhne omezení "
"použitelné\n"
" paměti, předat chybu namísto snížení nastavení"
#: src/xz/message.c:1152
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
msgstr ""
"\n"
"Vlastní omezující filtr pro komprimaci (alternativa k použití "
"přednastavených):"
#: src/xz/message.c:1161
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
"or\n"
" --lzma2[=OPTS] more of the following options (valid values; "
"default):\n"
" preset=PRE reset options to a preset (0-9[e])\n"
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM number of literal context bits (0-4; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (fast, normal; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; "
"bt4)\n"
" depth=NUM maximum search depth; 0=automatic "
"(default)"
msgstr ""
"\n"
" --lzma1[=VOLBY] LZMA1 nebo LZMA2; VOLBY je čárkou oddělovaný seznam "
"žádné\n"
" --lzma2[=VOLBY] nebo více následujících voleb (platné hodnoty; "
"výchozí):\n"
" preset=PŘE změnit volby na PŘEdnastavené (0 9"
"[e])\n"
" dict=POČ velikost slovníku (4 KiB 1536 MiB; 8 "
"MiB)\n"
" lc=POČ počet kontextových bitů literálu (0 4; "
"3)\n"
" lp=POČ počet pozičních bitů literálu (0 4; "
"0)\n"
" pb=POČ počet pozičních bitů (0 4; 2)\n"
" mode=REŽIM režim komprimace (fast, normal; normal)\n"
" nice=NUM příznivá délka shody (2 273; 64)\n"
" mf=NÁZEV hledání shod (hc3, hc4, bt2, bt3, bt4; "
"bt4)\n"
" depth=POČ maximální hloubka prohledávání;\n"
" 0 = automaticky (výchozí)"
#: src/xz/message.c:1176
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
"\n"
" --x86[=VOLBY] Filtr x86 BCJ (32bitový a 64bitový)\n"
" --powerpc[=VOLBY] Filtr PowerPC BCJ (pouze big endian)\n"
" --ia64[=VOLBY] Filtr IA64 (Itanium) BCJ\n"
" --arm[=VOLBY] Filtr ARM BCJ (pouze little endian)\n"
" --armthumb[=VOLBY] Filtr ARM-Thumb BCJ (pouze little endian)\n"
" --sparc[=VOLBY] Filtr SPARC BCJ\n"
" Platné volby pro všechny filtry BCJ:\n"
" start=POČ počáteční posun pro převody (výchozí=0)"
#: src/xz/message.c:1188
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"
msgstr ""
"\n"
" --delta[=VOLBY] Filtr Delta; platné VOLBY (platné hodnoty; výchozí):\n"
" dist=POČ vzdálenost mezi bajty, které jsou "
"odečítány\n"
" jeden od druhého (1 256; 1)"
#: src/xz/message.c:1196
msgid ""
"\n"
" Other options:\n"
msgstr ""
"\n"
" Ostatní přepínače:\n"
#: src/xz/message.c:1199
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors "
"too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
msgstr ""
" -q, --quiet potlačit varování; zadáním dvakrát, potlačíte i "
"chyby\n"
" -v, --verbose podrobnější zprávy; zadáním dvakrát, budou ještě\n"
" podrobnější"
#: src/xz/message.c:1204
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn způsobí, že varování neovlivní stav ukončení"
#: src/xz/message.c:1206
msgid ""
" --robot use machine-parsable messages (useful for scripts)"
msgstr ""
" --robot použít strojově analyzovatelné zprávy (užitečné pro\n"
" skripty)"
#: src/xz/message.c:1209
msgid ""
" --info-memory display the total amount of RAM and the currently "
"active\n"
" memory usage limits, and exit"
msgstr ""
" --info-memory zobrazit celkové množství paměti RAM a současné "
"aktivní\n"
" omezení použitelné paměti a skončit"
#: src/xz/message.c:1212
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
msgstr ""
" -h, --help zobrazit krátkou nápovědu (vypíše jen základní "
"přepínače)\n"
" -H, --long-help zobrazit tuto úplnou nápovědu a skončit"
#: src/xz/message.c:1216
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
msgstr ""
" -h, --help zobrazit tuto zkrácenou nápovědu a skončit\n"
" -H, --long-help zobrazit úplnou nápovědu (vypíše i pokročilé "
"přepínače)"
#: src/xz/message.c:1221
msgid " -V, --version display the version number and exit"
msgstr " -V, --version zobrazit číslo verze a skončit"
#: src/xz/message.c:1223
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
"\n"
"Pokud SOUBOR není zadán nebo pokud je -, bude se číst ze standardního "
"vstupu.\n"
#. TRANSLATORS: This message indicates the bug reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1229
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr "Chyby hlaste na <%s> (v angličtině nebo finštině).\n"
#: src/xz/message.c:1231
#, c-format
msgid "%s home page: <%s>\n"
msgstr "Domovská stránka %s: <%s>\n"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s: Volby musí být páry „název=hodnota“ oddělené čárkami"
#: src/xz/options.c:93
#, c-format
msgid "%s: Invalid option name"
msgstr "%s: Neplatný název volby"
#: src/xz/options.c:113
#, c-format
msgid "%s: Invalid option value"
msgstr "%s: Neplatná hodnota volby"
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "Nepodporované přednastavení LZMA1/LZMA2: %s"
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "Součet lc a lp nesmí překročit hodnotu 4"
#: src/xz/options.c:359
#, c-format
msgid "The selected match finder requires at least nice=%<PRIu32>"
msgstr "Vybraný vyhledávač shod vyžaduje minimálně nice=%<PRIu32>"
#: src/xz/suffix.c:79 src/xz/suffix.c:164
#, c-format
msgid ""
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr ""
"%s: S přepínačem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do "
"standardního výstupu"
#: src/xz/suffix.c:99
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Název souboru má neznámou příponu, vynechává se"
#: src/xz/suffix.c:154
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Soubor již má příponu „%s“, vynechává se"
#: src/xz/suffix.c:205
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Neplatná přípona názvu souboru"
#: src/xz/util.c:61
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s: Hodnota není nezáporné desítkové číslo"
#: src/xz/util.c:103
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s: Neplatná jednotka s předponou"
#: src/xz/util.c:105
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgstr ""
"Platné jednotky s předponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a "
"„GiB“ (2^30 B)."
#: src/xz/util.c:122
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "Hodnota volby „%s“ musí být v rozsahu [%<PRIu64>, %<PRIu64>]"
#: src/xz/util.c:247
msgid "Empty filename, skipping"
msgstr "Prázdný název souboru, vynechává se"
#: src/xz/util.c:261
msgid "Compressed data cannot be read from a terminal"
msgstr "Z terminálu nelze číst komprimovaná data"
#: src/xz/util.c:274
msgid "Compressed data cannot be written to a terminal"
msgstr "Do terminálu nelze zapisovat komprimovaná data"
#: src/common/tuklib_exit.c:39
msgid "Writing to standard output failed"
msgstr "Zápis do standardního výstupu selhal"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Neznámá chyba"
#~ msgid "Limit was %s MiB, but %s MiB would have been needed"
#~ msgstr "Limit byl %s MiB, ale bylo by zapotřebí %s MiB"
#~ msgid "%s MiB (%s bytes)\n"
#~ msgstr "%s MiB (%s bajtů)\n"
#~ msgid ""
#~ " -e, --extreme use more CPU time when encoding to increase "
#~ "compression\n"
#~ " ratio without increasing memory usage of the decoder"
#~ msgstr ""
#~ " -e, --extreme využít více procesorového času pro kódování, čímž "
#~ "se\n"
#~ " zvýší kompresní poměr bez zvýšení paměti použité "
#~ "kodérem"
#~ msgid ""
#~ " -M, --memory=NUM use roughly NUM bytes of memory at maximum; 0 "
#~ "indicates\n"
#~ " the default setting, which is 40 % of total RAM"
#~ msgstr ""
#~ " -M, --memory=POČ použít zhruba POČ bajtů paměti jako maximum; 0 "
#~ "znamená\n"
#~ " výchozí nastavení, což je 40% celkového množství "
#~ "paměti"
#~ msgid ""
#~ "\n"
#~ " --subblock[=OPTS] Subblock filter; valid OPTS (valid values; "
#~ "default):\n"
#~ " size=NUM number of bytes of data per subblock\n"
#~ " (1 - 256Mi; 4Ki)\n"
#~ " rle=NUM run-length encoder chunk size (0-256; "
#~ "0)"
#~ msgstr ""
#~ "\n"
#~ " --subblock[=VOLBY] Subblokový filtr; platné VOLBY (platné hodnoty; "
#~ "výchozí):\n"
#~ " size=POČ počet bajtů dat na subblok\n"
#~ " (1 - 256 Mi; 4 Ki)\n"
#~ " rle=POČ velikost dávky pro kodér run-length "
#~ "(0-256; 0)"
#~ msgid ""
#~ "On this system and configuration, this program will use a maximum of "
#~ "roughly\n"
#~ "%s MiB RAM and "
#~ msgstr ""
#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze "
#~ "zhruba\n"
#~ "%s MiB RAM a "
#~ msgid ""
#~ "one thread.\n"
#~ "\n"
#~ msgstr ""
#~ "jedno vlákno.\n"
#~ "\n"
#~ msgid "%s: Invalid multiplier suffix. Valid suffixes:"
#~ msgstr "%s: Neplatná přípona. Platné přípony jsou:"

903
po/de.po Normal file
View File

@@ -0,0 +1,903 @@
# XZ Utils German translation
# This file is put in the public domain.
# Andre Noll <maan@systemlinux.org>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: XZ Utils 4.999.9beta\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2010-09-11 17:07+0200\n"
"PO-Revision-Date: 2010-09-07 20:27+0200\n"
"Last-Translator: <maan@systemlinux.org>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Unbekanntes file format"
#: 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: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: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:95
msgid "Maximum number of filters is four"
msgstr "Maximal vier Filter möglich"
#: 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:129
msgid "Using a preset in raw mode is discouraged."
msgstr "Verwendung der Voreinstellung im raw Modus wird nicht empfohlen."
#: 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:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Das .lzma Format unterstützt nur den LZMA1 Filter"
#: 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:182
msgid "Unsupported filter chain or filter options"
msgstr "Optionen nicht unterstützt"
#: 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: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 ""
"Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das "
"Speicher Nutzungslimit von %s MiB zu übersteigen"
#. TRANSLATORS: When compression or decompression finishes,
#. and xz is going to remove the source file, xz first checks
#. if the source file still exists, and if it does, does its
#. device and inode numbers match what xz saw when it opened
#. the source file. If these checks fail, this message is
#. shown, %s being the filename, and the file is not deleted.
#. The check for device and inode numbers is there, because
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c: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:144 src/xz/file_io.c:590
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: Kann nicht löschen: %s"
#: 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:175
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: Kann Datei Gruppe nicht setzen: %s"
#: 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: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:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Überspringe Verzeichnis"
#: src/xz/file_io.c:462
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: Keine reguläre Datei, überspringe"
#: src/xz/file_io.c:479
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: Datei hat das setuid oder setgid Bit gesetzt, überspringe"
#: src/xz/file_io.c:486
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Datei hat sticky Bit gesetzt, überspringe"
#: src/xz/file_io.c:493
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: Eingabedatei hat mehr als einen hard link, überspringe"
#: src/xz/file_io.c:714
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr ""
"Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
#: src/xz/file_io.c:726
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: Fehler beim Schießen der Datei: %s"
#: src/xz/file_io.c:762 src/xz/file_io.c:946
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr ""
"%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
#: src/xz/file_io.c:821
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Lesefehler: %s"
#: src/xz/file_io.c:844
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
#: src/xz/file_io.c:854
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: Unerwartetes Ende der Datei"
#: src/xz/file_io.c:904
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Schreibfehler: %s"
#: 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:119
msgid "Total amount of physical memory (RAM): "
msgstr "Gesamtmenge physikalischer Speicher (RAM): "
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Speicher Nutzungslimit für Kompression: "
#: 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:62
msgid "None"
msgstr "Kein"
#. TRANSLATORS: Indicates that integrity check name is not known,
#. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter.
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Unbek.2"
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Unbek.3"
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Unbek.5"
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Unbek.6"
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Unbek.7"
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Unbek.8"
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Unbek.9"
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Unbek.11"
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Unbek.12"
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Unbek.13"
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Unbek.14"
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Unbek.15"
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s: Datei ist leer"
#: 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"
#. TRANSLATORS: These are column headings. From Strms (Streams)
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:612
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr " Str. Blöcke Kompr. Unkompr. Verh. Check Dateiname"
#: src/xz/list.c:652
#, c-format
msgid " Streams: %s\n"
msgstr " Ströme: %s\n"
#: src/xz/list.c:654
#, c-format
msgid " Blocks: %s\n"
msgstr " Blöcke: %s\n"
#: src/xz/list.c:656
#, c-format
msgid " Compressed size: %s\n"
msgstr " Größe komprimiert: %s\n"
#: src/xz/list.c:659
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Größe unkomprimiert: %s\n"
#: src/xz/list.c:662
#, c-format
msgid " Ratio: %s\n"
msgstr " Verhältnis: %s\n"
#: src/xz/list.c:664
#, c-format
msgid " Check: %s\n"
msgstr " Check: %s\n"
#: src/xz/list.c:665
#, c-format
msgid " Stream padding: %s\n"
msgstr " Strom Auffüllung: %s\n"
#. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz".
#: src/xz/list.c:693
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize "
"UncompSize Ratio Check Padding"
msgstr ""
" Ströme:\n"
" Strom Blöcke KompOffset UnkompOffset KompGröße "
"UnkompGröße Verh. Check Auffüllung"
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:748
#, c-format
msgid ""
" Blocks:\n"
" Stream Block CompOffset UncompOffset TotalSize "
"UncompSize Ratio Check"
msgstr ""
" Blöcke:\n"
" Strom Block KompOffset UnkompOffset TotalGröße "
"UnkompGröße Verh. Check"
#. TRANSLATORS: These are additional column headings
#. for the most verbose listing mode. CheckVal
#. (Check value), Flags, and Filters are left aligned.
#. Header (Block Header Size), CompSize, and MemUsage
#. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz".
#: src/xz/list.c:760
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " CheckWert %*s Kopf Schalter KompGröße Speicher Filter"
#: src/xz/list.c:838 src/xz/list.c:1007
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Benötigter Speicher: %s MiB\n"
#: src/xz/list.c:840 src/xz/list.c:1009
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Größe in Köpfen: %s\n"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "Yes"
msgstr "Ja"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "No"
msgstr "Nein"
#. 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
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s Datei\n"
msgstr[1] "%s Dateien\n"
#: src/xz/list.c:999
msgid "Totals:"
msgstr "Gesamt:"
#: src/xz/list.c:1000
#, c-format
msgid " Number of files: %s\n"
msgstr " Anzahl Dateien: %s\n"
#: src/xz/list.c:1072
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr ""
"--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)"
#: src/xz/list.c:1078
msgid "--list does not support reading from standard input"
msgstr "--list unterstützt kein Lesen der Standardeingabe"
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s: Unerwartetes Ende beim Lesen der Dateinamen"
#: src/xz/main.c:120
#, c-format
msgid ""
"%s: Null character found when reading filenames; maybe you meant to use `--"
"files0' instead of `--files'?"
msgstr ""
"%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--"
"files0' statt `--files'?"
#: src/xz/main.c:174
msgid "Compression and decompression with --robot are not supported yet."
msgstr "Kompression und Dekompression mit --robot ist noch nicht unterstützt."
#: src/xz/main.c:231
msgid ""
"Cannot read data from standard input when reading filenames from standard "
"input"
msgstr ""
"Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von "
"der Standardeingabe gelesen werden"
#: src/xz/message.c:800 src/xz/message.c:844
msgid "Internal error (bug)"
msgstr "Interner Fehler (Bug)"
#: src/xz/message.c:807
msgid "Cannot establish signal handlers"
msgstr "Kann Signal Routine nicht setzen"
#: src/xz/message.c:816
msgid "No integrity check; not verifying file integrity"
msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen"
#: src/xz/message.c:819
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr ""
"Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht "
"überprüfen"
#: src/xz/message.c:826
msgid "Memory usage limit reached"
msgstr "Speicher-Limit erreicht"
#: src/xz/message.c:829
msgid "File format not recognized"
msgstr "Datei Format nicht erkannt"
#: src/xz/message.c:832
msgid "Unsupported options"
msgstr "Optionen nicht unterstützt"
#: src/xz/message.c:835
msgid "Compressed data is corrupt"
msgstr "Komprimierte Daten sind korrupt"
#: src/xz/message.c:838
msgid "Unexpected end of input"
msgstr "Unerwartetes Eingabe Ende"
#: src/xz/message.c:886
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "%s MiB Speicher wird benötigt. Limit ist %s."
#: src/xz/message.c:1053
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s: Filter Kette: %s\n"
#: src/xz/message.c:1063
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Versuchen Sie `%s --help' für mehr Informationen."
#: src/xz/message.c:1089
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .xz format.\n"
"\n"
msgstr ""
"Benutzung: %s [OPTION]... [DATEI]...\n"
"Komprimiert oder dekomprimiert .xz DATEI(EN).\n"
"\n"
#: src/xz/message.c:1096
msgid ""
"Mandatory arguments to long options are mandatory for short options too.\n"
msgstr ""
"Obligatorische Argumente für lange Optionen sind auch für kurze Optionen\n"
"zwingend.\n"
#: src/xz/message.c:1100
msgid " Operation mode:\n"
msgstr " Operationsmodus:\n"
#: src/xz/message.c:1103
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list information about .xz files"
msgstr ""
" -z, --compress erzwinge Komprimierung\n"
" -d, --decompress erzwinge Dekomprimierung\n"
" -t, --test überprüfe Datei Integrität\n"
" -l, --list liste Datei Informationen"
#: src/xz/message.c:1109
msgid ""
"\n"
" Operation modifiers:\n"
msgstr ""
"\n"
" Operationsmodifikatoren:\n"
#: src/xz/message.c:1112
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"
msgstr ""
" -k, --keep Eingabedateien beibehalten (nicht löschen)\n"
" -f, --force erzwinge Überschreiben der Ausgabedatei und\n"
" (de)komprimiere Verweise (Links)\n"
" -c, --stdout schreibe nach Standard Output und lösche nicht die\n"
" Eingabedateien"
#: src/xz/message.c:1118
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline "
"character\n"
" --files0[=FILE] like --files but use the null character as terminator"
msgstr ""
" --no-sparse erzeuge keine sparse Datei beim Dekomprimieren\n"
" -S, --suffix=.SUF benutze `.SUF' Endung für komprimierte Dateien\n"
" --files=[DATEI] lese zu verarbeitende Dateinamen von DATEI; falls\n"
" DATEI nicht angegeben wurde, werden Dateinamen\n"
" von Standard Input gelesen. Dateinamen müssen mit\n"
" einem Zeilenumbruch voneinander getrennt werden\n"
" --files0=[DATEI] wie --files, aber benutze den Null Charakter als "
"Trenner"
#: src/xz/message.c:1126
msgid ""
"\n"
" Basic file format and compression options:\n"
msgstr ""
"\n"
" Grundlegende Optionen für Dateiformat und Kompression:\n"
#: src/xz/message.c:1128
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
" -F, --format=FMT Dateiformat zur Kodierung oder Dekodierung; "
"mögliche\n"
" Werte sind `auto' (Voreinstellung), `xz', `lzma' "
"und\n"
" `raw'\n"
" -C, --check=CHECK Typ des Integritätschecks: `none' (Vorsicht), "
"`crc32',\n"
" `crc64' (Voreinstellung), oder `sha256'"
#: src/xz/message.c:1135
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor "
"*and*\n"
" decompressor memory usage into account before using 7-"
"9!"
msgstr ""
" -0 .. -9 Kompressionseinstellung; Voreinstellung is 6. "
"Beachten\n"
" Sie den Speicherverbrauch des Komprimieres *und* "
"des\n"
" Dekomprimierers, wenn Sie 7-9 benutzen!"
#: src/xz/message.c:1139
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU "
"time;\n"
" does not affect decompressor memory requirements"
msgstr ""
" -e, --extreme Versuche durch stärkere CPU Nutzung das "
"Kompressions-\n"
" verhältnis zu verbessern. Das beeinflusst nicht den\n"
" Speicherbedarf des Dekomprimierers."
#: src/xz/message.c:1144
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" set memory usage limit for compression, "
"decompression,\n"
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
msgstr ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT Setze Speicher Nutzungslimit für Kompression,\n"
" Dekompression, oder beides; LIMIT ist in bytes, % "
"RAM,\n"
" oder 0 für Grundeinstellungen."
#: src/xz/message.c:1151
msgid ""
" --no-adjust if compression settings exceed the memory usage "
"limit,\n"
" give an error instead of adjusting the settings "
"downwards"
msgstr ""
" --no-adjust Wenn die Kompressionseinstellungen das Speicher\n"
" Nutzungslimit übersteigen, erzeuge einen Fehler "
"statt\n"
" die Einstellungen nach unten anzupassen."
#: src/xz/message.c:1157
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
msgstr ""
"\n"
" User-definierte Filter Kette für Kompression (alternativ zu Voreinstellung):"
#: src/xz/message.c:1166
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
"or\n"
" --lzma2[=OPTS] more of the following options (valid values; "
"default):\n"
" preset=PRE reset options to a preset (0-9[e])\n"
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM number of literal context bits (0-4; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (fast, normal; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; "
"bt4)\n"
" depth=NUM maximum search depth; 0=automatic "
"(default)"
msgstr ""
"\n"
" --lzma1[=OPTIONEN] LZMA1 oder LZMA2; OPTIONEN ist eine durch Kommata\n"
" --lzma2[=OPTIONEN] getrennte Liste bestehend aus den folgenden "
"Optionen\n"
" (zulässige Werte; Voreinstellung):\n"
" preset=NUM Setze Optionen zurück zu "
"Voreinstellung\n"
" (0-9[e])\n"
" dict=NUM Wörterbuch Größe (4 KiB - 1536 MiB; 8 "
"MiB)\n"
" lc=NUM Anzahl der Literal Kontext Bits (0-4; "
"3)\n"
" lp=NUM Anzahl der Literal Positionsbits (0-4; "
"0)\n"
" pb=NUM Anzahl der Positionsbits (0-4; 2)\n"
" mode=MODUS Kompressionsmodus (fast, normal; "
"normal)\n"
" nice=NUM Nice-Länge eines Treffers (2-273; 64)\n"
" mf=NAME Algorithmus zum Auffinden von\n"
" Übereinstimmungen (hc3, hc4, bt2, bt3, "
"bt4;\n"
" bt4)\n"
" depth=NUM Maximale Suchtiefe; 0=automatisch\n"
" (Voreinstellung)"
#: src/xz/message.c:1181
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
"\n"
" --x86[=OPTIONEN] x86 BCJ Filter (32-bit und 64-bit)\n"
" --powerpc[=OPTIONEN] PowerPC BCJ Filter (nur big endian)\n"
" --ia64[=OPTIONEN] IA64 (Itanium) BCJ Filter\n"
" --arm[=OPTIONEN] ARM BCJ Filter (nur little endian)\n"
" --armthumb[=OPTIONEN] ARM-Thumb BCJ Filter (nur little endian)\n"
" --sparc[=OPTIONEN] SPARC BCJ Filter\n"
" Zulässige Optionen für alle BCJ Filter:\n"
" start=NUM Start-Offset für Konversion\n"
" (Voreinstellung=0)"
#: src/xz/message.c:1193
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"
msgstr ""
"\n"
" --delta[=OPTIONEN] Delta Filter; zulässige Optionen (gültige Werte;\n"
" Voreinstellung):\n"
" dist=NUM Abstand zwischen den Bytes, die "
"voneinander\n"
" subtrahiert werden (1-256; 1)"
#: src/xz/message.c:1201
msgid ""
"\n"
" Other options:\n"
msgstr ""
"\n"
" Andere Optionen:\n"
#: src/xz/message.c:1204
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors "
"too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
msgstr ""
" -q, --quiet unterdrücke Warnungen; benutze diese Option zweimal\n"
" um auch Fehlermeldungen zu unterdrücken\n"
" -v, --verbose sei gesprächig; benutze diese Option zweimal um "
"noch\n"
" gesprächiger zu sein"
#: src/xz/message.c:1209
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn Warnungen verändern nicht den exit status"
#: src/xz/message.c:1211
msgid ""
" --robot use machine-parsable messages (useful for scripts)"
msgstr ""
" --robot benutze Maschinen-lesbare Meldungen (nützlich für\n"
" Skripte)"
#: src/xz/message.c:1214
msgid ""
" --info-memory display the total amount of RAM and the currently "
"active\n"
" memory usage limits, and exit"
msgstr " --info-memory zeige Speicherlimit an und terminiere"
#: src/xz/message.c:1217
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
msgstr ""
" -h, --help zeige kurze Hilfe and (zeigt nur die grundlegenden\n"
" Optionen)\n"
" -H, --long-help zeige diese lange Hilfe an und terminiere"
#: src/xz/message.c:1221
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
msgstr ""
" -h, --help zeige diese kurze Hilfe an und terminiere\n"
" -H, --long-help zeige die lange Hilfe an (zeigt auch "
"fortgeschrittene\n"
" Optionen an)"
#: src/xz/message.c:1226
msgid " -V, --version display the version number and exit"
msgstr " -V, --version zeige Versionsnummer an und terminiere"
#: src/xz/message.c:1228
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
"\n"
"Wenn DATEI nicht angegeben wurde, oder DATEI gleich - ist, dann wird von\n"
"der Standardeingabe gelesen.\n"
#. TRANSLATORS: This message indicates the bug reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1234
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
"Melde Bugs an <%s> (in englisch oder finnisch).\n"
"Melde Übersetzungsfehler an <maan@systemlinux.org> (in englisch oder "
"deutsch).\n"
#: src/xz/message.c:1236
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s Homepage: <%s>\n"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr ""
"%s: Optionen müssen in der Form `Name=Wert` gegeben werden, getrennt durch "
"Kommata"
#: src/xz/options.c:93
#, c-format
msgid "%s: Invalid option name"
msgstr "%s: Ungültige Option"
#: src/xz/options.c:113
#, c-format
msgid "%s: Invalid option value"
msgstr "%s: Ungültiger Wert für Option"
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "LZMA1/LZMA2 Voreinstellung ist ungültig: %s"
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "Die Summe aus lc und lp darf höchstens 4 sein"
#: src/xz/options.c:359
#, c-format
msgid "The selected match finder requires at least nice=%<PRIu32>"
msgstr ""
"Der ausgewählte Algorithmus zum Auffinden von Übereinstimmungen braucht "
"mindestens nice=%<PRIu32>"
#: src/xz/suffix.c:79 src/xz/suffix.c:164
#, c-format
msgid ""
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr ""
"%s: Mit --format=raw ist --sufix=.SUF notwendig, falls nicht nach stdout "
"geschrieben wird"
#: src/xz/suffix.c:99
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Dateiname hat unbekannte Endung, überspringe"
#: src/xz/suffix.c:154
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Datei hat bereits `%s' Endung, überspringe"
#: src/xz/suffix.c:205
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Ungültige Datei Endung"
#: src/xz/util.c:61
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s: Wert ist keine nicht-negative ganze Zahl"
#: src/xz/util.c:103
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s: Ungültige Einheit"
#: src/xz/util.c:105
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgstr "Gültige Einheiten sind `KiB' (2^10), `MiB' (2^20), und `GiB' (2^30)."
#: src/xz/util.c:122
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "Wert der Option `%s' muss im Bereich [%<PRIu64>, %<PRIu64>] sein"
#: src/xz/util.c:247
msgid "Empty filename, skipping"
msgstr "Leere Dateiname, überspringe"
#: src/xz/util.c:261
msgid "Compressed data cannot be read from a terminal"
msgstr "Komprimierte Daten können nicht vom Terminal gelesen werden"
#: src/xz/util.c:274
msgid "Compressed data cannot be written to a terminal"
msgstr "Komprimierte Daten können nicht auf das Terminal geschrieben werden"
#: src/common/tuklib_exit.c:39
msgid "Writing to standard output failed"
msgstr "Schreiben auf die Standardausgabe fehlgeschlagen"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Unbekannter Fehler"

446
po/fi.po
View File

@@ -1,446 +0,0 @@
# translation of fi.po to Finnish
# This file is put in the public domain.
#
msgid ""
msgstr ""
"Project-Id-Version: fi\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2007-12-10 14:34+0200\n"
"PO-Revision-Date: 2007-08-09 22:14+0300\n"
"Last-Translator: Lasse Collin <lasse.collin@tukaani.org>\n"
"Language-Team: Finnish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/lzma/help.c:28
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Lisätietoja saa komennolla \"%s --help\"."
#: src/lzma/help.c:36
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .lzma format.\n"
"\n"
msgstr ""
"Käyttö: %s [VALITSIN]... [TIEDOSTO]...\n"
"Pakkaa tai purkaa .lzma-muotoiset TIEDOSTOt\n"
"\n"
#: src/lzma/help.c:40
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr "Pitkien valitsinten pakolliset argumentit ovat pakollisia myös lyhyille.\n"
#: src/lzma/help.c:44
msgid ""
" Operation mode:\n"
"\n"
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list block sizes, total sizes, and possible metadata\n"
msgstr ""
#: src/lzma/help.c:53
msgid ""
" Operation modifiers:\n"
"\n"
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files\n"
" -S, --suffix=.SUF use suffix `.SUF' on compressed files instead of `.lzma'\n"
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto', `native', `single', `multi', and `alone'\n"
" --files=[FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
" --files0=[FILE] like --files but use the nul byte as terminator\n"
msgstr ""
#: src/lzma/help.c:68
msgid ""
" Compression presets and basic compression options:\n"
"\n"
" -1 .. -2 fast compression\n"
" -3 .. -6 good compression\n"
" -7 .. -9 excellent compression, but needs a lot of memory;\n"
" default is -7 if memory limit allows\n"
"\n"
" -C, --check=CHECK integrity check type: `crc32', `crc64' (default),\n"
" or `sha256'\n"
msgstr ""
#: src/lzma/help.c:80
msgid ""
" Custom filter chain for compression (alternative for using presets):\n"
"\n"
" --lzma=[OPTS] LZMA filter; OPTS is a comma-separated list of zero or\n"
" more of the following options (valid values; default):\n"
" dict=NUM dictionary size in bytes (1 - 1Gi; 8Mi)\n"
" lc=NUM number of literal context bits (0-8; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (`fast' or `best'; `best')\n"
" fb=NUM number of fast bytes (5-273; 128)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" mfc=NUM match finder cycles; 0=automatic (default)\n"
"\n"
" --x86 x86 filter (sometimes called BCJ filter)\n"
" --powerpc PowerPC (big endian) filter\n"
" --ia64 IA64 (Itanium) filter\n"
" --arm ARM filter\n"
" --armthumb ARM-Thumb filter\n"
" --sparc SPARC filter\n"
"\n"
" --copy No filtering (useful only when specified alone)\n"
" --subblock=[OPTS] Subblock filter; valid OPTS (valid values; default):\n"
" size=NUM number of bytes of data per subblock\n"
" (1 - 256Mi; 4Ki)\n"
" rle=NUM run-length encoder chunk size (0-256; 0)\n"
msgstr ""
#: src/lzma/help.c:120
msgid ""
" Resource usage options:\n"
"\n"
" -M, --memory=NUM use roughly NUM bytes of memory at maximum\n"
" -T, --threads=NUM use at maximum of NUM (de)compression threads\n"
msgstr ""
#: src/lzma/help.c:129
msgid ""
" Other options:\n"
"\n"
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose\n"
"\n"
" -h, --help display this help and exit\n"
" -V, --version display version and license information and exit\n"
msgstr ""
#: src/lzma/help.c:137
msgid "With no FILE, or when FILE is -, read standard input.\n"
msgstr "Jos TIEDOSTOa ei ole annettu, tai se on \"-\", luetaan vakiosyötettä.\n"
#: src/lzma/help.c:143
msgid "On this system and configuration, the tool will use"
msgstr "Tässä järjestelmässä näillä asetuksilla, tämä työkalu käyttää"
#: src/lzma/help.c:144
#, c-format
msgid " * roughly %zu MiB of memory at maximum; and\n"
msgstr " * korkeintaan %zu MiB keskusmuistia (suurpiirteinen rajoitus); ja\n"
#: src/lzma/help.c:147
msgid ""
" * at maximum of one thread for (de)compression.\n"
"\n"
msgstr ""
" * korkeintaan yhtä säiettä pakkaukseen tai purkuun.\n"
"\n"
#: src/lzma/help.c:151
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
"Lähetä raportit ohjelmistovioista (englanniksi tai suomeksi)\n"
"osoitteeseen <%s>.\n"
#: src/lzma/args.c:128
msgid "Maximum number of filters is seven"
msgstr "Suotimia voi olla korkeintaan seitsemän"
#: src/lzma/args.c:193
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Virheellinen tiedostonimen pääte"
#: src/lzma/args.c:327
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Tuntematon tiedostomuodon tyyppi"
#: src/lzma/args.c:353
#, c-format
msgid "%s: Unknown integrity check type"
msgstr "%s: Tuntematon eheystarkisteen tyyppi"
#: src/lzma/args.c:371
msgid "Only one file can be specified with `--files'or `--files0'."
msgstr ""
#: src/lzma/args.c:421
msgid "The environment variable LZMA_OPT contains too many arguments"
msgstr "Ympäristömuuttuja LZMA_OPT sisältää liian monta argumenttia"
#: src/lzma/args.c:485
msgid "Memory usage limit is too small for any internal filter preset"
msgstr ""
#: src/lzma/args.c:500
msgid "Memory usage limit is too small for the given filter setup"
msgstr "Muistinkäyttörajoitus on liian pieni annetuille suodinasetusille"
#: src/lzma/error.c:35
msgid "Operation successful"
msgstr ""
#: src/lzma/error.c:38
msgid "Operation finished successfully"
msgstr ""
#: src/lzma/error.c:41 src/lzma/error.c:153
msgid "Internal error (bug)"
msgstr "Sisäinen virhe (bugi)"
#: src/lzma/error.c:44
msgid "Compressed data is corrupt"
msgstr "Pakattu data on korruptoitunut"
#: src/lzma/error.c:50
msgid "Unexpected end of input"
msgstr ""
#: src/lzma/error.c:53
msgid "Unsupported options"
msgstr ""
#: src/lzma/error.c:56
msgid "Unsupported integrity check type"
msgstr ""
#: src/lzma/error.c:87 src/lzma/error.c:93
#, c-format
msgid "Writing to standard output failed: %s"
msgstr ""
#: src/lzma/io.c:81
#, c-format
msgid "Cannot get file descriptor of the current directory: %s"
msgstr ""
#: src/lzma/io.c:123 src/lzma/util.c:127
#, c-format
msgid "%s: Invalid filename"
msgstr "%s: Virheellinen tiedostonimi"
#: src/lzma/io.c:130 src/lzma/io.c:233
#, c-format
msgid "Cannot change directory: %s"
msgstr "Hakemiston vaihtaminen epäonnistui: %s"
#: src/lzma/io.c:135
#, c-format
msgid "%s: File seems to be moved, not removing"
msgstr "%s: Tiedosto näyttää olevan siirretty, ei poisteta"
#: src/lzma/io.c:141
#, c-format
msgid "%s: Cannot remove: %s"
msgstr ""
#: src/lzma/io.c:164
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s: Tiedoston omistajuuden asetus epäonnistui: %s"
#: src/lzma/io.c:170
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: Tiedoston ryhmän asetus epäonnistui: %s"
#: src/lzma/io.c:189
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s: Tiedoston oikeuksien asetus epäonnistui: %s"
#: src/lzma/io.c:252
#, c-format
msgid "%s: Cannot open the directory containing the file: %s"
msgstr ""
#: src/lzma/io.c:313
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s: Symbolinen linkki, ohitetaan"
#: src/lzma/io.c:330
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Hakemisto, ohitetaan"
#: src/lzma/io.c:337 src/lzma/list.c:445
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: Ei ole tavallinen tiedosto, ohitetaan"
#: src/lzma/io.c:348
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: Tiedostolla on setuid- tai setgid-bitti asetettuna, ohitetaan"
#: src/lzma/io.c:355
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Tiedostolla on sticky-bitti asetettuna, ohitetaan"
#: src/lzma/io.c:362
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: Tiedostoon viittaa useampi kuin yksi linkki, ohitetaan"
#: src/lzma/io.c:390 src/lzma/io.c:468
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: Tiedoston sulkeminen epäonnistui: %s"
#: src/lzma/io.c:611
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Lukeminen epäonnistui: %s"
#: src/lzma/io.c:654
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Kirjoitus epäonnistui: %s"
#: src/lzma/list.c:451
#, c-format
msgid "%s: File is empty"
msgstr ""
#: src/lzma/main.c:57
msgid "Cannot establish signal handlers"
msgstr "Signaalikäsittelijöiden asetus epäonnistui"
#: src/lzma/main.c:75
msgid "Compressed data not read from a terminal."
msgstr "Pakattua dataa ei lueta päätteeltä."
#: src/lzma/main.c:77 src/lzma/main.c:92
msgid "Use `--force' to force decompression."
msgstr "Käytä valitsinta \"--force\" pakottaaksesi purun."
#: src/lzma/main.c:90
msgid "Compressed data not written to a terminal."
msgstr "Pakattua dataa ei kirjoiteta päätteelle."
#: src/lzma/main.c:117
#, fuzzy, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s: Tiedoston sulkeminen epäonnistui: %s"
#: src/lzma/main.c:122
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr ""
#: src/lzma/main.c:212
msgid "Cannot read data from standard input when reading filenames from standard input"
msgstr "Dataa ei voida lukea oletussyötteestä, kun tiedostonimiä luetaan oletussyötteestä"
#: src/lzma/options.c:83
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s: Asetusten tulee olla \"nimi=arvo\"-pareja, jotka on eroteltu pilkuilla"
#: src/lzma/options.c:111
#, c-format
msgid "%s: Invalid option value"
msgstr "%s: Virheellinen asetuksen arvo"
#: src/lzma/options.c:124
#, c-format
msgid "%s: Invalid option name"
msgstr "%s: Virheellinen asetuksen nimi"
#: src/lzma/process.c:142
#, c-format
msgid "Cannot create a thread: %s"
msgstr "Säikeen luonti epäonnistui: %s"
#: src/lzma/suffix.c:85
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Tiedostonimellä on tuntematon pääte, ohitetaan"
#: src/lzma/suffix.c:114
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Tiedostolla on jo \"%s\"-pääte, ohitetaan"
#: src/lzma/util.c:44
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr ""
#: src/lzma/util.c:84
#, c-format
msgid "%s: Invalid multiplier suffix. Valid suffixes:"
msgstr ""
#: src/lzma/util.c:105
#, c-format
msgid "Value of the option `%s' must be in the range [%llu, %llu]"
msgstr "Asetuksen \"%s\" arvon tulee olla välillä [%llu, %llu]"
#: src/lzma/util.c:177
msgid "Empty filename, skipping"
msgstr "Tyhjä tiedostonimi, ohitetaan"
#: lib/getopt.c:531 lib/getopt.c:547
#, c-format
msgid "%s: option `%s' is ambiguous\n"
msgstr ""
#: lib/getopt.c:580 lib/getopt.c:584
#, c-format
msgid "%s: option `--%s' doesn't allow an argument\n"
msgstr ""
#: lib/getopt.c:593 lib/getopt.c:598
#, c-format
msgid "%s: option `%c%s' doesn't allow an argument\n"
msgstr ""
#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995
#, c-format
msgid "%s: option `%s' requires an argument\n"
msgstr ""
#: lib/getopt.c:698 lib/getopt.c:701
#, c-format
msgid "%s: unrecognized option `--%s'\n"
msgstr ""
#: lib/getopt.c:709 lib/getopt.c:712
#, c-format
msgid "%s: unrecognized option `%c%s'\n"
msgstr ""
#: lib/getopt.c:764 lib/getopt.c:767
#, c-format
msgid "%s: illegal option -- %c\n"
msgstr ""
#: lib/getopt.c:773 lib/getopt.c:776
#, c-format
msgid "%s: invalid option -- %c\n"
msgstr "%s: virheellinen valitsin -- %c\n"
#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr ""
#: lib/getopt.c:897 lib/getopt.c:913
#, c-format
msgid "%s: option `-W %s' is ambiguous\n"
msgstr ""
#: lib/getopt.c:937 lib/getopt.c:955
#, c-format
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr ""

902
po/it.po Normal file
View File

@@ -0,0 +1,902 @@
# Italian translation for xz-utils
# 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.
msgid ""
msgstr ""
"Project-Id-Version: xz-utils\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2010-09-10 14:50+0300\n"
"PO-Revision-Date: 2010-09-16 21:32+0200\n"
"Last-Translator: Milo Casagrande <milo@ubuntu.com>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-08-16 19:16+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: tipo di formato del file sconosciutoN"
#: 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: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: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:95
msgid "Maximum number of filters is four"
msgstr "Il numero massimo di filtri è quattro"
#: 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."
#: 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: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:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Il formato .lzma supporta solo il filtro LZMA1"
#: 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:182
msgid "Unsupported filter chain or filter options"
msgstr "Catena di filtri od opzioni del filtro non supportata"
#: 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: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 ""
"Regolata la dimensione del dizionario LZMA%c da %s MiB a %s MiB per non "
"superare il limite dell'uso della memoria di %s MiB"
#. TRANSLATORS: When compression or decompression finishes,
#. and xz is going to remove the source file, xz first checks
#. if the source file still exists, and if it does, does its
#. device and inode numbers match what xz saw when it opened
#. the source file. If these checks fail, this message is
#. shown, %s being the filename, and the file is not deleted.
#. The check for device and inode numbers is there, because
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c: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:144 src/xz/file_io.c:590
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: impossibile rimuovere: %s"
#: 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: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: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: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:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: è una directory, viene saltata"
#: src/xz/file_io.c:462
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: non è un file regolare, viene saltato"
#: src/xz/file_io.c:479
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: il file ha il bit setuid o setgid impostato, viene saltato"
#: src/xz/file_io.c:486
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: il file ha lo sticky bit impostato, viene saltato"
#: src/xz/file_io.c:493
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: il file di input ha più di un collegamento fisico, viene saltato"
#: src/xz/file_io.c:714
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "Errore nel ripristinare la flag O_APPEND sullo standard output: %s"
#: src/xz/file_io.c:726
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: chiusura del file non riuscita: %s"
#: src/xz/file_io.c:762 src/xz/file_io.c:946
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr ""
"%s: posizionamento non riuscito nel tentativo di creare un file sparso: %s"
#: src/xz/file_io.c:821
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: errore di lettura: %s"
#: src/xz/file_io.c:844
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: errore nel cercare il file: %s"
#: src/xz/file_io.c:854
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: fine del file inaspettata"
#: src/xz/file_io.c:904
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: errore di scrittura: %s"
#: 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:119
msgid "Total amount of physical memory (RAM): "
msgstr "Quantità totale di memoria fisica (RAM): "
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Limite utilizzo memoria per la compressione: "
#: 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
msgid "None"
msgstr "Nessuno"
#. TRANSLATORS: Indicates that integrity check name is not known,
#. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter.
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Sconosc2"
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Sconosc3"
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Sconosc5"
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Sconosc6"
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Sconosc7"
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Sconosc8"
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Sconosc9"
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Sconosc11"
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Sconosc12"
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Sconosc13"
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Sconosc14"
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Sconosc15"
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s: il file è vuoto"
#: 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"
#. TRANSLATORS: These are column headings. From Strms (Streams)
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:612
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr " Strm Blocc. Compresso Estratto Rapp. Contr Nome file"
#: src/xz/list.c:652
#, c-format
msgid " Streams: %s\n"
msgstr " Stream: %s\n"
#: src/xz/list.c:654
#, c-format
msgid " Blocks: %s\n"
msgstr " Blocchi: %s\n"
#: src/xz/list.c:656
#, c-format
msgid " Compressed size: %s\n"
msgstr " Dim. compresso: %s\n"
#: src/xz/list.c:659
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Dim. estratto: %s\n"
#: src/xz/list.c:662
#, c-format
msgid " Ratio: %s\n"
msgstr " Rapporto: %s\n"
#: src/xz/list.c:664
#, c-format
msgid " Check: %s\n"
msgstr " Controllo: %s\n"
#: src/xz/list.c:665
#, c-format
msgid " Stream padding: %s\n"
msgstr " Padding dello stream: %s\n"
#. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz".
#: src/xz/list.c:693
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize "
"UncompSize Ratio Check Padding"
msgstr ""
"Stream:\n"
" Stream Blocc. Offset comp. Offset estr. Dim. comp. Dim. "
"estratto Rapp. Contr Padding"
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:748
#, c-format
msgid ""
" Blocks:\n"
" Stream Block CompOffset UncompOffset TotalSize "
"UncompSize Ratio Check"
msgstr ""
" Blocchi:\n"
" Stream Blocc. Offset comp. Offset estratto Dim. tot. Dim. "
"estratto Rapp. Contr"
#. TRANSLATORS: These are additional column headings
#. for the most verbose listing mode. CheckVal
#. (Check value), Flags, and Filters are left aligned.
#. Header (Block Header Size), CompSize, and MemUsage
#. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz".
#: src/xz/list.c:760
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " Val.cont %*s Header Flag Dim.compr. Uso mem. Filtri"
#: src/xz/list.c:838 src/xz/list.c:1007
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Memoria necessaria: %s MiB\n"
#: src/xz/list.c:840 src/xz/list.c:1009
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Dim. negli header: %s\n"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "Yes"
msgstr "Sì"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "No"
msgstr "No"
#. 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
#, 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
msgid "Totals:"
msgstr "Totali:"
#: src/xz/list.c:1000
#, c-format
msgid " Number of files: %s\n"
msgstr " Numero di file: %s\n"
#: src/xz/list.c:1072
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list funziona solamente con file .xz (--format=xz o --format=auto)"
#: src/xz/list.c:1078
msgid "--list does not support reading from standard input"
msgstr "--list non è in grado di leggere dallo standard input"
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s: errore nel leggere i nomi dei file: %s"
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s: fine dell'input durante la lettura dei nomi dei file non attesa"
#: src/xz/main.c:120
#, c-format
msgid ""
"%s: Null character found when reading filenames; maybe you meant to use `--"
"files0' instead of `--files'?"
msgstr ""
"%s: nessun carattere trovato durante la lettura dei nomi dei file; forse si "
"intendeva usare \"--files0\" invece di \"--files\"?"
#: src/xz/main.c: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
msgid ""
"Cannot read data from standard input when reading filenames from standard "
"input"
msgstr ""
"Impossibile leggere i dati dallo standard input durante la lettura dei nomi "
"dei file dallo standard input"
#: src/xz/message.c:800 src/xz/message.c:844
msgid "Internal error (bug)"
msgstr "Errore interno (bug)"
#: src/xz/message.c:807
msgid "Cannot establish signal handlers"
msgstr "Impossibile stabilire i gestori dei segnali"
#: src/xz/message.c:816
msgid "No integrity check; not verifying file integrity"
msgstr ""
"Nessun controllo d'integrità; l'integrità del file non viene verificata"
#: src/xz/message.c:819
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr ""
"Tipo di controllo di integrità non supportato; l'integrità del file non "
"viene verificata"
#: src/xz/message.c:826
msgid "Memory usage limit reached"
msgstr "Limite di utilizzo della memoria raggiunto"
#: src/xz/message.c:829
msgid "File format not recognized"
msgstr "Formato di file non riconosciuto"
#: src/xz/message.c:832
msgid "Unsupported options"
msgstr "Opzioni non supportate"
#: src/xz/message.c:835
msgid "Compressed data is corrupt"
msgstr "I dati compressi sono danneggiati"
#: src/xz/message.c:838
msgid "Unexpected end of input"
msgstr "Fine dell'input non attesa"
#: src/xz/message.c:886
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "%s MiB di memoria sono richiesti. Il limite è %s."
#: src/xz/message.c:1053
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s: catena di filtri: %s\n"
#: src/xz/message.c:1063
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Provare \"%s --help\" per maggiori informazioni."
#: src/xz/message.c:1089
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .xz format.\n"
"\n"
msgstr ""
"Uso: %s [OPZIONI]... [FILE]...\n"
"Comprime o estrae i FILE nel formato .xz.\n"
"\n"
#: src/xz/message.c:1096
msgid ""
"Mandatory arguments to long options are mandatory for short options too.\n"
msgstr ""
"Gli argomenti obbligatori per le opzioni lunghe lo sono anche per quelle "
"brevi.\n"
#: src/xz/message.c:1100
msgid " Operation mode:\n"
msgstr " Modalità di operazione:\n"
#: src/xz/message.c:1103
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list information about .xz files"
msgstr ""
" -z, --compress Forza la compressione\n"
" -d, --decompress Forza l'estrazione\n"
" -t, --test Verifica l'integrità dei file compressi\n"
" -l, --list Elenca informazioni sui file .xz"
#: src/xz/message.c:1109
msgid ""
"\n"
" Operation modifiers:\n"
msgstr ""
"\n"
" Modificatori di operazioni:\n"
#: src/xz/message.c:1112
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"
msgstr ""
" -k, --keep Mantiene (non elimina) i file di input\n"
" -f, --force Forza la sovrascrittura dell'output e comprime/estrae "
"i\n"
" collegamenti\n"
" -c, --stdout Scrive sullo standard output e non elimina i file di "
"input"
#: src/xz/message.c:1118
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline "
"character\n"
" --files0[=FILE] like --files but use the null character as terminator"
msgstr ""
" --no-sparse Non crea file sparsi durante l'estrazione\n"
" -S, --suffix=.SUF Usa il suffisso \".SUF\" sui file compressi\n"
" --files=[FILE] Legge i nomi dei file da elaborare da FILE; se FILE è\n"
" omesso, i nomi dei file sono letti dallo standard "
"input;\n"
" i nomi dei file devono essere terminati con un "
"carattere\n"
" di newline\n"
" --files0=[FILE] Come --files ma usa il carattere null come terminatore"
#: src/xz/message.c:1126
msgid ""
"\n"
" Basic file format and compression options:\n"
msgstr ""
"\n"
" Formato file di base e opzioni di compressione:\n"
#: src/xz/message.c:1128
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
" -F, --format=FMT Formato file per codificare o decodificare; i "
"possibili\n"
" valori sono \"auto\" (predefinito) \"xz\", \"lzma\" e "
"\"raw\"\n"
" -C, --check=CHECK Tipo di verifica integrità: \"none\" (usare con "
"attenzione),\n"
" \"crc32\", \"crc64\" (predefinito) o \"sha256\""
#: src/xz/message.c:1135
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor "
"*and*\n"
" decompressor memory usage into account before using 7-"
"9!"
msgstr ""
" -0 ... -9 Preset di compressione; predefinito è 6; tenere a "
"mente\n"
" l'utilizzo di memoria per comprimere ed estrarre "
"prima\n"
" di usare 7-9"
#: src/xz/message.c:1139
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU "
"time;\n"
" does not affect decompressor memory requirements"
msgstr ""
" -e, --extreme Tenta di migliorare il rapporto di compressione\n"
" utilizzando più tempo di CPU; non cambia i requisiti "
"di\n"
" memoria in fase di estrazione"
#: src/xz/message.c:1144
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" set memory usage limit for compression, "
"decompression,\n"
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
msgstr ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" Imposta il limite di utilizzo della memoria per la\n"
" compressione, l'estrazione o entrambe; LIMIT è in "
"byte,\n"
" % della memoria RAM oppure 0 per il valore predefinito"
#: src/xz/message.c:1151
msgid ""
" --no-adjust if compression settings exceed the memory usage "
"limit,\n"
" give an error instead of adjusting the settings "
"downwards"
msgstr ""
" --no-adjust Se le impostazioni di compressione eccedono il limite "
"di\n"
" utilizzo della memoria, lancia un errore invece di\n"
" utilizzare valori più piccoli"
#: src/xz/message.c:1157
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
msgstr ""
"\n"
" Catena di filtri personalizzati per la compressione (alternative per\n"
" l'utilizzo di preset):"
#: src/xz/message.c:1166
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
"or\n"
" --lzma2[=OPTS] more of the following options (valid values; "
"default):\n"
" preset=PRE reset options to a preset (0-9[e])\n"
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM number of literal context bits (0-4; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (fast, normal; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; "
"bt4)\n"
" depth=NUM maximum search depth; 0=automatic "
"(default)"
msgstr ""
"\n"
" --lzma1[=OPZ] LZMA1 o LZMA2; OPZ è un elenco separato da virgole di "
"zero\n"
" --lzma2[=OPZ] o più delle seguenti opzioni (valori validi; "
"predefinito):\n"
" preset=NUM Reimposta le opzioni al preset NUM (0-9"
"[e])\n"
" dict=NUM Dimensione del dizionario\n"
" (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM Numero di bit letterali di contesto (0-4; "
"3)\n"
" lp=NUM Numero di bit letterali di posizione (0-"
"4; 0)\n"
" pb=NUM Numero di bit di posizione (0-4; 2)\n"
" mode=MODE Modalità di compressione\n"
" (fast, normal; normal)\n"
" nice=NUM Lunghezza valida per una corrispondenza\n"
" (2-273; 64)\n"
" mf=NAME Strumento per cercare corrispondenze\n"
" (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=NUM Profondità massima di ricerca; "
"0=automatica\n"
" (predefinito)"
#: src/xz/message.c:1181
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
"\n"
" --x86[=OPZ] Filtro BCJ x86 (32 e 64 bit)\n"
" --powerpc[=OPZ] Filtro BCJ PowerPC (solo big endian)\n"
" --ia64[=OPZ] Filtro BCJ IA-64 (Itanium)\n"
" --arm[=OPZ] Filtro BCJ ARM (solo little endian)\n"
" --armthumb[=OPZ] Filtro BCJ ARM-Thumb (solo little endian)\n"
" --sparc[=OPZ] Filtro BCJ SPARC\n"
" OPZ valide per tutti i filtri BCJ:\n"
" start=NUM Offset iniziale per le conversioni\n"
" (predefinito=0)"
#: src/xz/message.c:1193
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"
msgstr ""
"\n"
" --delta[=OPZ] Filtro Delta; OPZ valide (valori validi; predefinito):\n"
" dist=NUM Distanza tra byte sottratti\n"
" gli uni dagli altri (1-256; 1)"
#: src/xz/message.c:1201
msgid ""
"\n"
" Other options:\n"
msgstr ""
"\n"
" Altre opzioni:\n"
#: src/xz/message.c:1204
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors "
"too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
msgstr ""
" -q, --quiet Sopprime gli avvisi; specificare due volte per "
"sopprimere\n"
" anche gli errori\n"
" -v, --verbose Output prolisso; specificare due volte per output "
"ancora\n"
" più prolisso"
#: src/xz/message.c:1209
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn Gli avvisi non influenzano lo stato d'uscita"
#: src/xz/message.c:1211
msgid ""
" --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot Usa messaggi analizzabili (utile per gli script)"
#: src/xz/message.c:1214
msgid ""
" --info-memory display the total amount of RAM and the currently "
"active\n"
" memory usage limits, and exit"
msgstr ""
" --info-memory Visualizza la quantità totale di RAM, il limite "
"attuale\n"
" attivo di utilizzo della memore ed esce"
#: src/xz/message.c:1217
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
msgstr ""
" -h, --help Stampa l'aiuto breve (elenca solo le opzioni di base)\n"
" -H, --long-help Stampa questo lungo aiuto ed esce"
#: src/xz/message.c:1221
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
msgstr ""
" -h, --help Stampa questo breve aiuto ed esce\n"
" -H, --long-help Stampa l'aiuto lungo (elenca anche le opzioni avanzate)"
#: src/xz/message.c:1226
msgid " -V, --version display the version number and exit"
msgstr " -V, --version Stampa il numero della versione ed esce"
#: src/xz/message.c:1228
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
"\n"
"Senza FILE, o quando FILE è -, legge lo standard input.\n"
#. TRANSLATORS: This message indicates the bug reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1234
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
"Segnalare i bug a <%s> (in inglese o finlandese).\n"
"Segnalare i bug di traduzione a <tp@lists.linux.it>.\n"
#: src/xz/message.c:1236
#, c-format
msgid "%s home page: <%s>\n"
msgstr "Sito web di %s: <%s>\n"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr ""
"%s: le opzioni devono essere coppie \"nome=valore\" separate da virgole"
#: src/xz/options.c:93
#, c-format
msgid "%s: Invalid option name"
msgstr "%s: nome opzione non valido"
#: src/xz/options.c:113
#, c-format
msgid "%s: Invalid option value"
msgstr "%s: valore dell'opzione non valido"
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "Preset LZMA/LZMA2 non supportato: %s"
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "La somma di lc e lp non deve superare 4"
#: src/xz/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:79 src/xz/suffix.c:164
#, c-format
msgid ""
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr ""
"%s: con --format=raw, --suffix=.SUF è richiesto a meno che non si scriva "
"sullo stdout"
#: src/xz/suffix.c:99
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: il nome del file ha un suffisso sconosciuto, viene saltato"
#: src/xz/suffix.c:154
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: il file ha già il suffisso \"%s\", viene saltato"
#: src/xz/suffix.c:205
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: suffisso del nome del file non valido"
#: 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
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s: suffisso del moltiplicatore non valido"
#: 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
#, 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
msgid "Empty filename, skipping"
msgstr "Nome file vuoto, viene saltato"
#: 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
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
msgid "Writing to standard output failed"
msgstr "Scrittura sullo standard ouput non riuscita"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Errore sconosciuto"

825
po/pl.po Normal file
View File

@@ -0,0 +1,825 @@
# Polish translation for xz.
# This file is in the public domain.
# Jakub Bogusz <qboosh@pld-linux.org>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: xz 5.0.1\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2011-01-28 20:01+0200\n"
"PO-Revision-Date: 2011-02-02 16:51+0100\n"
"Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Nieznany typ formatu pliku"
#: 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: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: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:95
msgid "Maximum number of filters is four"
msgstr "Maksymalna liczba filtrów to cztery"
#: 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:129
msgid "Using a preset in raw mode is discouraged."
msgstr "Użycie ustawień predefiniowanych w trybie surowym jest odradzane."
#: 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:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Format .lzma obsługuje tylko filtr LZMA1"
#: 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:182
msgid "Unsupported filter chain or filter options"
msgstr "Nieobsługiwany łańcuch filtrów lub opcje filtra"
#: 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: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"
#. TRANSLATORS: When compression or decompression finishes,
#. and xz is going to remove the source file, xz first checks
#. if the source file still exists, and if it does, does its
#. device and inode numbers match what xz saw when it opened
#. the source file. If these checks fail, this message is
#. shown, %s being the filename, and the file is not deleted.
#. The check for device and inode numbers is there, because
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c: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: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: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: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: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: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:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Jest katalogiem, pominięto"
#: 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: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: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: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: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: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: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:820
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Błąd odczytu: %s"
#: 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:853
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: Nieoczekiwany koniec pliku"
#: src/xz/file_io.c:903
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Błąd zapisu: %s"
#: 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:119
msgid "Total amount of physical memory (RAM): "
msgstr "Całkowita ilość pamięci fizycznej (RAM): "
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Limit użycia pamięci dla kompresji: "
#: 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:62
msgid "None"
msgstr "Brak"
#. TRANSLATORS: Indicates that integrity check name is not known,
#. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter, but don't use spaces.
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Nieznany-2"
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Nieznany-3"
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Nieznany-5"
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Nieznany-6"
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Nieznany-7"
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Nieznany-8"
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Nieznany-9"
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Nieznany11"
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Nieznany12"
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Nieznany13"
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Nieznany14"
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Nieznany15"
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s: Plik jest pusty"
#: 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"
#. TRANSLATORS: These are column headings. From Strms (Streams)
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:612
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr "Strum. Bloki Spakowany Rozpakowany Wsp. Kontrola Nazwa pliku"
#: src/xz/list.c:652
#, c-format
msgid " Streams: %s\n"
msgstr " Strumienie: %s\n"
#: src/xz/list.c:654
#, c-format
msgid " Blocks: %s\n"
msgstr " Bloki: %s\n"
#: src/xz/list.c:656
#, c-format
msgid " Compressed size: %s\n"
msgstr " Rozmiar spakowany: %s\n"
#: src/xz/list.c:659
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Rozmiar rozpakowany: %s\n"
#: src/xz/list.c:662
#, c-format
msgid " Ratio: %s\n"
msgstr " Współczynnik: %s\n"
#: src/xz/list.c:664
#, c-format
msgid " Check: %s\n"
msgstr " Kontrola spójności: %s\n"
#: src/xz/list.c:665
#, c-format
msgid " Stream padding: %s\n"
msgstr " Wyrównanie strumienia: %s\n"
#. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz".
#: src/xz/list.c:693
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
msgstr ""
" Strumienie:\n"
" Strumień Bloki Offset spak. Offset rozp. Rozm.spak. Rozm.rozp. Wsp. Kontrola Wyrównanie"
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:748
#, c-format
msgid ""
" Blocks:\n"
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
msgstr ""
" Bloki:\n"
" Strumień Blok Offset spak. Offset rozp. Rozm.całkowity Rozm.rozp. Wsp. Kontrola"
#. TRANSLATORS: These are additional column headings
#. for the most verbose listing mode. CheckVal
#. (Check value), Flags, and Filters are left aligned.
#. Header (Block Header Size), CompSize, and MemUsage
#. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz".
#: src/xz/list.c:760
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " S.kontr. %*sNagłówek Flagi Rozm. spak. Uż.pamięci Filtry"
#: src/xz/list.c:838 src/xz/list.c:1007
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Wymagana pamięć: %s MiB\n"
#: src/xz/list.c:840 src/xz/list.c:1009
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Rozmiar w nagłówkach: %s\n"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "Yes"
msgstr "Tak"
#: src/xz/list.c:841 src/xz/list.c:1010
msgid "No"
msgstr "Nie"
#. 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
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s plik\n"
msgstr[1] "%s pliki\n"
msgstr[2] "%s plików\n"
#: src/xz/list.c:999
msgid "Totals:"
msgstr "Sumarycznie:"
#: src/xz/list.c:1000
#, c-format
msgid " Number of files: %s\n"
msgstr " Liczba plików: %s\n"
#: src/xz/list.c:1072
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list działa tylko z plikami .xz (--format=xz lub --format=auto)"
#: src/xz/list.c:1078
msgid "--list does not support reading from standard input"
msgstr "--list nie obsługuje odczytu ze standardowego wejścia"
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s: Błąd odczytu nazw plików: %s"
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s: Nieoczekiwany koniec wejścia podczas odczytu nazw plików"
#: src/xz/main.c:120
#, c-format
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
msgstr "%s: Napotkano znak NUL podczas odczytu nazw plików; może miało być `--files0' zamiast `--files'?"
#: src/xz/main.c:174
msgid "Compression and decompression with --robot are not supported yet."
msgstr "Kompresja i dekompresja z opcją --robot nie jest jeszcze obsługiwana."
#: src/xz/main.c:231
msgid "Cannot read data from standard input when reading filenames from standard input"
msgstr "Nie można odczytać danych ze standardowego wejścia przy czytaniu nazw plików ze standardowego wejścia"
#: src/xz/message.c:792 src/xz/message.c:842
msgid "Internal error (bug)"
msgstr "Błąd wewnętrzny"
#: src/xz/message.c:799
msgid "Cannot establish signal handlers"
msgstr "Nie można ustawić obsługi sygnałów"
#: src/xz/message.c:808
msgid "No integrity check; not verifying file integrity"
msgstr "Brak kontroli spójności; poprawność plików nie będzie weryfikowana"
#: src/xz/message.c:811
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr "Nieobsługiwany typ kontroli spójności; poprawność plików nie będzie weryfikowana"
#: src/xz/message.c:818
msgid "Memory usage limit reached"
msgstr "Osiągnięto limit użycia pamięci"
#: src/xz/message.c:821
msgid "File format not recognized"
msgstr "Nie rozpoznany format pliku"
#: src/xz/message.c:824
msgid "Unsupported options"
msgstr "Nieobsługiwane opcje"
#: src/xz/message.c:827
msgid "Compressed data is corrupt"
msgstr "Dane skompresowane są uszkodzone"
#: src/xz/message.c:830
msgid "Unexpected end of input"
msgstr "Nieoczekiwany koniec wejścia"
#: src/xz/message.c:881
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "Wymagane jest %s MiB pamięci. Limit to %s."
#: src/xz/message.c:1048
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s: Łańcuch filtrów: %s\n"
#: src/xz/message.c:1058
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Polecenie `%s --help' pokaże więcej informacji."
#: src/xz/message.c:1084
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .xz format.\n"
"\n"
msgstr ""
"Składnia: %s [OPCJA]... [PLIK]...\n"
"Kompresja lub dekompresja PLIKÓW w formacie .xz.\n"
"\n"
#: src/xz/message.c:1091
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr ""
"Argumenty obowiązkowe dla opcji długich są obowiązkowe również dla opcji\n"
"krótkich.\n"
#: src/xz/message.c:1095
msgid " Operation mode:\n"
msgstr " Tryb pracy:\n"
#: src/xz/message.c:1098
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list information about .xz files"
msgstr ""
" -z, --compress wymuszenie kompresji\n"
" -d, --decompress wymuszenie dekompresji\n"
" -t, --test sprawdzenie spójności plików skompresowanych\n"
" -l, --list wypisanie informacji o plikach .xz"
#: src/xz/message.c:1104
msgid ""
"\n"
" Operation modifiers:\n"
msgstr ""
"\n"
" Modyfikatory operacji:\n"
#: src/xz/message.c:1107
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"
msgstr ""
" -k, --keep zachowanie (nieusuwanie) plików wejściowych\n"
" -f, --force nadpisywanie plików wyjściowych i (de)kompresja dowiązań\n"
" -c, --stdout zapis na standardowe wyjście, nieusuwanie plików wej."
#: src/xz/message.c:1113
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
" --files0[=FILE] like --files but use the null character as terminator"
msgstr ""
" --no-sparse nietworzenie plików rzadkich podczas dekompresji\n"
" -S, --suffix=.ROZ użycie rozszerzenia `.ROZ' dla plików skompresowanych\n"
" --files[=PLIK] odczyt nazw plików do przetworzenia z PLIKU; jeśli PLIK\n"
" nie został podany, nazwy są czytane ze standardowego\n"
" wejścia; muszą być zakończone znakiem nowej linii\n"
" --files0[=PLIK] podobnie do --files, ale znakiem kończącym musi być NUL"
#: src/xz/message.c:1121
msgid ""
"\n"
" Basic file format and compression options:\n"
msgstr ""
"\n"
" Podstawowe opcje formatu pliku i kompresji:\n"
#: src/xz/message.c:1123
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
" -F, --format=FORM format pliki do kodowania lub dekodowania; możliwe to\n"
" `auto' (domyślny), `xz', 'lzma' i `raw'\n"
" -C, --check=TEST typ kontroli spójności: `none' (ostrożnie!),\n"
" `crc32', `crc64' (domyślny) lub `sha256'"
#: src/xz/message.c:1130
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
msgstr ""
" -0 ... -9 predefiniowane opcje kompresji; domyślna to 6; przed\n"
" użyciem wartości 7-9 należy wziąć pod uwagę wykorzystanie\n"
" pamięci przy kompresji *oraz* dekompresji!"
#: src/xz/message.c:1134
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
msgstr ""
" -e, --extreme próba poprawy współczynnika kompresji z użyciem większej\n"
" ilości czasu procesora; nie wpływa na wymagania\n"
" pamięciowe dekompresora"
#: src/xz/message.c:1139
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" set memory usage limit for compression, decompression,\n"
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
msgstr ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" ustawienie limitu użycia pamięci dla kompresji,\n"
" dekompresji lub obu; LIMIT jest w bajtach, % RAM lub 0\n"
" dla limitów domyślnych"
#: src/xz/message.c:1146
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
msgstr ""
" --no-adjust jeśli ustawienia kompresji przekraczają limit użycia\n"
" pamięci, zostanie zgłoszony błąd zamiast zmniejszania\n"
" ustawień"
#: src/xz/message.c:1152
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
msgstr ""
"\n"
" Łańcuch własnych filtrów do kompresji (alternatywa do używania -0 .. -9):"
#: src/xz/message.c:1161
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
" --lzma2[=OPTS] more of the following options (valid values; default):\n"
" preset=PRE reset options to a preset (0-9[e])\n"
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM number of literal context bits (0-4; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (fast, normal; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=NUM maximum search depth; 0=automatic (default)"
msgstr ""
"\n"
" --lzma1[=OPCJE] LZMA1 lub LZMA2; OPCJE to oddzielona przecinkami lista\n"
" --lzma2[=OPCJE] zera lub więcej następujących opcji (w nawiasach wartości\n"
" poprawne; domyślne):\n"
" preset=PRE ustawienie opcji na predefiniowane (0-9[e])\n"
" dict=ILE rozmiar słownika (4KiB - 1536MiB; 8MiB)\n"
" lc=ILE liczba bitów kontekstu literału (0-4; 3)\n"
" lp=ILE liczba bitów pozycji literału (0-4; 0)\n"
" pp=ILE liczba bitów pozycji (0-4; 2)\n"
" mode=TRYB tryb kompresji (fast, normal; normal)\n"
" nice=ILE długość dopasowania (2-273; 64)\n"
" mf=NAZWA dopasowywacz (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=ILE maks. głębokość szukania; 0=auto (domyślne)"
#: src/xz/message.c:1176
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
"\n"
" --x86[=OPCJE] Filtr BCJ x86 (32-bitowy lub 64-bitowy)\n"
" --powerpc[=OPCJE] Filtr BCJ PowerPC (tylko big-endian)\n"
" --ia64[=OPCJE] Filtr BCJ IA-64 (Itanium)\n"
" --arm[=OPCJE] Filtr BCJ ARM (tylko little-endian)\n"
" --armthumb[=OPCJE] Filtr BCJ ARM-Thumb (tylko little-endian)\n"
" --sparc[=OPCJE] Filtr BCJ SPARC\n"
" Poprawne OPCJE dla wszystkich filtrów BCJ:\n"
" start=ILE offset początku konwersji (domyślnie=0)"
#: src/xz/message.c:1188
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"
msgstr ""
"\n"
" --delta[=OPCJE] Filtr delta; poprawne OPCJE (poprawne wart.; domyślne):\n"
" dist=ILE odległość między bajtami odejmowanymi od\n"
" siebie (1-256; 1)"
#: src/xz/message.c:1196
msgid ""
"\n"
" Other options:\n"
msgstr ""
"\n"
" Inne opcje:\n"
#: src/xz/message.c:1199
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
msgstr ""
" -q, --quiet pominięcie ostrzeżeń; dwukrotne podanie pomija też błędy\n"
" -v, --verbose więcej informacji; dwukrotne podanie to jeszcze więcej"
#: src/xz/message.c:1204
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn ostrzeżenia nie mają wpływu na status zakończenia"
#: src/xz/message.c:1206
msgid " --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot komunikaty w formacie dla maszyny (do skryptów)"
#: src/xz/message.c:1209
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
msgstr ""
" --info-memory wyświetlenie całkowitej ilości pamięci RAM oraz aktualnie\n"
" aktywnych limitów pamięci i zakończenie pracy"
#: src/xz/message.c:1212
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
msgstr ""
" -h, --help wyświetlenie krótkiego opisu (tylko podstawowe opcje)\n"
" -H, --long-help wyświetlenie tego długiego opisu i zakończenie"
#: src/xz/message.c:1216
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
msgstr ""
" -h, --help wyświetlenie tego krótkiego opisu i zakończenie\n"
" -H, --long-help wyświetlenie długiego opisu (także opcje zaawansowane)"
#: src/xz/message.c:1221
msgid " -V, --version display the version number and exit"
msgstr " -V, --version wyświetlenie informacji o wersji i zakończenie"
#: src/xz/message.c:1223
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
"\n"
"Jeśli nie podano PLIKU lub PLIK to -, czytane jest standardowe wejście.\n"
#. TRANSLATORS: This message indicates the bug reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1229
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
"Błędy prosimy zgłaszać na adres <%s>\n"
"(w języku angielskim lub fińskim).\n"
"Błędy w tłumaczeniu prosimy zgłaszać na adres\n"
"<translation-team-pl@lists.sourceforge.net>.\n"
#: src/xz/message.c:1231
#, c-format
msgid "%s home page: <%s>\n"
msgstr "Strona domowa %s: <%s>\n"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s: Opcje muszą być parami `nazwa=wartość' rozdzielonymi przecinkami"
#: src/xz/options.c:93
#, c-format
msgid "%s: Invalid option name"
msgstr "%s: Błędna nazwa opcji"
#: src/xz/options.c:113
#, c-format
msgid "%s: Invalid option value"
msgstr "%s: Błędna wartość opcji"
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "Nieobsługiwane ustawienie predefiniowane LZMA1/LZMA2: %s"
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "Suma lc i lp nie może przekroczyć 4"
#: src/xz/options.c:359
#, c-format
msgid "The selected match finder requires at least nice=%<PRIu32>"
msgstr "Wybrany dopasowywacz wymaga przynajmniej nice=%<PRIu32>"
#: src/xz/suffix.c:104 src/xz/suffix.c:189
#, c-format
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr "%s: Przy --format=raw i zapisie do pliku wymagana jest opcja --suffix=.ROZ"
#: src/xz/suffix.c:124
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Nazwa pliku ma nieznane rozszerzenie, pominięto"
#: src/xz/suffix.c:179
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Plik już ma rozszerzenie `%s', pominięto"
#: src/xz/suffix.c:230
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Błędne rozszerzenie nazwy pliku"
#: src/xz/util.c:61
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s: Wartość nie jest nieujemną liczbą całkowitą"
#: src/xz/util.c:103
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s: Błędny przyrostek mnożnika"
#: src/xz/util.c:105
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgstr "Poprawne przyrostki to `KiB' (2^10), `MiB' (2^20) i `GiB' (2^30)."
#: src/xz/util.c:122
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "Wartość opcji `%s' musi być w przedziale [%<PRIu64>, %<PRIu64>]"
#: src/xz/util.c:247
msgid "Empty filename, skipping"
msgstr "Pusta nazwa pliku, pominięto"
#: src/xz/util.c:261
msgid "Compressed data cannot be read from a terminal"
msgstr "Dane skompresowane nie mogą być czytane z terminala"
#: src/xz/util.c:274
msgid "Compressed data cannot be written to a terminal"
msgstr "Dane skompresowane nie mogą być zapisywane na terminal"
#: src/common/tuklib_exit.c:39
msgid "Writing to standard output failed"
msgstr "Zapis na standardowe wyjście nie powiódł się"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Nieznany błąd"

View File

@@ -1,16 +1,22 @@
##
## Copyright (C) 2007 Lasse Collin
## Author: Lasse Collin
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
SUBDIRS = liblzma lzma lzmadec scripts
SUBDIRS = liblzma xzdec
if COND_XZ
SUBDIRS += xz
endif
if COND_LZMAINFO
SUBDIRS += lzmainfo
endif
if COND_SCRIPTS
SUBDIRS += scripts
endif
EXTRA_DIST = common

View File

@@ -0,0 +1,50 @@
/*
* Author: Lasse Collin
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
*/
#include <winresrc.h>
#include "config.h"
#define LZMA_H_INTERNAL
#define LZMA_H_INTERNAL_RC
#include "lzma/version.h"
#ifndef MY_BUILD
# define MY_BUILD 0
#endif
#define MY_VERSION LZMA_VERSION_MAJOR,LZMA_VERSION_MINOR,LZMA_VERSION_PATCH,MY_BUILD
#define MY_FILENAME MY_NAME MY_SUFFIX
#define MY_COMPANY "The Tukaani Project <http://tukaani.org/>"
#define MY_PRODUCT PACKAGE_NAME " <" PACKAGE_URL ">"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
VS_VERSION_INFO VERSIONINFO
FILEVERSION MY_VERSION
PRODUCTVERSION MY_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE MY_TYPE
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", MY_COMPANY
VALUE "FileDescription", MY_DESC
VALUE "FileVersion", LZMA_VERSION_STRING
VALUE "InternalName", MY_NAME
VALUE "OriginalFilename", MY_FILENAME
VALUE "ProductName", MY_PRODUCT
VALUE "ProductVersion", LZMA_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

42
src/common/mythread.h Normal file
View File

@@ -0,0 +1,42 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file mythread.h
/// \brief Wrappers for threads
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#ifdef HAVE_PTHREAD
# include <pthread.h>
# define mythread_once(func) \
do { \
static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
pthread_once(&once_, &func); \
} while (0)
# define mythread_sigmask(how, set, oset) \
pthread_sigmask(how, set, oset)
#else
# 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)
#endif

View File

@@ -1,77 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file physmem.h
/// \brief Get the amount of physical memory
//
// This code has been put into the public domain.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef PHYSMEM_H
#define PHYSMEM_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <inttypes.h>
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#if defined(HAVE_PHYSMEM_SYSCTL) || defined(HAVE_NCPU_SYSCTL)
# ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
# endif
# ifdef HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
# endif
#endif
/// \brief Get the amount of physical memory in bytes
///
/// \return Amount of physical memory in bytes. On error, zero is
/// returned.
static inline uint64_t
physmem(void)
{
uint64_t ret = 0;
#if defined(HAVE_PHYSMEM_SYSCONF)
const long pagesize = sysconf(_SC_PAGESIZE);
const long pages = sysconf(_SC_PHYS_PAGES);
if (pagesize != -1 || pages != -1)
// According to docs, pagesize * pages can overflow.
// Simple case is 32-bit box with 4 GiB or more RAM,
// which may report exactly 4 GiB of RAM, and "long"
// being 32-bit will overflow. Casting to uint64_t
// hopefully avoids overflows in the near future.
ret = (uint64_t)(pagesize) * (uint64_t)(pages);
#elif defined(HAVE_PHYSMEM_SYSCTL)
int name[2] = { CTL_HW, HW_PHYSMEM };
unsigned long mem;
size_t mem_ptr_size = sizeof(mem);
if (!sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL)) {
// Some systems use unsigned int as the "return value".
// This makes a difference on 64-bit boxes.
if (mem_ptr_size != sizeof(mem)) {
if (mem_ptr_size == sizeof(unsigned int))
ret = *(unsigned int *)(&mem);
} else {
ret = mem;
}
}
#endif
return ret;
}
#endif

View File

@@ -6,17 +6,10 @@
/// This file is used also by the lzma command line tool, that's why this
/// file is separate from common.h.
//
// Copyright (C) 2007 Lasse Collin
// Author: Lasse Collin
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
@@ -31,10 +24,118 @@
# include <config.h>
#endif
#include "lzma.h"
// Get standard-compliant stdio functions under MinGW and MinGW-w64.
#ifdef __MINGW32__
# define __USE_MINGW_ANSI_STDIO 1
#endif
// size_t and NULL
#include <stddef.h>
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
// C99 says that inttypes.h always includes stdint.h, but some systems
// don't do that, and require including stdint.h separately.
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
// Some pre-C99 systems have SIZE_MAX in limits.h instead of stdint.h. The
// limits are also used to figure out some macros missing from pre-C99 systems.
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
// Be more compatible with systems that have non-conforming inttypes.h.
// We assume that int is 32-bit and that long is either 32-bit or 64-bit.
// Full Autoconf test could be more correct, but this should work well enough.
// Note that this duplicates some code from lzma.h, but this is better since
// we can work without inttypes.h thanks to Autoconf tests.
#ifndef UINT32_C
# if UINT_MAX != 4294967295U
# error UINT32_C is not defined and unsigned int is not 32-bit.
# endif
# define UINT32_C(n) n ## U
#endif
#ifndef UINT32_MAX
# define UINT32_MAX UINT32_C(4294967295)
#endif
#ifndef PRIu32
# define PRIu32 "u"
#endif
#ifndef PRIx32
# define PRIx32 "x"
#endif
#ifndef PRIX32
# define PRIX32 "X"
#endif
#if ULONG_MAX == 4294967295UL
# ifndef UINT64_C
# define UINT64_C(n) n ## ULL
# endif
# ifndef PRIu64
# define PRIu64 "llu"
# endif
# ifndef PRIx64
# define PRIx64 "llx"
# endif
# ifndef PRIX64
# define PRIX64 "llX"
# endif
#else
# ifndef UINT64_C
# define UINT64_C(n) n ## UL
# endif
# ifndef PRIu64
# define PRIu64 "lu"
# endif
# ifndef PRIx64
# define PRIx64 "lx"
# endif
# ifndef PRIX64
# define PRIX64 "lX"
# endif
#endif
#ifndef UINT64_MAX
# define UINT64_MAX UINT64_C(18446744073709551615)
#endif
// Interix has broken header files, which typedef size_t to unsigned long,
// but a few lines later define SIZE_MAX to INT32_MAX.
#ifdef __INTERIX
# undef SIZE_MAX
#endif
// The code currently assumes that size_t is either 32-bit or 64-bit.
#ifndef SIZE_MAX
# if SIZEOF_SIZE_T == 4
# define SIZE_MAX UINT32_MAX
# elif SIZEOF_SIZE_T == 8
# define SIZE_MAX UINT64_MAX
# else
# error size_t is not 32-bit or 64-bit
# endif
#endif
#if SIZE_MAX != UINT32_MAX && SIZE_MAX != UINT64_MAX
# error size_t is not 32-bit or 64-bit
#endif
#include <stdlib.h>
#include <assert.h>
// Pre-C99 systems lack stdbool.h. All the code in LZMA Utils must be written
// so that it works with fake bool type, for example:
//
// bool foo = (flags & 0x100) != 0;
// bool bar = !!(flags & 0x100);
//
// This works with the real C99 bool but breaks with fake bool:
//
// bool baz = (flags & 0x100);
//
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
@@ -47,17 +148,8 @@ typedef unsigned char _Bool;
# define __bool_true_false_are_defined 1
#endif
#ifdef HAVE_ASSERT_H
# include <assert.h>
#else
# ifdef NDEBUG
# define assert(x)
# else
// TODO: Pretty bad assert() macro.
# define assert(x) (!(x) && abort())
# endif
#endif
// string.h should be enough but let's include strings.h and memory.h too if
// they exists, since that shouldn't do any harm, but may improve portability.
#ifdef HAVE_STRING_H
# include <string.h>
#endif
@@ -75,26 +167,23 @@ typedef unsigned char _Bool;
// Macros //
////////////
#ifndef HAVE_MEMCPY
# define memcpy(dest, src, n) bcopy(src, dest, n)
#undef memzero
#define memzero(s, n) memset(s, 0, n)
// NOTE: Avoid using MIN() and MAX(), because even conditionally defining
// those macros can cause some portability trouble, since on some systems
// the system headers insist defining their own versions.
#define my_min(x, y) ((x) < (y) ? (x) : (y))
#define my_max(x, y) ((x) > (y) ? (x) : (y))
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif
#ifndef HAVE_MEMMOVE
# define memmove(dest, src, n) bcopy(src, dest, n)
#endif
#ifdef HAVE_MEMSET
# define memzero(s, n) memset(s, 0, n)
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
# define lzma_attr_alloc_size(x) __attribute__((__alloc_size__(x)))
#else
# define memzero(s, n) bzero(s, n)
#endif
#ifndef MIN
# define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
#ifndef MAX
# define MAX(x, y) ((x) > (y) ? (x) : (y))
# define lzma_attr_alloc_size(x)
#endif
#endif

View File

@@ -0,0 +1,71 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_common.h
/// \brief Common definitions for tuklib modules
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_COMMON_H
#define TUKLIB_COMMON_H
// The config file may be replaced by a package-specific file.
// It should include at least stddef.h, inttypes.h, and limits.h.
#include "tuklib_config.h"
// TUKLIB_SYMBOL_PREFIX is prefixed to all symbols exported by
// the tuklib modules. If you use a tuklib module in a library,
// you should use TUKLIB_SYMBOL_PREFIX to make sure that there
// are no symbol conflicts in case someone links your library
// into application that also uses the same tuklib module.
#ifndef TUKLIB_SYMBOL_PREFIX
# define TUKLIB_SYMBOL_PREFIX
#endif
#define TUKLIB_CAT_X(a, b) a ## b
#define TUKLIB_CAT(a, b) TUKLIB_CAT_X(a, b)
#ifndef TUKLIB_SYMBOL
# define TUKLIB_SYMBOL(sym) TUKLIB_CAT(TUKLIB_SYMBOL_PREFIX, sym)
#endif
#ifndef TUKLIB_DECLS_BEGIN
# ifdef __cplusplus
# define TUKLIB_DECLS_BEGIN extern "C" {
# else
# define TUKLIB_DECLS_BEGIN
# endif
#endif
#ifndef TUKLIB_DECLS_END
# ifdef __cplusplus
# define TUKLIB_DECLS_END }
# else
# define TUKLIB_DECLS_END
# endif
#endif
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
# define TUKLIB_GNUC_REQ(major, minor) \
((__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)) \
|| __GNUC__ > (major))
#else
# define TUKLIB_GNUC_REQ(major, minor) 0
#endif
#if TUKLIB_GNUC_REQ(2, 5)
# define tuklib_attr_noreturn __attribute__((__noreturn__))
#else
# define tuklib_attr_noreturn
#endif
#if (defined(_WIN32) && !defined(__CYGWIN__)) \
|| defined(__OS2__) || defined(__MSDOS__)
# define TUKLIB_DOSLIKE 1
#endif
#endif

View File

@@ -0,0 +1,7 @@
#ifdef HAVE_CONFIG_H
# include "sysdefs.h"
#else
# include <stddef.h>
# include <inttypes.h>
# include <limits.h>
#endif

View File

@@ -0,0 +1,62 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_cpucores.c
/// \brief Get the number of CPU cores online
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_cpucores.h"
#if defined(TUKLIB_CPUCORES_SYSCTL)
# ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
# endif
# include <sys/sysctl.h>
#elif defined(TUKLIB_CPUCORES_SYSCONF)
# include <unistd.h>
// HP-UX
#elif defined(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC)
# include <sys/param.h>
# include <sys/pstat.h>
#endif
extern uint32_t
tuklib_cpucores(void)
{
uint32_t ret = 0;
#if defined(TUKLIB_CPUCORES_SYSCTL)
int name[2] = { CTL_HW, HW_NCPU };
int cpus;
size_t cpus_size = sizeof(cpus);
if (sysctl(name, 2, &cpus, &cpus_size, NULL, 0) != -1
&& cpus_size == sizeof(cpus) && cpus > 0)
ret = cpus;
#elif defined(TUKLIB_CPUCORES_SYSCONF)
# ifdef _SC_NPROCESSORS_ONLN
// Most systems
const long cpus = sysconf(_SC_NPROCESSORS_ONLN);
# else
// IRIX
const long cpus = sysconf(_SC_NPROC_ONLN);
# endif
if (cpus > 0)
ret = cpus;
#elif defined(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC)
struct pst_dynamic pst;
if (pstat_getdynamic(&pst, sizeof(pst), 1, 0) != -1)
ret = pst.psd_proc_cnt;
#endif
return ret;
}

View File

@@ -0,0 +1,23 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_cpucores.h
/// \brief Get the number of CPU cores online
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_CPUCORES_H
#define TUKLIB_CPUCORES_H
#include "tuklib_common.h"
TUKLIB_DECLS_BEGIN
#define tuklib_cpucores TUKLIB_SYMBOL(tuklib_cpucores)
extern uint32_t tuklib_cpucores(void);
TUKLIB_DECLS_END
#endif

57
src/common/tuklib_exit.c Normal file
View File

@@ -0,0 +1,57 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_exit.c
/// \brief Close stdout and stderr, and exit
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_common.h"
#include <stdlib.h>
#include <stdio.h>
#include "tuklib_gettext.h"
#include "tuklib_progname.h"
#include "tuklib_exit.h"
extern void
tuklib_exit(int status, int err_status, int show_error)
{
if (status != err_status) {
// Close stdout. If something goes wrong,
// print an error message to stderr.
const int ferror_err = ferror(stdout);
const int fclose_err = fclose(stdout);
if (ferror_err || fclose_err) {
status = err_status;
// If it was fclose() that failed, we have the reason
// in errno. If only ferror() indicated an error,
// we have no idea what the reason was.
if (show_error)
fprintf(stderr, "%s: %s: %s\n", progname,
_("Writing to standard "
"output failed"),
fclose_err ? strerror(errno)
: _("Unknown error"));
}
}
if (status != err_status) {
// Close stderr. If something goes wrong, there's
// nothing where we could print an error message.
// Just set the exit status.
const int ferror_err = ferror(stderr);
const int fclose_err = fclose(stderr);
if (fclose_err || ferror_err)
status = err_status;
}
exit(status);
}

25
src/common/tuklib_exit.h Normal file
View File

@@ -0,0 +1,25 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_exit.h
/// \brief Close stdout and stderr, and exit
/// \note Requires tuklib_progname and tuklib_gettext modules
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_EXIT_H
#define TUKLIB_EXIT_H
#include "tuklib_common.h"
TUKLIB_DECLS_BEGIN
#define tuklib_exit TUKLIB_SYMBOL(tuklib_exit)
extern void tuklib_exit(int status, int err_status, int show_error)
tuklib_attr_noreturn;
TUKLIB_DECLS_END
#endif

View File

@@ -0,0 +1,44 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_gettext.h
/// \brief Wrapper for gettext and friends
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_GETTEXT_H
#define TUKLIB_GETTEXT_H
#include "tuklib_common.h"
#include <locale.h>
#ifndef TUKLIB_GETTEXT
# ifdef ENABLE_NLS
# define TUKLIB_GETTEXT 1
# else
# define TUKLIB_GETTEXT 0
# endif
#endif
#if TUKLIB_GETTEXT
# include <libintl.h>
# define tuklib_gettext_init(package, localedir) \
do { \
setlocale(LC_ALL, ""); \
bindtextdomain(package, localedir); \
textdomain(package); \
} while (0)
# define _(msgid) gettext(msgid)
#else
# define tuklib_gettext_init(package, localedir) \
setlocale(LC_ALL, "")
# define _(msgid) (msgid)
# define ngettext(msgid1, msgid2, n) ((n) == 1 ? (msgid1) : (msgid2))
#endif
#define N_(msgid) msgid
#endif

523
src/common/tuklib_integer.h Normal file
View File

@@ -0,0 +1,523 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_integer.h
/// \brief Various integer and bit operations
///
/// This file provides macros or functions to do some basic integer and bit
/// operations.
///
/// Endianness related integer operations (XX = 16, 32, or 64; Y = b or l):
/// - Byte swapping: bswapXX(num)
/// - Byte order conversions to/from native: convXXYe(num)
/// - Aligned reads: readXXYe(ptr)
/// - Aligned writes: writeXXYe(ptr, num)
/// - Unaligned reads (16/32-bit only): unaligned_readXXYe(ptr)
/// - Unaligned writes (16/32-bit only): unaligned_writeXXYe(ptr, num)
///
/// Since they can macros, the arguments should have no side effects since
/// they may be evaluated more than once.
///
/// \todo PowerPC and possibly some other architectures support
/// byte swapping load and store instructions. This file
/// doesn't take advantage of those instructions.
///
/// Bit scan operations for non-zero 32-bit integers:
/// - Bit scan reverse (find highest non-zero bit): bsr32(num)
/// - Count leading zeros: clz32(num)
/// - Count trailing zeros: ctz32(num)
/// - Bit scan forward (simply an alias for ctz32()): bsf32(num)
///
/// The above bit scan operations return 0-31. If num is zero,
/// the result is undefined.
//
// Authors: Lasse Collin
// Joachim Henke
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_INTEGER_H
#define TUKLIB_INTEGER_H
#include "tuklib_common.h"
////////////////////////////////////////
// Operating system specific features //
////////////////////////////////////////
#if defined(HAVE_BYTESWAP_H)
// glibc, uClibc, dietlibc
# include <byteswap.h>
# ifdef HAVE_BSWAP_16
# define bswap16(num) bswap_16(num)
# endif
# ifdef HAVE_BSWAP_32
# define bswap32(num) bswap_32(num)
# endif
# ifdef HAVE_BSWAP_64
# define bswap64(num) bswap_64(num)
# endif
#elif defined(HAVE_SYS_ENDIAN_H)
// *BSDs and Darwin
# include <sys/endian.h>
#elif defined(HAVE_SYS_BYTEORDER_H)
// Solaris
# include <sys/byteorder.h>
# ifdef BSWAP_16
# define bswap16(num) BSWAP_16(num)
# endif
# ifdef BSWAP_32
# define bswap32(num) BSWAP_32(num)
# endif
# ifdef BSWAP_64
# define bswap64(num) BSWAP_64(num)
# endif
# ifdef BE_16
# define conv16be(num) BE_16(num)
# endif
# ifdef BE_32
# define conv32be(num) BE_32(num)
# endif
# ifdef BE_64
# define conv64be(num) BE_64(num)
# endif
# ifdef LE_16
# define conv16le(num) LE_16(num)
# endif
# ifdef LE_32
# define conv32le(num) LE_32(num)
# endif
# ifdef LE_64
# define conv64le(num) LE_64(num)
# endif
#endif
///////////////////
// Byte swapping //
///////////////////
#ifndef bswap16
# define bswap16(num) \
(((uint16_t)(num) << 8) | ((uint16_t)(num) >> 8))
#endif
#ifndef bswap32
# define bswap32(num) \
( (((uint32_t)(num) << 24) ) \
| (((uint32_t)(num) << 8) & UINT32_C(0x00FF0000)) \
| (((uint32_t)(num) >> 8) & UINT32_C(0x0000FF00)) \
| (((uint32_t)(num) >> 24) ) )
#endif
#ifndef bswap64
# define bswap64(num) \
( (((uint64_t)(num) << 56) ) \
| (((uint64_t)(num) << 40) & UINT64_C(0x00FF000000000000)) \
| (((uint64_t)(num) << 24) & UINT64_C(0x0000FF0000000000)) \
| (((uint64_t)(num) << 8) & UINT64_C(0x000000FF00000000)) \
| (((uint64_t)(num) >> 8) & UINT64_C(0x00000000FF000000)) \
| (((uint64_t)(num) >> 24) & UINT64_C(0x0000000000FF0000)) \
| (((uint64_t)(num) >> 40) & UINT64_C(0x000000000000FF00)) \
| (((uint64_t)(num) >> 56) ) )
#endif
// Define conversion macros using the basic byte swapping macros.
#ifdef WORDS_BIGENDIAN
# ifndef conv16be
# define conv16be(num) ((uint16_t)(num))
# endif
# ifndef conv32be
# define conv32be(num) ((uint32_t)(num))
# endif
# ifndef conv64be
# define conv64be(num) ((uint64_t)(num))
# endif
# ifndef conv16le
# define conv16le(num) bswap16(num)
# endif
# ifndef conv32le
# define conv32le(num) bswap32(num)
# endif
# ifndef conv64le
# define conv64le(num) bswap64(num)
# endif
#else
# ifndef conv16be
# define conv16be(num) bswap16(num)
# endif
# ifndef conv32be
# define conv32be(num) bswap32(num)
# endif
# ifndef conv64be
# define conv64be(num) bswap64(num)
# endif
# ifndef conv16le
# define conv16le(num) ((uint16_t)(num))
# endif
# ifndef conv32le
# define conv32le(num) ((uint32_t)(num))
# endif
# ifndef conv64le
# define conv64le(num) ((uint64_t)(num))
# endif
#endif
//////////////////////////////
// Aligned reads and writes //
//////////////////////////////
static inline uint16_t
read16be(const uint8_t *buf)
{
uint16_t num = *(const uint16_t *)buf;
return conv16be(num);
}
static inline uint16_t
read16le(const uint8_t *buf)
{
uint16_t num = *(const uint16_t *)buf;
return conv16le(num);
}
static inline uint32_t
read32be(const uint8_t *buf)
{
uint32_t num = *(const uint32_t *)buf;
return conv32be(num);
}
static inline uint32_t
read32le(const uint8_t *buf)
{
uint32_t num = *(const uint32_t *)buf;
return conv32le(num);
}
static inline uint64_t
read64be(const uint8_t *buf)
{
uint64_t num = *(const uint64_t *)buf;
return conv64be(num);
}
static inline uint64_t
read64le(const uint8_t *buf)
{
uint64_t num = *(const uint64_t *)buf;
return conv64le(num);
}
// NOTE: Possible byte swapping must be done in a macro to allow GCC
// to optimize byte swapping of constants when using glibc's or *BSD's
// byte swapping macros. The actual write is done in an inline function
// to make type checking of the buf pointer possible similarly to readXXYe()
// functions.
#define write16be(buf, num) write16ne((buf), conv16be(num))
#define write16le(buf, num) write16ne((buf), conv16le(num))
#define write32be(buf, num) write32ne((buf), conv32be(num))
#define write32le(buf, num) write32ne((buf), conv32le(num))
#define write64be(buf, num) write64ne((buf), conv64be(num))
#define write64le(buf, num) write64ne((buf), conv64le(num))
static inline void
write16ne(uint8_t *buf, uint16_t num)
{
*(uint16_t *)buf = num;
return;
}
static inline void
write32ne(uint8_t *buf, uint32_t num)
{
*(uint32_t *)buf = num;
return;
}
static inline void
write64ne(uint8_t *buf, uint64_t num)
{
*(uint64_t *)buf = num;
return;
}
////////////////////////////////
// Unaligned reads and writes //
////////////////////////////////
// NOTE: TUKLIB_FAST_UNALIGNED_ACCESS indicates only support for 16-bit and
// 32-bit unaligned integer loads and stores. It's possible that 64-bit
// unaligned access doesn't work or is slower than byte-by-byte access.
// Since unaligned 64-bit is probably not needed as often as 16-bit or
// 32-bit, we simply don't support 64-bit unaligned access for now.
#ifdef TUKLIB_FAST_UNALIGNED_ACCESS
# define unaligned_read16be read16be
# define unaligned_read16le read16le
# define unaligned_read32be read32be
# define unaligned_read32le read32le
# define unaligned_write16be write16be
# define unaligned_write16le write16le
# define unaligned_write32be write32be
# define unaligned_write32le write32le
#else
static inline uint16_t
unaligned_read16be(const uint8_t *buf)
{
uint16_t num = ((uint16_t)buf[0] << 8) | (uint16_t)buf[1];
return num;
}
static inline uint16_t
unaligned_read16le(const uint8_t *buf)
{
uint16_t num = ((uint16_t)buf[0]) | ((uint16_t)buf[1] << 8);
return num;
}
static inline uint32_t
unaligned_read32be(const uint8_t *buf)
{
uint32_t num = (uint32_t)buf[0] << 24;
num |= (uint32_t)buf[1] << 16;
num |= (uint32_t)buf[2] << 8;
num |= (uint32_t)buf[3];
return num;
}
static inline uint32_t
unaligned_read32le(const uint8_t *buf)
{
uint32_t num = (uint32_t)buf[0];
num |= (uint32_t)buf[1] << 8;
num |= (uint32_t)buf[2] << 16;
num |= (uint32_t)buf[3] << 24;
return num;
}
static inline void
unaligned_write16be(uint8_t *buf, uint16_t num)
{
buf[0] = num >> 8;
buf[1] = num;
return;
}
static inline void
unaligned_write16le(uint8_t *buf, uint16_t num)
{
buf[0] = num;
buf[1] = num >> 8;
return;
}
static inline void
unaligned_write32be(uint8_t *buf, uint32_t num)
{
buf[0] = num >> 24;
buf[1] = num >> 16;
buf[2] = num >> 8;
buf[3] = num;
return;
}
static inline void
unaligned_write32le(uint8_t *buf, uint32_t num)
{
buf[0] = num;
buf[1] = num >> 8;
buf[2] = num >> 16;
buf[3] = num >> 24;
return;
}
#endif
static inline uint32_t
bsr32(uint32_t n)
{
// Check for ICC first, since it tends to define __GNUC__ too.
#if defined(__INTEL_COMPILER)
return _bit_scan_reverse(n);
#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX == UINT32_MAX
// GCC >= 3.4 has __builtin_clz(), which gives good results on
// multiple architectures. On x86, __builtin_clz() ^ 31U becomes
// either plain BSR (so the XOR gets optimized away) or LZCNT and
// XOR (if -march indicates that SSE4a instructions are supported).
return __builtin_clz(n) ^ 31U;
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
uint32_t i;
__asm__("bsrl %1, %0" : "=r" (i) : "rm" (n));
return i;
#elif defined(_MSC_VER) && _MSC_VER >= 1400
// MSVC isn't supported by tuklib, but since this code exists,
// it doesn't hurt to have it here anyway.
uint32_t i;
_BitScanReverse((DWORD *)&i, n);
return i;
#else
uint32_t i = 31;
if ((n & UINT32_C(0xFFFF0000)) == 0) {
n <<= 16;
i = 15;
}
if ((n & UINT32_C(0xFF000000)) == 0) {
n <<= 8;
i -= 8;
}
if ((n & UINT32_C(0xF0000000)) == 0) {
n <<= 4;
i -= 4;
}
if ((n & UINT32_C(0xC0000000)) == 0) {
n <<= 2;
i -= 2;
}
if ((n & UINT32_C(0x80000000)) == 0)
--i;
return i;
#endif
}
static inline uint32_t
clz32(uint32_t n)
{
#if defined(__INTEL_COMPILER)
return _bit_scan_reverse(n) ^ 31U;
#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX == UINT32_MAX
return __builtin_clz(n);
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
uint32_t i;
__asm__("bsrl %1, %0\n\t"
"xorl $31, %0"
: "=r" (i) : "rm" (n));
return i;
#elif defined(_MSC_VER) && _MSC_VER >= 1400
uint32_t i;
_BitScanReverse((DWORD *)&i, n);
return i ^ 31U;
#else
uint32_t i = 0;
if ((n & UINT32_C(0xFFFF0000)) == 0) {
n <<= 16;
i = 16;
}
if ((n & UINT32_C(0xFF000000)) == 0) {
n <<= 8;
i += 8;
}
if ((n & UINT32_C(0xF0000000)) == 0) {
n <<= 4;
i += 4;
}
if ((n & UINT32_C(0xC0000000)) == 0) {
n <<= 2;
i += 2;
}
if ((n & UINT32_C(0x80000000)) == 0)
++i;
return i;
#endif
}
static inline uint32_t
ctz32(uint32_t n)
{
#if defined(__INTEL_COMPILER)
return _bit_scan_forward(n);
#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX >= UINT32_MAX
return __builtin_ctz(n);
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
uint32_t i;
__asm__("bsfl %1, %0" : "=r" (i) : "rm" (n));
return i;
#elif defined(_MSC_VER) && _MSC_VER >= 1400
uint32_t i;
_BitScanForward((DWORD *)&i, n);
return i;
#else
uint32_t i = 0;
if ((n & UINT32_C(0x0000FFFF)) == 0) {
n >>= 16;
i = 16;
}
if ((n & UINT32_C(0x000000FF)) == 0) {
n >>= 8;
i += 8;
}
if ((n & UINT32_C(0x0000000F)) == 0) {
n >>= 4;
i += 4;
}
if ((n & UINT32_C(0x00000003)) == 0) {
n >>= 2;
i += 2;
}
if ((n & UINT32_C(0x00000001)) == 0)
++i;
return i;
#endif
}
#define bsf32 ctz32
#endif

66
src/common/tuklib_mbstr.h Normal file
View File

@@ -0,0 +1,66 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_mstr.h
/// \brief Utility functions for handling multibyte strings
///
/// If not enough multibyte string support is available in the C library,
/// these functions keep working with the assumption that all strings
/// are in a single-byte character set without combining characters, e.g.
/// US-ASCII or ISO-8859-*.
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_MBSTR_H
#define TUKLIB_MBSTR_H
#include "tuklib_common.h"
TUKLIB_DECLS_BEGIN
#define tuklib_mbstr_width TUKLIB_SYMBOL(tuklib_mbstr_width)
extern size_t tuklib_mbstr_width(const char *str, size_t *bytes);
///<
/// \brief Get the number of columns needed for the multibyte string
///
/// This is somewhat similar to wcswidth() but works on multibyte strings.
///
/// \param str String whose width is to be calculated. If the
/// current locale uses a multibyte character set
/// that has shift states, the string must begin
/// and end in the initial shift state.
/// \param bytes If this is not NULL, *bytes is set to the
/// value returned by strlen(str) (even if an
/// error occurs when calculating the width).
///
/// \return On success, the number of columns needed to display the
/// string e.g. in a terminal emulator is returned. On error,
/// (size_t)-1 is returned. Possible errors include invalid,
/// partial, or non-printable multibyte character in str, or
/// that str doesn't end in the initial shift state.
#define tuklib_mbstr_fw TUKLIB_SYMBOL(tuklib_mbstr_fw)
extern int tuklib_mbstr_fw(const char *str, int columns_min);
///<
/// \brief Get the field width for printf() e.g. to align table columns
///
/// Printing simple tables to a terminal can be done using the field field
/// feature in the printf() format string, but it works only with single-byte
/// character sets. To do the same with multibyte strings, tuklib_mbstr_fw()
/// can be used to calculate appropriate field width.
///
/// The behavior of this function is undefined, if
/// - str is NULL or not terminated with '\0';
/// - columns_min <= 0; or
/// - the calculated field width exceeds INT_MAX.
///
/// \return If tuklib_mbstr_width(str, NULL) fails, -1 is returned.
/// If str needs more columns than columns_min, zero is returned.
/// Otherwise a positive integer is returned, which can be
/// used as the field width, e.g. printf("%*s", fw, str).
TUKLIB_DECLS_END
#endif

View File

@@ -0,0 +1,31 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_mstr_fw.c
/// \brief Get the field width for printf() e.g. to align table columns
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_mbstr.h"
extern int
tuklib_mbstr_fw(const char *str, int columns_min)
{
size_t len;
const size_t width = tuklib_mbstr_width(str, &len);
if (width == (size_t)-1)
return -1;
if (width > (size_t)columns_min)
return 0;
if (width < (size_t)columns_min)
len += (size_t)columns_min - width;
return len;
}

View File

@@ -0,0 +1,64 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_mstr_width.c
/// \brief Calculate width of a multibyte string
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_mbstr.h"
#if defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)
# include <wchar.h>
#endif
extern size_t
tuklib_mbstr_width(const char *str, size_t *bytes)
{
const size_t len = strlen(str);
if (bytes != NULL)
*bytes = len;
#if !(defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH))
// In single-byte mode, the width of the string is the same
// as its length.
return len;
#else
mbstate_t state;
memset(&state, 0, sizeof(state));
size_t width = 0;
size_t i = 0;
// Convert one multibyte character at a time to wchar_t
// and get its width using wcwidth().
while (i < len) {
wchar_t wc;
const size_t ret = mbrtowc(&wc, str + i, len - i, &state);
if (ret < 1 || ret > len)
return (size_t)-1;
i += ret;
const int wc_width = wcwidth(wc);
if (wc_width < 0)
return (size_t)-1;
width += wc_width;
}
// Require that the string ends in the initial shift state.
// This way the caller can be combine the string with other
// strings without needing to worry about the shift states.
if (!mbsinit(&state))
return (size_t)-1;
return width;
#endif
}

View File

@@ -1,27 +1,33 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file open_stdxxx.h
/// \file tuklib_open_stdxxx.c
/// \brief Make sure that file descriptors 0, 1, and 2 are open
//
// This code has been put into the public domain.
// Author: Lasse Collin
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef OPEN_STDXXX_H
#define OPEN_STDXXX_H
#include "tuklib_open_stdxxx.h"
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#ifndef TUKLIB_DOSLIKE
# include <stdlib.h>
# include <errno.h>
# include <fcntl.h>
# include <unistd.h>
#endif
static void
open_stdxxx(int status)
extern void
tuklib_open_stdxxx(int err_status)
{
#ifdef TUKLIB_DOSLIKE
// Do nothing, just silence warnings.
(void)err_status;
#else
for (int i = 0; i <= 2; ++i) {
// We use fcntl() to check if the file descriptor is open.
if (fcntl(i, F_GETFD) == -1 && errno == EBADF) {
@@ -39,12 +45,11 @@ open_stdxxx(int status)
// may very well be non-existent. This
// error should be extremely rare.
(void)close(fd);
exit(status);
exit(err_status);
}
}
}
#endif
return;
}
#endif

View File

@@ -0,0 +1,23 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_open_stdxxx.h
/// \brief Make sure that file descriptors 0, 1, and 2 are open
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_OPEN_STDXXX_H
#define TUKLIB_OPEN_STDXXX_H
#include "tuklib_common.h"
TUKLIB_DECLS_BEGIN
#define tuklib_open_stdxx TUKLIB_SYMBOL(tuklib_open_stdxxx)
extern void tuklib_open_stdxxx(int err_status);
TUKLIB_DECLS_END
#endif

196
src/common/tuklib_physmem.c Normal file
View File

@@ -0,0 +1,196 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_physmem.c
/// \brief Get the amount of physical memory
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_physmem.h"
// We want to use Windows-specific code on Cygwin, which also has memory
// information available via sysconf(), but on Cygwin 1.5 and older it
// gives wrong results (from our point of view).
#if defined(_WIN32) || defined(__CYGWIN__)
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
# include <windows.h>
#elif defined(__OS2__)
# define INCL_DOSMISC
# include <os2.h>
#elif defined(__DJGPP__)
# include <dpmi.h>
#elif defined(__VMS)
# include <lib$routines.h>
# include <syidef.h>
# include <ssdef.h>
// AIX
#elif defined(TUKLIB_PHYSMEM_AIX)
# include <sys/systemcfg.h>
#elif defined(TUKLIB_PHYSMEM_SYSCONF)
# include <unistd.h>
#elif defined(TUKLIB_PHYSMEM_SYSCTL)
# ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
# endif
# include <sys/sysctl.h>
// Tru64
#elif defined(TUKLIB_PHYSMEM_GETSYSINFO)
# include <sys/sysinfo.h>
# include <machine/hal_sysinfo.h>
// HP-UX
#elif defined(TUKLIB_PHYSMEM_PSTAT_GETSTATIC)
# include <sys/param.h>
# include <sys/pstat.h>
// IRIX
#elif defined(TUKLIB_PHYSMEM_GETINVENT_R)
# include <invent.h>
// This sysinfo() is Linux-specific.
#elif defined(TUKLIB_PHYSMEM_SYSINFO)
# include <sys/sysinfo.h>
#endif
extern uint64_t
tuklib_physmem(void)
{
uint64_t ret = 0;
#if defined(_WIN32) || defined(__CYGWIN__)
if ((GetVersion() & 0xFF) >= 5) {
// Windows 2000 and later have GlobalMemoryStatusEx() which
// supports reporting values greater than 4 GiB. To keep the
// code working also on older Windows versions, use
// GlobalMemoryStatusEx() conditionally.
HMODULE kernel32 = GetModuleHandle("kernel32.dll");
if (kernel32 != NULL) {
BOOL (WINAPI *gmse)(LPMEMORYSTATUSEX) = GetProcAddress(
kernel32, "GlobalMemoryStatusEx");
if (gmse != NULL) {
MEMORYSTATUSEX meminfo;
meminfo.dwLength = sizeof(meminfo);
if (gmse(&meminfo))
ret = meminfo.ullTotalPhys;
}
}
}
if (ret == 0) {
// GlobalMemoryStatus() is supported by Windows 95 and later,
// so it is fine to link against it unconditionally. Note that
// GlobalMemoryStatus() has no return value.
MEMORYSTATUS meminfo;
meminfo.dwLength = sizeof(meminfo);
GlobalMemoryStatus(&meminfo);
ret = meminfo.dwTotalPhys;
}
#elif defined(__OS2__)
unsigned long mem;
if (DosQuerySysInfo(QSV_TOTPHYSMEM, QSV_TOTPHYSMEM,
&mem, sizeof(mem)) == 0)
ret = mem;
#elif defined(__DJGPP__)
__dpmi_free_mem_info meminfo;
if (__dpmi_get_free_memory_information(&meminfo) == 0
&& meminfo.total_number_of_physical_pages
!= (unsigned long)-1)
ret = (uint64_t)meminfo.total_number_of_physical_pages * 4096;
#elif defined(__VMS)
int vms_mem;
int val = SYI$_MEMSIZE;
if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL)
ret = (uint64_t)vms_mem * 8192;
#elif defined(TUKLIB_PHYSMEM_AIX)
ret = _system_configuration.physmem;
#elif defined(TUKLIB_PHYSMEM_SYSCONF)
const long pagesize = sysconf(_SC_PAGESIZE);
const long pages = sysconf(_SC_PHYS_PAGES);
if (pagesize != -1 && pages != -1)
// According to docs, pagesize * pages can overflow.
// Simple case is 32-bit box with 4 GiB or more RAM,
// which may report exactly 4 GiB of RAM, and "long"
// being 32-bit will overflow. Casting to uint64_t
// hopefully avoids overflows in the near future.
ret = (uint64_t)pagesize * (uint64_t)pages;
#elif defined(TUKLIB_PHYSMEM_SYSCTL)
int name[2] = {
CTL_HW,
#ifdef HW_PHYSMEM64
HW_PHYSMEM64
#else
HW_PHYSMEM
#endif
};
union {
uint32_t u32;
uint64_t u64;
} mem;
size_t mem_ptr_size = sizeof(mem.u64);
if (sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, 0) != -1) {
// IIRC, 64-bit "return value" is possible on some 64-bit
// BSD systems even with HW_PHYSMEM (instead of HW_PHYSMEM64),
// so support both.
if (mem_ptr_size == sizeof(mem.u64))
ret = mem.u64;
else if (mem_ptr_size == sizeof(mem.u32))
ret = mem.u32;
}
#elif defined(TUKLIB_PHYSMEM_GETSYSINFO)
// Docs are unclear if "start" is needed, but it doesn't hurt
// much to have it.
int memkb;
int start = 0;
if (getsysinfo(GSI_PHYSMEM, (caddr_t)&memkb, sizeof(memkb), &start)
!= -1)
ret = (uint64_t)memkb * 1024;
#elif defined(TUKLIB_PHYSMEM_PSTAT_GETSTATIC)
struct pst_static pst;
if (pstat_getstatic(&pst, sizeof(pst), 1, 0) != -1)
ret = (uint64_t)pst.physical_memory * (uint64_t)pst.page_size;
#elif defined(TUKLIB_PHYSMEM_GETINVENT_R)
inv_state_t *st = NULL;
if (setinvent_r(&st) != -1) {
inventory_t *i;
while ((i = getinvent_r(st)) != NULL) {
if (i->inv_class == INV_MEMORY
&& i->inv_type == INV_MAIN_MB) {
ret = (uint64_t)i->inv_state << 20;
break;
}
}
endinvent_r(st);
}
#elif defined(TUKLIB_PHYSMEM_SYSINFO)
struct sysinfo si;
if (sysinfo(&si) == 0)
ret = (uint64_t)si.totalram * si.mem_unit;
#endif
return ret;
}

View File

@@ -0,0 +1,28 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_physmem.h
/// \brief Get the amount of physical memory
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_PHYSMEM_H
#define TUKLIB_PHYSMEM_H
#include "tuklib_common.h"
TUKLIB_DECLS_BEGIN
#define tuklib_physmem TUKLIB_SYMBOL(tuklib_physmem)
extern uint64_t tuklib_physmem(void);
///<
/// \brief Get the amount of physical memory in bytes
///
/// \return Amount of physical memory in bytes. On error, zero is
/// returned.
TUKLIB_DECLS_END
#endif

View File

@@ -0,0 +1,50 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_progname.c
/// \brief Program name to be displayed in messages
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_progname.h"
#include <string.h>
#if !HAVE_DECL_PROGRAM_INVOCATION_NAME
char *progname = NULL;
#endif
extern void
tuklib_progname_init(char **argv)
{
#ifdef TUKLIB_DOSLIKE
// On these systems, argv[0] always has the full path and .exe
// suffix even if the user just types the plain program name.
// We modify argv[0] to make it nicer to read.
// Strip the leading path.
char *p = argv[0] + strlen(argv[0]);
while (argv[0] < p && p[-1] != '/' && p[-1] != '\\')
--p;
argv[0] = p;
// Strip the .exe suffix.
p = strrchr(p, '.');
if (p != NULL)
*p = '\0';
// Make it lowercase.
for (p = argv[0]; *p != '\0'; ++p)
if (*p >= 'A' && *p <= 'Z')
*p = *p - 'A' + 'a';
#endif
progname = argv[0];
return;
}

View File

@@ -0,0 +1,32 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_progname.h
/// \brief Program name to be displayed in messages
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_PROGNAME_H
#define TUKLIB_PROGNAME_H
#include "tuklib_common.h"
#include <errno.h>
TUKLIB_DECLS_BEGIN
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
# define progname program_invocation_name
#else
# define progname TUKLIB_SYMBOL(tuklib_progname)
extern char *progname;
#endif
#define tuklib_progname_init TUKLIB_SYMBOL(tuklib_progname_init)
extern void tuklib_progname_init(char **argv);
TUKLIB_DECLS_END
#endif

View File

@@ -1,47 +1,90 @@
##
## Copyright (C) 2007 Lasse Collin
## Author: Lasse Collin
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
SUBDIRS = api common check
SUBDIRS = api
EXTRA_DIST =
CLEANFILES =
doc_DATA =
lib_LTLIBRARIES = liblzma.la
liblzma_la_SOURCES =
liblzma_la_LDFLAGS = -version-info 0:0:0
liblzma_la_SOURCES = $(top_srcdir)/src/common/tuklib_physmem.c
liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/api \
-I$(top_srcdir)/src/liblzma/common \
-I$(top_srcdir)/src/liblzma/check \
-I$(top_srcdir)/src/liblzma/lz \
-I$(top_srcdir)/src/liblzma/rangecoder \
-I$(top_srcdir)/src/liblzma/lzma \
-I$(top_srcdir)/src/liblzma/delta \
-I$(top_srcdir)/src/liblzma/simple \
-I$(top_srcdir)/src/common \
-DTUKLIB_SYMBOL_PREFIX=lzma_
liblzma_la_LDFLAGS = -no-undefined -version-info 5:2:0
liblzma_la_LIBADD = \
common/libcommon.la \
check/libcheck.la
include $(srcdir)/common/Makefile.inc
include $(srcdir)/check/Makefile.inc
if COND_FILTER_LZMA
SUBDIRS += lz lzma rangecoder
liblzma_la_LIBADD += \
lz/liblz.la \
lzma/liblzma4.la \
rangecoder/librangecoder.la
if COND_FILTER_LZ
include $(srcdir)/lz/Makefile.inc
endif
if COND_FILTER_SUBBLOCK
SUBDIRS += subblock
liblzma_la_LIBADD += subblock/libsubblock.la
if COND_FILTER_LZMA1
include $(srcdir)/lzma/Makefile.inc
include $(srcdir)/rangecoder/Makefile.inc
endif
if COND_MAIN_SIMPLE
SUBDIRS += simple
liblzma_la_LIBADD += simple/libsimple.la
if COND_FILTER_DELTA
include $(srcdir)/delta/Makefile.inc
endif
if COND_FILTER_SIMPLE
include $(srcdir)/simple/Makefile.inc
endif
## Windows-specific stuff
# Windows resource compiler support. libtool knows what to do with .rc
# files, but Automake (<= 1.11 at least) doesn't know.
#
# We want the resource file only in shared liblzma. To avoid linking it into
# static liblzma, we overwrite the static object file with an object file
# compiled from empty input. Note that GNU-specific features are OK here,
# because on Windows we are compiled with the GNU toolchain.
.rc.lo:
$(LIBTOOL) --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) \
-i $< -o $@
echo > empty.c
$(COMPILE) -c empty.c -o $(*D)/$(*F).o
# Remove ordinals from the generated .def file. People must link by name,
# not by ordinal, because no one is going to track the ordinal numbers.
liblzma.def: liblzma.la liblzma.def.in
sed 's/ \+@ *[0-9]\+//' liblzma.def.in > liblzma.def
# Creating liblzma.def.in is a side effect of linking the library.
liblzma.def.in: liblzma.la
if COND_W32
CLEANFILES += liblzma.def liblzma.def.in empty.c
liblzma_la_SOURCES += liblzma_w32res.rc
liblzma_la_LDFLAGS += -Xlinker --output-def -Xlinker liblzma.def.in
## liblzma.def.in is created only when building shared liblzma, so don't
## try to create liblzma.def when not building shared liblzma.
if COND_SHARED
doc_DATA += liblzma.def
endif
endif
## pkg-config
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = lzma.pc
EXTRA_DIST = lzma.pc.in
pkgconfig_DATA = liblzma.pc
EXTRA_DIST += liblzma.pc.in

View File

@@ -1,39 +1,23 @@
##
## Copyright (C) 2007 Lasse Collin
## Author: Lasse Collin
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
nobase_include_HEADERS = \
lzma.h \
lzma/alignment.h \
lzma/alone.h \
lzma/auto.h \
lzma/base.h \
lzma/bcj.h \
lzma/block.h \
lzma/check.h \
lzma/copy.h \
lzma/container.h \
lzma/delta.h \
lzma/extra.h \
lzma/filter.h \
lzma/hardware.h \
lzma/index.h \
lzma/info.h \
lzma/init.h \
lzma/index_hash.h \
lzma/lzma.h \
lzma/memlimit.h \
lzma/metadata.h \
lzma/raw.h \
lzma/simple.h \
lzma/stream.h \
lzma/stream_flags.h \
lzma/subblock.h \
lzma/version.h \
lzma/vli.h

View File

@@ -1,64 +1,264 @@
/**
* \file lzma.h
* \brief The public API of liblzma
* \file api/lzma.h
* \brief The public API of liblzma data compression library
*
* liblzma is a LZMA compression library with a zlib-like API.
* liblzma is based on LZMA SDK found from http://7-zip.org/sdk.html.
* liblzma is a public domain general-purpose data compression library with
* a zlib-like API. The native file format is .xz, but also the old .lzma
* format and raw (no headers) streams are supported. Multiple compression
* algorithms (filters) are supported. Currently LZMA2 is the primary filter.
*
* \author Copyright (C) 1999-2006 Igor Pavlov
* \author Copyright (C) 2007 Lasse Collin
* liblzma is part of XZ Utils <http://tukaani.org/xz/>. XZ Utils includes
* a gzip-like command line tool named xz and some other tools. XZ Utils
* is developed and maintained by Lasse Collin.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* Major parts of liblzma are based on Igor Pavlov's public domain LZMA SDK
* <http://7-zip.org/sdk.html>.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* The SHA-256 implementation is based on the public domain code found from
* 7-Zip <http://7-zip.org/>, which has a modified version of the public
* domain SHA-256 code found from Crypto++ <http://www.cryptopp.com/>.
* The SHA-256 code in Crypto++ was written by Kevin Springle and Wei Dai.
*/
/*
* Author: Lasse Collin
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
*/
#ifndef LZMA_H
#define LZMA_H
/********************
* External headers *
********************/
/*****************************
* Required standard headers *
*****************************/
/* size_t */
#include <sys/types.h>
/*
* liblzma API headers need some standard types and macros. To allow
* including lzma.h without requiring the application to include other
* headers first, lzma.h includes the required standard headers unless
* they already seem to be included already or if LZMA_MANUAL_HEADERS
* has been defined.
*
* Here's what types and macros are needed and from which headers:
* - stddef.h: size_t, NULL
* - stdint.h: uint8_t, uint32_t, uint64_t, UINT32_C(n), uint64_C(n),
* UINT32_MAX, UINT64_MAX
*
* However, inttypes.h is a little more portable than stdint.h, although
* inttypes.h declares some unneeded things compared to plain stdint.h.
*
* The hacks below aren't perfect, specifically they assume that inttypes.h
* exists and that it typedefs at least uint8_t, uint32_t, and uint64_t,
* and that, in case of incomplete inttypes.h, unsigned int is 32-bit.
* If the application already takes care of setting up all the types and
* macros properly (for example by using gnulib's stdint.h or inttypes.h),
* we try to detect that the macros are already defined and don't include
* inttypes.h here again. However, you may define LZMA_MANUAL_HEADERS to
* force this file to never include any system headers.
*
* Some could argue that liblzma API should provide all the required types,
* for example lzma_uint64, LZMA_UINT64_C(n), and LZMA_UINT64_MAX. This was
* seen as an unnecessary mess, since most systems already provide all the
* necessary types and macros in the standard headers.
*
* Note that liblzma API still has lzma_bool, because using stdbool.h would
* break C89 and C++ programs on many systems. sizeof(bool) in C99 isn't
* necessarily the same as sizeof(bool) in C++.
*/
/* NULL */
#include <stddef.h>
#ifndef LZMA_MANUAL_HEADERS
/*
* I suppose this works portably also in C++. Note that in C++,
* we need to get size_t into the global namespace.
*/
# include <stddef.h>
/* uint8_t, uint32_t, uint64_t, UINT32_C, UINT64_C, UINT64_MAX. */
#include <inttypes.h>
/*
* Skip inttypes.h if we already have all the required macros. If we
* have the macros, we assume that we have the matching typedefs too.
*/
# if !defined(UINT32_C) || !defined(UINT64_C) \
|| !defined(UINT32_MAX) || !defined(UINT64_MAX)
/*
* MSVC has no C99 support, and thus it cannot be used to
* compile liblzma. The liblzma API has to still be usable
* from MSVC, so we need to define the required standard
* integer types here.
*/
# if defined(_WIN32) && defined(_MSC_VER)
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
# else
/* Use the standard inttypes.h. */
# ifdef __cplusplus
/*
* C99 sections 7.18.2 and 7.18.4 specify
* that C++ implementations define the limit
* and constant macros only if specifically
* requested. Note that if you want the
* format macros (PRIu64 etc.) too, you need
* to define __STDC_FORMAT_MACROS before
* including lzma.h, since re-including
* inttypes.h with __STDC_FORMAT_MACROS
* defined doesn't necessarily work.
*/
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS 1
# endif
# ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS 1
# endif
# endif
# include <inttypes.h>
# endif
/*
* Some old systems have only the typedefs in inttypes.h, and
* lack all the macros. For those systems, we need a few more
* hacks. We assume that unsigned int is 32-bit and unsigned
* long is either 32-bit or 64-bit. If these hacks aren't
* enough, the application has to setup the types manually
* before including lzma.h.
*/
# ifndef UINT32_C
# if defined(_WIN32) && defined(_MSC_VER)
# define UINT32_C(n) n ## UI32
# else
# define UINT32_C(n) n ## U
# endif
# endif
# ifndef UINT64_C
# if defined(_WIN32) && defined(_MSC_VER)
# define UINT64_C(n) n ## UI64
# else
/* Get ULONG_MAX. */
# include <limits.h>
# if ULONG_MAX == 4294967295UL
# define UINT64_C(n) n ## ULL
# else
# define UINT64_C(n) n ## UL
# endif
# endif
# endif
# ifndef UINT32_MAX
# define UINT32_MAX (UINT32_C(4294967295))
# endif
# ifndef UINT64_MAX
# define UINT64_MAX (UINT64_C(18446744073709551615))
# endif
# endif
#endif /* ifdef LZMA_MANUAL_HEADERS */
/******************
* GCC extensions *
* LZMA_API macro *
******************/
/*
* GCC extensions are used conditionally in the public API. It doesn't
* Some systems require that the functions and function pointers are
* declared specially in the headers. LZMA_API_IMPORT is for importing
* symbols and LZMA_API_CALL is to specify the calling convention.
*
* By default it is assumed that the application will link dynamically
* against liblzma. #define LZMA_API_STATIC in your application if you
* want to link against static liblzma. If you don't care about portability
* to operating systems like Windows, or at least don't care about linking
* against static liblzma on them, don't worry about LZMA_API_STATIC. That
* is, most developers will never need to use LZMA_API_STATIC.
*
* The GCC variants are a special case on Windows (Cygwin and MinGW).
* We rely on GCC doing the right thing with its auto-import feature,
* and thus don't use __declspec(dllimport). This way developers don't
* need to worry about LZMA_API_STATIC. Also the calling convention is
* omitted on Cygwin but not on MinGW.
*/
#ifndef LZMA_API_IMPORT
# if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__GNUC__)
# define LZMA_API_IMPORT __declspec(dllimport)
# else
# define LZMA_API_IMPORT
# endif
#endif
#ifndef LZMA_API_CALL
# if defined(_WIN32) && !defined(__CYGWIN__)
# define LZMA_API_CALL __cdecl
# else
# define LZMA_API_CALL
# endif
#endif
#ifndef LZMA_API
# define LZMA_API(type) LZMA_API_IMPORT type LZMA_API_CALL
#endif
/***********
* nothrow *
***********/
/*
* None of the functions in liblzma may throw an exception. Even
* the functions that use callback functions won't throw exceptions,
* because liblzma would break if a callback function threw an exception.
*/
#ifndef lzma_nothrow
# if defined(__cplusplus)
# define lzma_nothrow throw()
# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
# define lzma_nothrow __attribute__((__nothrow__))
# else
# define lzma_nothrow
# endif
#endif
/********************
* GNU C extensions *
********************/
/*
* GNU C extensions are used conditionally in the public API. It doesn't
* break anything if these are sometimes enabled and sometimes not, only
* affects warnings and optimizations.
*/
#if defined(__GNUC__) && __GNUC__ >= 3
#if __GNUC__ >= 3
# ifndef lzma_attribute
# define lzma_attribute(attr) __attribute__(attr)
# endif
# ifndef lzma_restrict
# define lzma_restrict __restrict__
/* warn_unused_result was added in GCC 3.4. */
# ifndef lzma_attr_warn_unused_result
# if __GNUC__ == 3 && __GNUC_MINOR__ < 4
# define lzma_attr_warn_unused_result
# endif
# endif
#else
# ifndef lzma_attribute
# define lzma_attribute(attr)
# endif
# ifndef lzma_restrict
# define lzma_restrict
# endif
#endif
#ifndef lzma_attr_pure
# define lzma_attr_pure lzma_attribute((__pure__))
#endif
#ifndef lzma_attr_const
# define lzma_attr_const lzma_attribute((__const__))
#endif
#ifndef lzma_attr_warn_unused_result
# define lzma_attr_warn_unused_result \
lzma_attribute((__warn_unused_result__))
#endif
@@ -77,37 +277,28 @@ extern "C" {
#define LZMA_H_INTERNAL 1
/* Basic features */
#include "lzma/init.h"
#include "lzma/version.h"
#include "lzma/base.h"
#include "lzma/vli.h"
#include "lzma/filter.h"
#include "lzma/check.h"
/* Filters */
#include "lzma/copy.h"
#include "lzma/subblock.h"
#include "lzma/simple.h"
#include "lzma/filter.h"
#include "lzma/bcj.h"
#include "lzma/delta.h"
#include "lzma/lzma.h"
/* Container formats and Metadata */
#include "lzma/block.h"
#include "lzma/index.h"
#include "lzma/extra.h"
#include "lzma/metadata.h"
#include "lzma/stream.h"
#include "lzma/alone.h"
#include "lzma/raw.h"
#include "lzma/auto.h"
/* Container formats */
#include "lzma/container.h"
/* Advanced features */
#include "lzma/info.h"
#include "lzma/alignment.h"
#include "lzma/stream_flags.h"
#include "lzma/memlimit.h"
#include "lzma/block.h"
#include "lzma/index.h"
#include "lzma/index_hash.h"
/* Version number */
#include "lzma/version.h"
/* Hardware information */
#include "lzma/hardware.h"
/*
* All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications

View File

@@ -1,60 +0,0 @@
/**
* \file lzma/alignment.h
* \brief Calculating input and output alignment of filter chains
*
* \author Copyright (C) 1999-2006 Igor Pavlov
* \author Copyright (C) 2007 Lasse Collin
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef LZMA_H_INTERNAL
# error Never include this file directly. Use <lzma.h> instead.
#endif
/**
* \brief Calculates the preferred alignment of the input data
*
* FIXME desc
*/
extern uint32_t lzma_alignment_input(
const lzma_options_filter *filters, uint32_t guess);
/**
* \brief Calculates the alignment of the encoded output
*
* Knowing the alignment of the output data is useful e.g. in the Block
* encoder which tries to align the Compressed Data field optimally.
*
* \param filters Pointer to lzma_options_filter array, whose last
* member must have .id = LZMA_VLI_VALUE_UNKNOWN.
* \param guess The value to return if the alignment of the output
* is the same as the alignment of the input data.
* If you want to always detect this special case,
* this guess to zero; this function never returns
* zero unless guess is zero.
*
* \return In most cases, a small positive integer is returned;
* for optimal use, the encoded output of this filter
* chain should start at on offset that is a multiple of
* the returned integer value.
*
* If the alignment of the output is the same as the input
* data (which this function cannot know), \a guess is
* returned.
*
* If an error occurs (that is, unknown Filter IDs or filter
* options), UINT32_MAX is returned.
*/
extern uint32_t lzma_alignment_output(
const lzma_options_filter *filters, uint32_t guess);

View File

@@ -1,82 +0,0 @@
/**
* \file lzma/alone.h
* \brief Handling of the legacy LZMA_Alone format
*
* \author Copyright (C) 1999-2006 Igor Pavlov
* \author Copyright (C) 2007 Lasse Collin
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef LZMA_H_INTERNAL
# error Never include this file directly. Use <lzma.h> instead.
#endif
/**
* \brief Options for files in the LZMA_Alone format
*/
typedef struct {
/**
* \brief Uncompressed Size and usage of End of Payload Marker
*
* In contrast to .lzma Blocks, LZMA_Alone format cannot have both
* uncompressed size field in the header and end of payload marker.
* If you don't know the uncompressed size beforehand, set it to
* LZMA_VLI_VALUE_UNKNOWN and liblzma will embed end of payload
* marker.
*/
lzma_vli uncompressed_size;
/**
* \brief LZMA options
*
* The LZMA_Alone format supports only one filter: the LZMA filter.
*
* \note There exists also an undocumented variant of the
* LZMA_Alone format, which uses the x86 filter in
* addition to LZMA. This format was never supported
* by LZMA Utils and is not supported by liblzma either.
*/
lzma_options_lzma lzma;
} lzma_options_alone;
/**
* \brief Initializes LZMA_Alone encoder
*
* LZMA_Alone files have the suffix .lzma like the .lzma Stream files.
* LZMA_Alone format supports only one filter, the LZMA filter. There is
* no support for integrity checks like CRC32.
*
* Use this format if and only if you need to create files readable by
* legacy LZMA tools.
*
* LZMA_Alone encoder doesn't support LZMA_SYNC_FLUSH or LZMA_FULL_FLUSH.
*
* \return - LZMA_OK
* - LZMA_MEM_ERROR
* - LZMA_PROG_ERROR
*/
extern lzma_ret lzma_alone_encoder(
lzma_stream *strm, const lzma_options_alone *options);
/**
* \brief Initializes decoder for LZMA_Alone file
*
* The LZMA_Alone decoder supports LZMA_SYNC_FLUSH.
*
* \return - LZMA_OK
* - LZMA_MEM_ERROR
*/
extern lzma_ret lzma_alone_decoder(lzma_stream *strm);

View File

@@ -1,41 +0,0 @@
/**
* \file lzma/auto.h
* \brief Decoder with automatic file format detection
*
* \author Copyright (C) 1999-2006 Igor Pavlov
* \author Copyright (C) 2007 Lasse Collin
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef LZMA_H_INTERNAL
# error Never include this file directly. Use <lzma.h> instead.
#endif
/**
* \brief Decode .lzma Streams and LZMA_Alone files with autodetection
*
* Autodetects between the .lzma Stream and LZMA_Alone formats, and
* calls lzma_stream_decoder_init() or lzma_alone_decoder_init() once
* the type of the file has been detected.
*
* \param strm Pointer to propertily prepared lzma_stream
* \param header Pointer to hold a pointer to Extra Records read
* from the Header Metadata Block. Use NULL if
* you don't care about Extra Records.
* \param footer Same as header, but for Footer Metadata Block.
*
* \return - LZMA_OK: Initialization was successful.
* - LZMA_MEM_ERROR: Cannot allocate memory.
*/
extern lzma_ret lzma_auto_decoder(lzma_stream *strm,
lzma_extra **header, lzma_extra **footer);

View File

@@ -1,19 +1,15 @@
/**
* \file lzma/base.h
* \brief Data types and functions used in many places of the public API
* \brief Data types and functions used in many places in liblzma API
*/
/*
* Author: Lasse Collin
*
* \author Copyright (C) 1999-2006 Igor Pavlov
* \author Copyright (C) 2007 Lasse Collin
* This file has been put into the public domain.
* You can do whatever you want with this file.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* See ../lzma.h for information about liblzma as a whole.
*/
#ifndef LZMA_H_INTERNAL
@@ -33,28 +29,193 @@
typedef unsigned char lzma_bool;
/**
* \brief Type of reserved enumeration variable in structures
*
* To avoid breaking library ABI when new features are added, several
* structures contain extra variables that may be used in future. Since
* sizeof(enum) can be different than sizeof(int), and sizeof(enum) may
* even vary depending on the range of enumeration constants, we specify
* a separate type to be used for reserved enumeration variables. All
* enumeration constants in liblzma API will be non-negative and less
* than 128, which should guarantee that the ABI won't break even when
* new constants are added to existing enumerations.
*/
typedef enum {
LZMA_RESERVED_ENUM = 0
} lzma_reserved_enum;
/**
* \brief Return values used by several functions in liblzma
*
* Check the descriptions of specific functions to find out which return
* values they can return and the exact meanings of the values in every
* situation. The descriptions given here are only suggestive.
* values they can return. With some functions the return values may have
* more specific meanings than described here; those differences are
* described per-function basis.
*/
typedef enum {
LZMA_OK = 0,
LZMA_OK = 0,
/**<
* \brief Operation completed successfully
*/
LZMA_STREAM_END = 1,
LZMA_STREAM_END = 1,
/**<
* \brief End of stream was reached
*
* The application should pick the last remaining output
* bytes from strm->next_out.
* In encoder, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or
* LZMA_FINISH was finished. In decoder, this indicates
* that all the data was successfully decoded.
*
* In all cases, when LZMA_STREAM_END is returned, the last
* output bytes should be picked from strm->next_out.
*/
LZMA_PROG_ERROR = -2,
LZMA_NO_CHECK = 2,
/**<
* \brief Input stream has no integrity check
*
* This return value can be returned only if the
* LZMA_TELL_NO_CHECK flag was used when initializing
* the decoder. LZMA_NO_CHECK is just a warning, and
* the decoding can be continued normally.
*
* It is possible to call lzma_get_check() immediately after
* lzma_code has returned LZMA_NO_CHECK. The result will
* naturally be LZMA_CHECK_NONE, but the possibility to call
* lzma_get_check() may be convenient in some applications.
*/
LZMA_UNSUPPORTED_CHECK = 3,
/**<
* \brief Cannot calculate the integrity check
*
* The usage of this return value is different in encoders
* and decoders.
*
* Encoders can return this value only from the initialization
* function. If initialization fails with this value, the
* encoding cannot be done, because there's no way to produce
* output with the correct integrity check.
*
* Decoders can return this value only from lzma_code() and
* only if the LZMA_TELL_UNSUPPORTED_CHECK flag was used when
* initializing the decoder. The decoding can still be
* continued normally even if the check type is unsupported,
* but naturally the check will not be validated, and possible
* errors may go undetected.
*
* With decoder, it is possible to call lzma_get_check()
* immediately after lzma_code() has returned
* LZMA_UNSUPPORTED_CHECK. This way it is possible to find
* out what the unsupported Check ID was.
*/
LZMA_GET_CHECK = 4,
/**<
* \brief Integrity check type is now available
*
* This value can be returned only by the lzma_code() function
* and only if the decoder was initialized with the
* LZMA_TELL_ANY_CHECK flag. LZMA_GET_CHECK tells the
* application that it may now call lzma_get_check() to find
* out the Check ID. This can be used, for example, to
* implement a decoder that accepts only files that have
* strong enough integrity check.
*/
LZMA_MEM_ERROR = 5,
/**<
* \brief Cannot allocate memory
*
* Memory allocation failed, or the size of the allocation
* would be greater than SIZE_MAX.
*
* Due to internal implementation reasons, the coding cannot
* be continued even if more memory were made available after
* LZMA_MEM_ERROR.
*/
LZMA_MEMLIMIT_ERROR = 6,
/**
* \brief Memory usage limit was reached
*
* Decoder would need more memory than allowed by the
* specified memory usage limit. To continue decoding,
* the memory usage limit has to be increased with
* lzma_memlimit_set().
*/
LZMA_FORMAT_ERROR = 7,
/**<
* \brief File format not recognized
*
* The decoder did not recognize the input as supported file
* format. This error can occur, for example, when trying to
* decode .lzma format file with lzma_stream_decoder,
* because lzma_stream_decoder accepts only the .xz format.
*/
LZMA_OPTIONS_ERROR = 8,
/**<
* \brief Invalid or unsupported options
*
* Invalid or unsupported options, for example
* - unsupported filter(s) or filter options; or
* - reserved bits set in headers (decoder only).
*
* Rebuilding liblzma with more features enabled, or
* upgrading to a newer version of liblzma may help.
*/
LZMA_DATA_ERROR = 9,
/**<
* \brief Data is corrupt
*
* The usage of this return value is different in encoders
* and decoders. In both encoder and decoder, the coding
* cannot continue after this error.
*
* Encoders return this if size limits of the target file
* format would be exceeded. These limits are huge, thus
* getting this error from an encoder is mostly theoretical.
* For example, the maximum compressed and uncompressed
* size of a .xz Stream is roughly 8 EiB (2^63 bytes).
*
* Decoders return this error if the input data is corrupt.
* This can mean, for example, invalid CRC32 in headers
* or invalid check of uncompressed data.
*/
LZMA_BUF_ERROR = 10,
/**<
* \brief No progress is possible
*
* This error code is returned when the coder cannot consume
* any new input and produce any new output. The most common
* reason for this error is that the input stream being
* decoded is truncated or corrupt.
*
* This error is not fatal. Coding can be continued normally
* by providing more input and/or more output space, if
* possible.
*
* Typically the first call to lzma_code() that can do no
* progress returns LZMA_OK instead of LZMA_BUF_ERROR. Only
* the second consecutive call doing no progress will return
* LZMA_BUF_ERROR. This is intentional.
*
* With zlib, Z_BUF_ERROR may be returned even if the
* application is doing nothing wrong, so apps will need
* to handle Z_BUF_ERROR specially. The above hack
* guarantees that liblzma never returns LZMA_BUF_ERROR
* to properly written applications unless the input file
* is truncated or corrupt. This should simplify the
* applications a little.
*/
LZMA_PROG_ERROR = 11,
/**<
* \brief Programming error
*
@@ -73,70 +234,24 @@ typedef enum {
* can be a sign of a bug in liblzma. See the documentation
* how to report bugs.
*/
LZMA_DATA_ERROR = -3,
/**<
* \brief Data is corrupt
*
* - Encoder: The input size doesn't match the uncompressed
* size given to lzma_*_encoder_init().
* - Decoder: The input is corrupt. This includes corrupted
* header, corrupted compressed data, and unmatching
* integrity Check.
*
* \todo What can be done if encoder returns this?
* Probably can continue by fixing the input
* amount, but make sure.
*/
LZMA_MEM_ERROR = -4,
/**<
* \brief Cannot allocate memory
*
* Memory allocation failed.
*/
LZMA_BUF_ERROR = -5,
/**<
* \brief No progress is possible
*
* This may happen when avail_in or avail_out is zero.
*
* \note This error is not fatal. Coding can continue
* normally once the reason for this error has
* been fixed.
*/
LZMA_HEADER_ERROR = -6,
/**<
* \brief Invalid or unsupported header
*
* Invalid or unsupported options, for example
* - unsupported filter(s) or filter options; or
* - reserved bits set in headers (decoder only).
*
* Rebuilding liblzma with more features enabled, or
* upgrading to a newer version of liblzma may help.
*/
LZMA_UNSUPPORTED_CHECK = -7,
/**<
* \brief Check type is unknown
*
* The type of Check is not supported, and thus the Check
* cannot be calculated. In the encoder, this is an error.
* In the decoder, this is only a warning and decoding can
* still proceed normally (but the Check is ignored).
*/
} lzma_ret;
/**
* \brief The `action' argument for lzma_code()
*
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or LZMA_FINISH,
* the same `action' must is used until lzma_code() returns LZMA_STREAM_END.
* Also, the amount of input (that is, strm->avail_in) must not be modified
* by the application until lzma_code() returns LZMA_STREAM_END. Changing the
* `action' or modifying the amount of input will make lzma_code() return
* LZMA_PROG_ERROR.
*/
typedef enum {
LZMA_RUN = 0,
/**<
* \brief Continue coding
*
* Encoder: Encode as much input as possible. Some internal
* buffering will probably be done (depends on the filter
* chain in use), which causes latency: the input used won't
@@ -144,55 +259,65 @@ typedef enum {
* lzma_code() call.
*
* Decoder: Decode as much input as possible and produce as
* much output as possible. This action provides best
* throughput, but may introduce latency, because the
* decoder may decode more data into its internal buffers
* than that fits into next_out.
* much output as possible.
*/
LZMA_SYNC_FLUSH = 1,
/**<
* Encoder: Makes all the data given to liblzma via next_in
* available in next_out without resetting the filters. Call
* lzma_code() with LZMA_SYNC_FLUSH until it returns
* LZMA_STREAM_END. Then continue encoding normally.
* \brief Make all the input available at output
*
* \note Synchronous flushing is supported only by
* some filters. Some filters support it only
* partially.
* Normally the encoder introduces some latency.
* LZMA_SYNC_FLUSH forces all the buffered data to be
* available at output without resetting the internal
* state of the encoder. This way it is possible to use
* compressed stream for example for communication over
* network.
*
* Decoder: Asks the decoder to decode only as much as is
* needed to fill next_out. This decreases latency with some
* filters, but is likely to decrease also throughput. It is
* a good idea to use this flag only when it is likely that
* you don't need more output soon.
* Only some filters support LZMA_SYNC_FLUSH. Trying to use
* LZMA_SYNC_FLUSH with filters that don't support it will
* make lzma_code() return LZMA_OPTIONS_ERROR. For example,
* LZMA1 doesn't support LZMA_SYNC_FLUSH but LZMA2 does.
*
* \note With decoder, this is not comparable to
* zlib's Z_SYNC_FLUSH.
* Using LZMA_SYNC_FLUSH very often can dramatically reduce
* the compression ratio. With some filters (for example,
* LZMA2), fine-tuning the compression options may help
* mitigate this problem significantly (for example,
* match finder with LZMA2).
*
* Decoders don't support LZMA_SYNC_FLUSH.
*/
LZMA_FULL_FLUSH = 2,
/**<
* Finishes encoding of the current Data Block. All the input
* data going to the current Data Block must have been given
* to the encoder (the last bytes can still be pending in
* next_in). Call lzma_code() with LZMA_FULL_FLUSH until
* it returns LZMA_STREAM_END. Then continue normally with
* LZMA_RUN or finish the Stream with LZMA_FINISH.
* \brief Finish encoding of the current Block
*
* This action is supported only by Multi-Block Stream
* encoder. If there is no unfinished Data Block, no empty
* Data Block is created.
* All the input data going to the current Block must have
* been given to the encoder (the last bytes can still be
* pending in* next_in). Call lzma_code() with LZMA_FULL_FLUSH
* until it returns LZMA_STREAM_END. Then continue normally
* with LZMA_RUN or finish the Stream with LZMA_FINISH.
*
* This action is currently supported only by Stream encoder
* and easy encoder (which uses Stream encoder). If there is
* no unfinished Block, no empty Block is created.
*/
LZMA_FINISH = 3
/**<
* Finishes the encoding operation. All the input data must
* have been given to the encoder (the last bytes can still
* be pending in next_in). Call lzma_code() with LZMA_FINISH
* until it returns LZMA_STREAM_END.
* \brief Finish the coding operation
*
* This action is not supported by decoders.
* All the input data must have been given to the encoder
* (the last bytes can still be pending in next_in).
* Call lzma_code() with LZMA_FINISH until it returns
* LZMA_STREAM_END. Once LZMA_FINISH has been used,
* the amount of input must no longer be changed by
* the application.
*
* When decoding, using LZMA_FINISH is optional unless the
* LZMA_CONCATENATED flag was used when the decoder was
* initialized. When LZMA_CONCATENATED was not used, the only
* effect of LZMA_FINISH is that the amount of input must not
* be changed just like in the encoder.
*/
} lzma_action;
@@ -201,8 +326,11 @@ typedef enum {
* \brief Custom functions for memory handling
*
* A pointer to lzma_allocator may be passed via lzma_stream structure
* to liblzma. The library will use these functions for memory handling
* instead of the default malloc() and free().
* to liblzma, and some advanced functions take a pointer to lzma_allocator
* as a separate function argument. The library will use the functions
* specified in lzma_allocator for memory handling instead of the default
* malloc() and free(). C++ users should note that the custom memory
* handling functions must not throw exceptions.
*
* 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
@@ -212,50 +340,54 @@ typedef enum {
*/
typedef struct {
/**
* \brief Pointer to custom memory allocation function
*
* Set this to point to your custom memory allocation function.
* It can be useful for example if you want to limit how much
* memory liblzma is allowed to use: for this, you may use
* a pointer to lzma_memory_alloc().
* \brief Pointer to a custom memory allocation function
*
* If you don't want a custom allocator, but still want
* custom free(), set this to NULL and liblzma will use
* the standard malloc().
*
* \param opaque lzma_allocator.opaque (see below)
* \param nmemb Number of elements like in calloc().
* liblzma will always set nmemb to 1.
* This argument exists only for
* \param nmemb Number of elements like in calloc(). liblzma
* will always set nmemb to 1, so it is safe to
* ignore nmemb in a custom allocator if you like.
* The nmemb argument exists only for
* compatibility with zlib and libbzip2.
* \param size Size of an element in bytes.
* liblzma never sets this to zero.
*
* \return Pointer to the beginning of a memory block of
* size nmemb * size, or NULL if allocation fails
* `size' bytes, or NULL if allocation fails
* for some reason. When allocation fails, functions
* of liblzma return LZMA_MEM_ERROR.
*
* The allocator should not waste time zeroing the allocated buffers.
* This is not only about speed, but also memory usage, since the
* operating system kernel doesn't necessarily allocate the requested
* memory in physical memory until it is actually used. With small
* input files, liblzma may actually need only a fraction of the
* memory that it requested for allocation.
*
* \note LZMA_MEM_ERROR is also used when the size of the
* allocation would be greater than SIZE_MAX. Thus,
* don't assume that the custom allocator must have
* returned NULL if some function from liblzma
* returns LZMA_MEM_ERROR.
*/
void *(*alloc)(void *opaque, size_t nmemb, size_t size);
void *(LZMA_API_CALL *alloc)(void *opaque, size_t nmemb, size_t size);
/**
* \brief Pointer to custom memory freeing function
*
* Set this to point to your custom memory freeing function.
* If lzma_memory_alloc() is used as allocator, this should
* be set to lzma_memory_free().
* \brief Pointer to a custom memory freeing function
*
* If you don't want a custom freeing function, but still
* want a custom allocator, set this to NULL and liblzma
* will use the standard free().
*
* \param opaque lzma_allocator.opaque (see below)
* \param ptr Pointer returned by
* lzma_allocator.alloc(), or when it
* is set to NULL, a pointer returned
* \param ptr Pointer returned by lzma_allocator.alloc(),
* or when it is set to NULL, a pointer returned
* by the standard malloc().
*/
void (*free)(void *opaque, void *ptr);
void (LZMA_API_CALL *free)(void *opaque, void *ptr);
/**
* \brief Pointer passed to .alloc() and .free()
@@ -264,11 +396,7 @@ typedef struct {
* and lzma_allocator.free(). This intended to ease implementing
* custom memory allocation functions for use with liblzma.
*
* When using lzma_memory_alloc() and lzma_memory_free(), opaque
* must point to lzma_memory_limitter structure allocated and
* initialized with lzma_memory_limitter_create().
*
* If you don't need this, you should set it to NULL.
* If you don't need this, you should set this to NULL.
*/
void *opaque;
@@ -287,35 +415,43 @@ typedef struct lzma_internal_s lzma_internal;
* \brief Passing data to and from liblzma
*
* The lzma_stream structure is used for
* - passing pointers to input and output buffers to liblzma;
* - defining custom memory hander functions; and
* - holding a pointer to coder-specific internal data structures.
* - passing pointers to input and output buffers to liblzma;
* - defining custom memory hander functions; and
* - holding a pointer to coder-specific internal data structures.
*
* Before calling any of the lzma_*_init() functions the first time,
* the application must reset lzma_stream to LZMA_STREAM_INIT. The
* lzma_*_init() function will verify the options, allocate internal
* data structures and store pointer to them into `internal'. Finally
* total_in and total_out are reset to zero. In contrast to zlib,
* next_in and avail_in are ignored by the initialization functions.
* Typical usage:
*
* The actual coding is done with the lzma_code() function. Application
* must update next_in, avail_in, next_out, and avail_out between
* calls to lzma_decode() just like with zlib.
* - After allocating lzma_stream (on stack or with malloc()), it must be
* initialized to LZMA_STREAM_INIT (see LZMA_STREAM_INIT for details).
*
* In contrast to zlib, even the decoder requires that there always
* is at least one byte space in next_out; if avail_out == 0,
* LZMA_BUF_ERROR is returned immediatelly. This shouldn't be a problem
* for most applications that already use zlib, but it's still worth
* checking your application.
* - Initialize a coder to the lzma_stream, for example by using
* lzma_easy_encoder() or lzma_auto_decoder(). Some notes:
* - In contrast to zlib, strm->next_in and strm->next_out are
* ignored by all initialization functions, thus it is safe
* to not initialize them yet.
* - The initialization functions always set strm->total_in and
* strm->total_out to zero.
* - If the initialization function fails, no memory is left allocated
* that would require freeing with lzma_end() even if some memory was
* associated with the lzma_stream structure when the initialization
* function was called.
*
* Application may modify values of total_in and total_out as it wants.
* - Use lzma_code() to do the actual work.
*
* - Once the coding has been finished, the existing lzma_stream can be
* reused. It is OK to reuse lzma_stream with different initialization
* function without calling lzma_end() first. Old allocations are
* automatically freed.
*
* - Finally, use lzma_end() to free the allocated memory. lzma_end() never
* frees the lzma_stream structure itself.
*
* Application may modify the values of total_in and total_out as it wants.
* They are updated by liblzma to match the amount of data read and
* written, but liblzma doesn't use the values internally.
*
* Application must not touch the `internal' pointer.
* written, but aren't used for anything else.
*/
typedef struct {
uint8_t *next_in; /**< Pointer to the next input byte. */
const uint8_t *next_in; /**< Pointer to the next input byte. */
size_t avail_in; /**< Number of available input bytes in next_in. */
uint64_t total_in; /**< Total number of bytes read by liblzma. */
@@ -324,87 +460,142 @@ typedef struct {
uint64_t total_out; /**< Total number of bytes written by liblzma. */
/**
* Custom memory allocation functions. Set to NULL to use
* \brief Custom memory allocation functions
*
* In most cases this is NULL which makes liblzma use
* the standard malloc() and free().
*/
lzma_allocator *allocator;
/** Internal state is not visible to outsiders. */
/** Internal state is not visible to applications. */
lzma_internal *internal;
/*
* Reserved space to allow possible future extensions without
* breaking the ABI. Excluding the initialization of this structure,
* you should not touch these, because the names of these variables
* may change.
*/
void *reserved_ptr1;
void *reserved_ptr2;
void *reserved_ptr3;
void *reserved_ptr4;
uint64_t reserved_int1;
uint64_t reserved_int2;
size_t reserved_int3;
size_t reserved_int4;
lzma_reserved_enum reserved_enum1;
lzma_reserved_enum reserved_enum2;
} lzma_stream;
/**
* \brief Initialization for lzma_stream
*
* When you declare an instance of lzma_stream, you can immediatelly
* When you declare an instance of lzma_stream, you can immediately
* initialize it so that initialization functions know that no memory
* has been allocated yet:
*
* lzma_stream strm = LZMA_STREAM_INIT;
*
* If you need to initialize a dynamically allocated lzma_stream, you can use
* memset(strm_pointer, 0, sizeof(lzma_stream)). Strictly speaking, this
* violates the C standard since NULL may have different internal
* representation than zero, but it should be portable enough in practice.
* Anyway, for maximum portability, you can use something like this:
*
* lzma_stream tmp = LZMA_STREAM_INIT;
* *strm = tmp;
*/
#define LZMA_STREAM_INIT { NULL, 0, 0, NULL, 0, 0, NULL, NULL }
#define LZMA_STREAM_INIT \
{ NULL, 0, 0, NULL, 0, 0, NULL, NULL, \
NULL, NULL, NULL, NULL, 0, 0, 0, 0, \
LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM }
/**
* \brief Initialization for lzma_stream
*
* This is like LZMA_STREAM_INIT, but this can be used when the lzma_stream
* has already been allocated:
*
* lzma_stream *strm = malloc(sizeof(lzma_stream));
* if (strm == NULL)
* return LZMA_MEM_ERROR;
* *strm = LZMA_STREAM_INIT_VAR;
*/
extern const lzma_stream LZMA_STREAM_INIT_VAR;
/**
* \brief Encodes or decodes data
* \brief Encode or decode data
*
* Once the lzma_stream has been successfully initialized (e.g. with
* lzma_stream_encoder_single()), the actual encoding or decoding is
* done using this function.
* lzma_stream_encoder()), the actual encoding or decoding is done
* using this function. The application has to update strm->next_in,
* strm->avail_in, strm->next_out, and strm->avail_out to pass input
* to and get output from liblzma.
*
* \return Some coders may have more exact meaning for different return
* values, which are mentioned separately in the description of
* the initialization functions. Here are the typical meanings:
* - LZMA_OK: So far all good.
* - LZMA_STREAM_END:
* - Encoder: LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or
* LZMA_FINISH completed.
* - Decoder: End of uncompressed data was reached.
* - LZMA_BUF_ERROR: Unable to progress. Provide more input or
* output space, and call this function again. This cannot
* occur if both avail_in and avail_out were non-zero (or
* there's a bug in liblzma).
* - LZMA_MEM_ERROR: Unable to allocate memory. Due to lazy
* programming, the coding cannot continue even if the
* application could free more memory. The next call must
* be lzma_end() or some initialization function.
* - LZMA_DATA_ERROR:
* - Encoder: Filter(s) cannot process the given data.
* - Decoder: Compressed data is corrupt.
* - LZMA_HEADER_ERROR: Unsupported options. Rebuilding liblzma
* with more features enabled or upgrading to a newer version
* may help, although usually this is a sign of invalid options
* (encoder) or corrupted input data (decoder).
* - LZMA_PROG_ERROR: Invalid arguments or the internal state
* of the coder is corrupt.
* See the description of the coder-specific initialization function to find
* out what `action' values are supported by the coder.
*/
extern lzma_ret lzma_code(lzma_stream *strm, lzma_action action);
extern LZMA_API(lzma_ret) lzma_code(lzma_stream *strm, lzma_action action)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Frees memory allocated for the coder data structures
* \brief Free memory allocated for the coder data structures
*
* \param strm Pointer to lzma_stream that is at least initialized
* with LZMA_STREAM_INIT.
*
* After lzma_end(strm), strm->internal is guaranteed to be NULL. No other
* members of the lzma_stream structure are touched.
*
* \note zlib indicates an error if application end()s unfinished
* stream. liblzma doesn't do this, and assumes that
* stream structure. liblzma doesn't do this, and assumes that
* application knows what it is doing.
*/
extern void lzma_end(lzma_stream *strm);
extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow;
/**
* \brief Get the memory usage of decoder filter chain
*
* This function is currently supported only when *strm has been initialized
* with a function that takes a memlimit argument. With other functions, you
* should use e.g. lzma_raw_encoder_memusage() or lzma_raw_decoder_memusage()
* to estimate the memory requirements.
*
* This function is useful e.g. after LZMA_MEMLIMIT_ERROR to find out how big
* the memory usage limit should have been to decode the input. Note that
* this may give misleading information if decoding .xz Streams that have
* multiple Blocks, because each Block can have different memory requirements.
*
* \return How much memory is currently allocated for the filter
* decoders. If no filter chain is currently allocated,
* some non-zero value is still returned, which is less than
* or equal to what any filter chain would indicate as its
* memory requirement.
*
* If this function isn't supported by *strm or some other error
* occurs, zero is returned.
*/
extern LZMA_API(uint64_t) lzma_memusage(const lzma_stream *strm)
lzma_nothrow lzma_attr_pure;
/**
* \brief Get the current memory usage limit
*
* This function is supported only when *strm has been initialized with
* a function that takes a memlimit argument.
*
* \return On success, the current memory usage limit is returned
* (always non-zero). On error, zero is returned.
*/
extern LZMA_API(uint64_t) lzma_memlimit_get(const lzma_stream *strm)
lzma_nothrow lzma_attr_pure;
/**
* \brief Set the memory usage limit
*
* This function is supported only when *strm has been initialized with
* a function that takes a memlimit argument.
*
* \return - LZMA_OK: New memory usage limit successfully set.
* - LZMA_MEMLIMIT_ERROR: The new limit is too small.
* The limit was not changed.
* - LZMA_PROG_ERROR: Invalid arguments, e.g. *strm doesn't
* support memory usage limit or memlimit was zero.
*/
extern LZMA_API(lzma_ret) lzma_memlimit_set(
lzma_stream *strm, uint64_t memlimit) lzma_nothrow;

View File

@@ -0,0 +1,90 @@
/**
* \file lzma/bcj.h
* \brief Branch/Call/Jump conversion filters
*/
/*
* Author: Lasse Collin
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
*
* See ../lzma.h for information about liblzma as a whole.
*/
#ifndef LZMA_H_INTERNAL
# error Never include this file directly. Use <lzma.h> instead.
#endif
/* Filter IDs for lzma_filter.id */
#define LZMA_FILTER_X86 LZMA_VLI_C(0x04)
/**<
* Filter for x86 binaries
*/
#define LZMA_FILTER_POWERPC LZMA_VLI_C(0x05)
/**<
* Filter for Big endian PowerPC binaries
*/
#define LZMA_FILTER_IA64 LZMA_VLI_C(0x06)
/**<
* Filter for IA-64 (Itanium) binaries.
*/
#define LZMA_FILTER_ARM LZMA_VLI_C(0x07)
/**<
* Filter for ARM binaries.
*/
#define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08)
/**<
* Filter for ARM-Thumb binaries.
*/
#define LZMA_FILTER_SPARC LZMA_VLI_C(0x09)
/**<
* Filter for SPARC binaries.
*/
/**
* \brief Options for BCJ filters
*
* The BCJ filters never change the size of the data. Specifying options
* for them is optional: if pointer to options is NULL, default value is
* used. You probably never need to specify options to BCJ filters, so just
* set the options pointer to NULL and be happy.
*
* If options with non-default values have been specified when encoding,
* the same options must also be specified when decoding.
*
* \note At the moment, none of the BCJ filters support
* LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified,
* LZMA_OPTIONS_ERROR will be returned. If there is need,
* partial support for LZMA_SYNC_FLUSH can be added in future.
* Partial means that flushing would be possible only at
* offsets that are multiple of 2, 4, or 16 depending on
* the filter, except x86 which cannot be made to support
* LZMA_SYNC_FLUSH predictably.
*/
typedef struct {
/**
* \brief Start offset for conversions
*
* This setting is useful only when the same filter is used
* _separately_ for multiple sections of the same executable file,
* and the sections contain cross-section branch/call/jump
* instructions. In that case it is beneficial to set the start
* offset of the non-first sections so that the relative addresses
* of the cross-section branch/call/jump instructions will use the
* same absolute addresses as in the first section.
*
* When the pointer to options is NULL, the default value (zero)
* is used.
*/
uint32_t start_offset;
} lzma_options_bcj;

View File

@@ -1,19 +1,15 @@
/**
* \file lzma/block.h
* \brief .lzma Block handling
* \brief .xz Block handling
*/
/*
* Author: Lasse Collin
*
* \author Copyright (C) 1999-2006 Igor Pavlov
* \author Copyright (C) 2007 Lasse Collin
* This file has been put into the public domain.
* You can do whatever you want with this file.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* See ../lzma.h for information about liblzma as a whole.
*/
#ifndef LZMA_H_INTERNAL
@@ -22,388 +18,512 @@
/**
* \brief Options for the Block Header encoder and decoder
* \brief Options for the Block and Block Header encoders and decoders
*
* Different things use different parts of this structure. Some read
* some members, other functions write, and some do both. Only the
* Different Block handling functions use different parts of this structure.
* Some read some members, other functions write, and some do both. Only the
* members listed for reading need to be initialized when the specified
* functions are called. The members marked for writing will be assigned
* new values at some point either by calling the given function or by
* later calls to lzma_code().
*/
typedef struct {
/**
* \brief Block format version
*
* To prevent API and ABI breakages if new features are needed in
* the Block field, a version number is used to indicate which
* fields in this structure are in use. For now, version must always
* be zero. With non-zero version, most Block related functions will
* return LZMA_OPTIONS_ERROR.
*
* Read by:
* - All functions that take pointer to lzma_block as argument,
* including lzma_block_header_decode().
*
* Written by:
* - lzma_block_header_decode()
*/
uint32_t version;
/**
* \brief Size of the Block Header field
*
* This is always a multiple of four.
*
* Read by:
* - lzma_block_header_encode()
* - lzma_block_header_decode()
* - lzma_block_compressed_size()
* - lzma_block_unpadded_size()
* - lzma_block_total_size()
* - lzma_block_decoder()
* - lzma_block_buffer_decode()
*
* Written by:
* - lzma_block_header_size()
* - lzma_block_buffer_encode()
*/
uint32_t header_size;
# define LZMA_BLOCK_HEADER_SIZE_MIN 8
# define LZMA_BLOCK_HEADER_SIZE_MAX 1024
/**
* \brief Type of integrity Check
*
* The type of the integrity Check is not stored into the Block
* Header, thus its value must be provided also when decoding.
* The Check ID is not stored into the Block Header, thus its value
* must be provided also when decoding.
*
* Read by:
* - lzma_block_header_encode()
* - lzma_block_header_decode()
* - lzma_block_compressed_size()
* - lzma_block_unpadded_size()
* - lzma_block_total_size()
* - lzma_block_encoder()
* - lzma_block_decoder()
* - lzma_block_buffer_encode()
* - lzma_block_buffer_decode()
*/
lzma_check_type check;
/**
* \brief Precense of CRC32 of the Block Header
*
* Set this to true if CRC32 of the Block Header should be
* calculated and stored in the Block Header.
*
* There is no way to autodetect if CRC32 is present in the Block
* Header, thus this information must be provided also when decoding.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder()
* - lzma_block_header_decoder()
*/
lzma_bool has_crc32;
/**
* \brief Usage of End of Payload Marker
*
* If this is true, End of Payload Marker is used even if
* Uncompressed Size is known.
*
* Read by:
* - lzma_block_header_encoder()
* - lzma_block_encoder()
* - lzma_block_decoder()
*
* Written by:
* - lzma_block_header_decoder()
*/
lzma_bool has_eopm;
/**
* \brief True if the Block is a Metadata Block
*
* If this is true, the Metadata bit will be set in the Block Header.
* It is up to the application to store correctly formatted data
* into Metadata Block.
*
* Read by:
* - lzma_block_header_encoder()
*
* Written by:
* - lzma_block_header_decoder()
*/
lzma_bool is_metadata;
/**
* \brief True if Uncompressed Size is in Block Footer
*
* Read by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*/
lzma_bool has_uncompressed_size_in_footer;
/**
* \brief True if Backward Size is in Block Footer
*
* Read by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*/
lzma_bool has_backward_size;
/**
* \brief True if Block coder should take care of Padding
*
* In liblzma, Stream decoder sets this to true when decoding
* Header Metadata Block or Data Blocks from Multi-Block Stream,
* and to false when decoding Single-Block Stream or Footer
* Metadata Block from a Multi-Block Stream.
*
* Read by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*/
lzma_bool handle_padding;
lzma_check check;
/**
* \brief Size of the Compressed Data in bytes
*
* Usually you don't know this value when encoding in streamed mode.
* In non-streamed mode you can reserve space for this field when
* encoding the Block Header the first time, and then re-encode the
* Block Header and copy it over the original one after the encoding
* of the Block has been finished.
* Encoding: If this is not LZMA_VLI_UNKNOWN, Block Header encoder
* will store this value to the Block Header. Block encoder doesn't
* care about this value, but will set it once the encoding has been
* finished.
*
* Decoding: If this is not LZMA_VLI_UNKNOWN, Block decoder will
* verify that the size of the Compressed Data field matches
* compressed_size.
*
* Usually you don't know this value when encoding in streamed mode,
* and thus cannot write this field into the Block Header.
*
* In non-streamed mode you can reserve space for this field before
* encoding the actual Block. After encoding the data, finish the
* Block by encoding the Block Header. Steps in detail:
*
* - Set compressed_size to some big enough value. If you don't know
* better, use LZMA_VLI_MAX, but remember that bigger values take
* more space in Block Header.
*
* - Call lzma_block_header_size() to see how much space you need to
* reserve for the Block Header.
*
* - Encode the Block using lzma_block_encoder() and lzma_code().
* It sets compressed_size to the correct value.
*
* - Use lzma_block_header_encode() to encode the Block Header.
* Because space was reserved in the first step, you don't need
* to call lzma_block_header_size() anymore, because due to
* reserving, header_size has to be big enough. If it is "too big",
* lzma_block_header_encode() will add enough Header Padding to
* make Block Header to match the size specified by header_size.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder()
* - lzma_block_encoder()
* - lzma_block_header_encode()
* - lzma_block_compressed_size()
* - lzma_block_unpadded_size()
* - lzma_block_total_size()
* - lzma_block_decoder()
* - lzma_block_buffer_decode()
*
* Written by:
* - lzma_block_header_decoder()
* - lzma_block_header_decode()
* - lzma_block_compressed_size()
* - lzma_block_encoder()
* - lzma_block_decoder()
* - lzma_block_buffer_encode()
* - lzma_block_buffer_decode()
*/
lzma_vli compressed_size;
/**
* \brief Uncompressed Size in bytes
*
* Encoder: If this value is not LZMA_VLI_VALUE_UNKNOWN, it is stored
* to the Uncompressed Size field in the Block Header. The real
* uncompressed size of the data being compressed must match
* the Uncompressed Size or LZMA_HEADER_ERROR is returned.
* This is handled very similarly to compressed_size above.
*
* If Uncompressed Size is unknown, End of Payload Marker must
* be used. If uncompressed_size == LZMA_VLI_VALUE_UNKNOWN and
* has_eopm == 0, LZMA_HEADER_ERROR will be returned.
*
* Decoder: If this value is not LZMA_VLI_VALUE_UNKNOWN, it is
* compared to the real Uncompressed Size. If they do not match,
* LZMA_HEADER_ERROR is returned.
* uncompressed_size is needed by fewer functions than
* compressed_size. This is because uncompressed_size isn't
* needed to validate that Block stays within proper limits.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder()
* - lzma_block_encoder()
* - lzma_block_header_encode()
* - lzma_block_decoder()
* - lzma_block_buffer_decode()
*
* Written by:
* - lzma_block_header_decoder()
* - lzma_block_header_decode()
* - lzma_block_encoder()
* - lzma_block_decoder()
* - lzma_block_buffer_encode()
* - lzma_block_buffer_decode()
*/
lzma_vli uncompressed_size;
/**
* \brief Number of bytes to reserve for Compressed Size
*
* This is useful if you want to be able to store the Compressed Size
* to the Block Header, but you don't know it when starting to encode.
* Setting this to non-zero value at maximum of LZMA_VLI_BYTES_MAX,
* the Block Header encoder will force the Compressed Size field to
* occupy specified number of bytes. You can later rewrite the Block
* Header to contain correct information by using otherwise identical
* lzma_options_block structure except the correct compressed_size.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder()
*
* Written by:
* - lzma_block_header_decoder()
*/
uint32_t compressed_reserve;
/**
* \brief Number of bytes to reserve for Uncompressed Size
*
* See the description of compressed_size above.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder()
*
* Written by:
* - lzma_block_header_decoder()
*/
uint32_t uncompressed_reserve;
/**
* \brief Total Size of the Block in bytes
*
* This is useful in the decoder, which can verify the Total Size
* if it is known from Index.
*
* Read by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*
* Written by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*/
lzma_vli total_size;
/**
* \brief Upper limit of Total Size
*
* Read by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*/
lzma_vli total_limit;
/**
* \brief Upper limit of Uncompressed Size
*
* Read by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*/
lzma_vli uncompressed_limit;
/**
* \brief Array of filters
*
* There can be at maximum of seven filters. The end of the array
* is marked with .id = LZMA_VLI_VALUE_UNKNOWN. Minimum number of
* filters is zero; in that case, an implicit Copy filter is used.
* There can be 1-4 filters. The end of the array is marked with
* .id = LZMA_VLI_UNKNOWN.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder()
* - lzma_block_header_encode()
* - lzma_block_encoder()
* - lzma_block_decoder()
* - lzma_block_buffer_encode()
* - lzma_block_buffer_decode()
*
* Written by:
* - lzma_block_header_decoder(): Note that this does NOT free()
* the old filter options structures. If decoding fails, the
* caller must take care of freeing the options structures
* that may have been allocated and decoded before the error
* occurred.
* - lzma_block_header_decode(): Note that this does NOT free()
* the old filter options structures. All unused filters[] will
* have .id == LZMA_VLI_UNKNOWN and .options == NULL. If
* decoding fails, all filters[] are guaranteed to be
* LZMA_VLI_UNKNOWN and NULL.
*
* \note Because of the array is terminated with
* .id = LZMA_VLI_UNKNOWN, the actual array must
* have LZMA_FILTERS_MAX + 1 members or the Block
* Header decoder will overflow the buffer.
*/
lzma_options_filter filters[8];
lzma_filter *filters;
/**
* \brief Size of the Padding field
* \brief Raw value stored in the Check field
*
* The Padding field exist to allow aligning the Compressed Data field
* optimally in the Block. See lzma_options_stream.alignment in
* stream.h for more information.
* After successful coding, the first lzma_check_size(check) bytes
* of this array contain the raw value stored in the Check field.
*
* If you want the Block Header encoder to automatically calculate
* optimal size for the Padding field by looking at the information
* in filters[], set this to LZMA_BLOCK_HEADER_PADDING_AUTO. In that
* case, you must also set the aligmnet variable to tell the the
* encoder the aligmnet of the beginning of the Block Header.
* Note that CRC32 and CRC64 are stored in little endian byte order.
* Take it into account if you display the Check values to the user.
*
* The decoder never sets this to LZMA_BLOCK_HEADER_PADDING_AUTO.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder(): Note that this doesn't
* accept LZMA_BLOCK_HEADER_PADDING_AUTO.
*
* Written by (these never set padding to
* LZMA_BLOCK_HEADER_PADDING_AUTO):
* - lzma_block_header_size()
* - lzma_block_header_decoder()
*/
int32_t padding;
# define LZMA_BLOCK_HEADER_PADDING_AUTO (-1)
# define LZMA_BLOCK_HEADER_PADDING_MIN 0
# define LZMA_BLOCK_HEADER_PADDING_MAX 31
/**
* \brief Alignment of the beginning of the Block Header
*
* This variable is read only if padding has been set to
* LZMA_BLOCK_HEADER_PADDING_AUTO.
*
* Read by:
* - lzma_block_header_size()
* - lzma_block_header_encoder()
*/
uint32_t alignment;
/**
* \brief Size of the Block Header
*
* Read by:
* Written by:
* - lzma_block_encoder()
* - lzma_block_decoder()
*
* Written by:
* - lzma_block_header_size()
* - lzma_block_header_decoder()
* - lzma_block_buffer_encode()
* - lzma_block_buffer_decode()
*/
uint32_t header_size;
uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
} lzma_options_block;
/*
* Reserved space to allow possible future extensions without
* breaking the ABI. You should not touch these, because the names
* of these variables may change. These are and will never be used
* with the currently supported options, so it is safe to leave these
* uninitialized.
*/
void *reserved_ptr1;
void *reserved_ptr2;
void *reserved_ptr3;
uint32_t reserved_int1;
uint32_t reserved_int2;
lzma_vli reserved_int3;
lzma_vli reserved_int4;
lzma_vli reserved_int5;
lzma_vli reserved_int6;
lzma_vli reserved_int7;
lzma_vli reserved_int8;
lzma_reserved_enum reserved_enum1;
lzma_reserved_enum reserved_enum2;
lzma_reserved_enum reserved_enum3;
lzma_reserved_enum reserved_enum4;
lzma_bool reserved_bool1;
lzma_bool reserved_bool2;
lzma_bool reserved_bool3;
lzma_bool reserved_bool4;
lzma_bool reserved_bool5;
lzma_bool reserved_bool6;
lzma_bool reserved_bool7;
lzma_bool reserved_bool8;
} lzma_block;
/**
* \brief Calculates the size of Header Padding and Block Header
* \brief Decode the Block Header Size field
*
* To decode Block Header using lzma_block_header_decode(), the size of the
* Block Header has to be known and stored into lzma_block.header_size.
* The size can be calculated from the first byte of a Block using this macro.
* Note that if the first byte is 0x00, it indicates beginning of Index; use
* this macro only when the byte is not 0x00.
*
* There is no encoding macro, because Block Header encoder is enough for that.
*/
#define lzma_block_header_size_decode(b) (((uint32_t)(b) + 1) * 4)
/**
* \brief Calculate Block Header Size
*
* Calculate the minimum size needed for the Block Header field using the
* settings specified in the lzma_block structure. Note that it is OK to
* increase the calculated header_size value as long as it is a multiple of
* four and doesn't exceed LZMA_BLOCK_HEADER_SIZE_MAX. Increasing header_size
* just means that lzma_block_header_encode() will add Header Padding.
*
* \return - LZMA_OK: Size calculated successfully and stored to
* options->header_size.
* - LZMA_HEADER_ERROR: Unsupported filters or filter options.
* - LZMA_PROG_ERROR: Invalid options
* block->header_size.
* - LZMA_OPTIONS_ERROR: Unsupported version, filters or
* filter options.
* - LZMA_PROG_ERROR: Invalid values like compressed_size == 0.
*
* \note This doesn't check that all the options are valid i.e. this
* may return LZMA_OK even if lzma_block_header_encode() or
* lzma_block_encoder() would fail.
* lzma_block_encoder() would fail. If you want to validate the
* filter chain, consider using lzma_memlimit_encoder() which as
* a side-effect validates the filter chain.
*/
extern lzma_ret lzma_block_header_size(lzma_options_block *options);
extern LZMA_API(lzma_ret) lzma_block_header_size(lzma_block *block)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Encodes Block Header
* \brief Encode Block Header
*
* Encoding of the Block options is done with a single call instead of
* first initializing and then doing the actual work with lzma_code().
* The caller must have calculated the size of the Block Header already with
* lzma_block_header_size(). If a value larger than the one calculated by
* lzma_block_header_size() is used, the Block Header will be padded to the
* specified size.
*
* \param out Beginning of the output buffer. This must be
* at least options->header_size bytes.
* \param options Block options to be encoded.
* at least block->header_size bytes.
* \param block Block options to be encoded.
*
* \return - LZMA_OK: Encoding was successful. options->header_size
* \return - LZMA_OK: Encoding was successful. block->header_size
* bytes were written to output buffer.
* - LZMA_HEADER_ERROR: Invalid or unsupported options.
* - LZMA_PROG_ERROR
* - LZMA_OPTIONS_ERROR: Invalid or unsupported options.
* - LZMA_PROG_ERROR: Invalid arguments, for example
* block->header_size is invalid or block->filters is NULL.
*/
extern lzma_ret lzma_block_header_encode(
uint8_t *out, const lzma_options_block *options);
extern LZMA_API(lzma_ret) lzma_block_header_encode(
const lzma_block *block, uint8_t *out)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Initializes Block Header decoder
* \brief Decode Block Header
*
* Because the results of this decoder are placed into *options,
* strm->next_in, strm->avail_in, and strm->total_in are not used.
* block->version should be set to the highest value supported by the
* application; currently the only possible version is zero. This function
* will set version to the lowest value that still supports all the features
* required by the Block Header.
*
* The only valid `action' with lzma_code() is LZMA_RUN.
* The size of the Block Header must have already been decoded with
* lzma_block_header_size_decode() macro and stored to block->header_size.
*
* \return - LZMA_OK: Encoding was successful. options->header_size
* bytes were written to output buffer.
* - LZMA_HEADER_ERROR: Invalid or unsupported options.
* - LZMA_PROG_ERROR
* block->filters must have been allocated, but they don't need to be
* initialized (possible existing filter options are not freed).
*
* \param block Destination for Block options.
* \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() (and also free()
* if an error occurs).
* \param in Beginning of the input buffer. This must be
* at least block->header_size bytes.
*
* \return - LZMA_OK: Decoding was successful. block->header_size
* bytes were read from the input buffer.
* - LZMA_OPTIONS_ERROR: The Block Header specifies some
* unsupported options such as unsupported filters. This can
* happen also if block->version was set to a too low value
* compared to what would be required to properly represent
* the information stored in the Block Header.
* - LZMA_DATA_ERROR: Block Header is corrupt, for example,
* the CRC32 doesn't match.
* - LZMA_PROG_ERROR: Invalid arguments, for example
* block->header_size is invalid or block->filters is NULL.
*/
extern lzma_ret lzma_block_header_decoder(
lzma_stream *strm, lzma_options_block *options);
extern LZMA_API(lzma_ret) lzma_block_header_decode(lzma_block *block,
lzma_allocator *allocator, const uint8_t *in)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Initializes .lzma Block encoder
* \brief Validate and set Compressed Size according to Unpadded Size
*
* This function is required for multi-thread encoding. It may also be
* useful when implementing custom file formats.
* Block Header stores Compressed Size, but Index has Unpadded Size. If the
* application has already parsed the Index and is now decoding Blocks,
* it can calculate Compressed Size from Unpadded Size. This function does
* exactly that with error checking:
*
* - Compressed Size calculated from Unpadded Size must be positive integer,
* that is, Unpadded Size must be big enough that after Block Header and
* Check fields there's still at least one byte for Compressed Size.
*
* - If Compressed Size was present in Block Header, the new value
* calculated from Unpadded Size is compared against the value
* from Block Header.
*
* \note This function must be called _after_ decoding the Block Header
* field so that it can properly validate Compressed Size if it
* was present in Block Header.
*
* \return - LZMA_OK: block->compressed_size was set successfully.
* - LZMA_DATA_ERROR: unpadded_size is too small compared to
* block->header_size and lzma_check_size(block->check).
* - LZMA_PROG_ERROR: Some values are invalid. For example,
* block->header_size must be a multiple of four and
* between 8 and 1024 inclusive.
*/
extern LZMA_API(lzma_ret) lzma_block_compressed_size(
lzma_block *block, lzma_vli unpadded_size)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Calculate Unpadded Size
*
* The Index field stores Unpadded Size and Uncompressed Size. The latter
* can be taken directly from the lzma_block structure after coding a Block,
* but Unpadded Size needs to be calculated from Block Header Size,
* Compressed Size, and size of the Check field. This is where this function
* is needed.
*
* \return Unpadded Size on success, or zero on error.
*/
extern LZMA_API(lzma_vli) lzma_block_unpadded_size(const lzma_block *block)
lzma_nothrow lzma_attr_pure;
/**
* \brief Calculate the total encoded size of a Block
*
* This is equivalent to lzma_block_unpadded_size() except that the returned
* value includes the size of the Block Padding field.
*
* \return On success, total encoded size of the Block. On error,
* zero is returned.
*/
extern LZMA_API(lzma_vli) lzma_block_total_size(const lzma_block *block)
lzma_nothrow lzma_attr_pure;
/**
* \brief Initialize .xz Block encoder
*
* Valid actions for lzma_code() are LZMA_RUN, LZMA_SYNC_FLUSH (only if the
* filter chain supports it), and LZMA_FINISH.
*
* \return - LZMA_OK: All good, continue with lzma_code().
* - LZMA_MEM_ERROR
* - LZMA_HEADER_ERROR
* - LZMA_DATA_ERROR: Limits (total_limit and uncompressed_limit)
* have been reached already.
* - LZMA_UNSUPPORTED_CHECK: options->check specfies a Check
* - LZMA_OPTIONS_ERROR
* - LZMA_UNSUPPORTED_CHECK: block->check specifies a Check ID
* that is not supported by this buid of liblzma. Initializing
* the encoder failed.
* - LZMA_PROG_ERROR
*
* lzma_code() can return FIXME
*/
extern lzma_ret lzma_block_encoder(
lzma_stream *strm, lzma_options_block *options);
extern LZMA_API(lzma_ret) lzma_block_encoder(
lzma_stream *strm, lzma_block *block)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Initializes decoder for .lzma Block
* \brief Initialize .xz Block decoder
*
* Valid actions for lzma_code() are LZMA_RUN and LZMA_FINISH. Using
* LZMA_FINISH is not required. It is supported only for convenience.
*
* \return - LZMA_OK: All good, continue with lzma_code().
* - LZMA_UNSUPPORTED_CHECK: Initialization was successful, but
* the given Check type is not supported, thus Check will be
* the given Check ID is not supported, thus Check will be
* ignored.
* - LZMA_PROG_ERROR
* - LZMA_MEM_ERROR
*/
extern lzma_ret lzma_block_decoder(
lzma_stream *strm, lzma_options_block *options);
extern LZMA_API(lzma_ret) lzma_block_decoder(
lzma_stream *strm, lzma_block *block)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Calculate maximum output size for single-call Block encoding
*
* This is equivalent to lzma_stream_buffer_bound() but for .xz Blocks.
* See the documentation of lzma_stream_buffer_bound().
*/
extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size)
lzma_nothrow;
/**
* \brief Single-call .xz Block encoder
*
* In contrast to the multi-call encoder initialized with
* lzma_block_encoder(), this function encodes also the Block Header. This
* is required to make it possible to write appropriate Block Header also
* in case the data isn't compressible, and different filter chain has to be
* used to encode the data in uncompressed form using uncompressed chunks
* of the LZMA2 filter.
*
* When the data isn't compressible, header_size, compressed_size, and
* uncompressed_size are set just like when the data was compressible, but
* it is possible that header_size is too small to hold the filter chain
* specified in block->filters, because that isn't necessarily the filter
* chain that was actually used to encode the data. lzma_block_unpadded_size()
* still works normally, because it doesn't read the filters array.
*
* \param block Block options: block->version, block->check,
* and block->filters must have been initialized.
* \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() and free().
* \param in Beginning of the input buffer
* \param in_size Size of the input buffer
* \param out Beginning of the output buffer
* \param out_pos The next byte will be written to out[*out_pos].
* *out_pos is updated only if encoding succeeds.
* \param out_size Size of the out buffer; the first byte into
* which no data is written to is out[out_size].
*
* \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space.
* - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_block_buffer_encode(
lzma_block *block, lzma_allocator *allocator,
const uint8_t *in, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Single-call .xz Block decoder
*
* This is single-call equivalent of lzma_block_decoder(), and requires that
* the caller has already decoded Block Header and checked its memory usage.
*
* \param block Block options just like with lzma_block_decoder().
* \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() and free().
* \param in Beginning of the input buffer
* \param in_pos The next byte will be read from in[*in_pos].
* *in_pos is updated only if decoding succeeds.
* \param in_size Size of the input buffer; the first byte that
* won't be read is in[in_size].
* \param out Beginning of the output buffer
* \param out_pos The next byte will be written to out[*out_pos].
* *out_pos is updated only if encoding succeeds.
* \param out_size Size of the out buffer; the first byte into
* which no data is written to is out[out_size].
*
* \return - LZMA_OK: Decoding was successful.
* - LZMA_OPTIONS_ERROR
* - LZMA_DATA_ERROR
* - LZMA_MEM_ERROR
* - LZMA_BUF_ERROR: Output buffer was too small.
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_block_buffer_decode(
lzma_block *block, lzma_allocator *allocator,
const uint8_t *in, size_t *in_pos, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size)
lzma_nothrow;

View File

@@ -1,19 +1,15 @@
/**
* \file lzma/check.h
* \brief Integrity checks
*/
/*
* Author: Lasse Collin
*
* \author Copyright (C) 1999-2006 Igor Pavlov
* \author Copyright (C) 2007 Lasse Collin
* This file has been put into the public domain.
* You can do whatever you want with this file.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* See ../lzma.h for information about liblzma as a whole.
*/
#ifndef LZMA_H_INTERNAL
@@ -22,11 +18,11 @@
/**
* \brief Type of the Check
* \brief Type of the integrity check (Check ID)
*
* The .lzma format supports multiple types of Checks that are calculated
* from the uncompressed data (unless it is empty; then it's calculated
* from Block Header).
* The .xz format supports multiple types of checks that are calculated
* from the uncompressed data. They vary in both speed and ability to
* detect errors.
*/
typedef enum {
LZMA_CHECK_NONE = 0,
@@ -43,86 +39,112 @@ typedef enum {
* Size of the Check field: 4 bytes
*/
LZMA_CHECK_CRC64 = 3,
LZMA_CHECK_CRC64 = 4,
/**<
* CRC64 using the polynomial from the ECMA-182 standard
*
* Size of the Check field: 8 bytes
*/
LZMA_CHECK_SHA256 = 5
LZMA_CHECK_SHA256 = 10
/**<
* SHA-256
*
* Size of the Check field: 32 bytes
*/
} lzma_check_type;
} lzma_check;
/**
* \brief Maximum valid Check ID
*
* The .lzma file format specification specifies eight Check IDs (0-7). Some
* of them are only reserved i.e. no actual Check algorithm has been assigned.
* Still liblzma accepts any of these eight IDs for future compatibility
* when decoding files. If a valid but unsupported Check ID is detected,
* liblzma indicates a warning with LZMA_UNSUPPORTED_CHECK.
*
* FIXME bad desc
* The .xz file format specification specifies 16 Check IDs (0-15). Some
* of them are only reserved, that is, no actual Check algorithm has been
* assigned. When decoding, liblzma still accepts unknown Check IDs for
* future compatibility. If a valid but unsupported Check ID is detected,
* liblzma can indicate a warning; see the flags LZMA_TELL_NO_CHECK,
* LZMA_TELL_UNSUPPORTED_CHECK, and LZMA_TELL_ANY_CHECK in container.h.
*/
#define LZMA_CHECK_ID_MAX 7
#define LZMA_CHECK_ID_MAX 15
/**
* \brief Check IDs supported by this liblzma build
* \brief Test if the given Check ID is supported
*
* If lzma_available_checks[n] is true, the Check ID n is supported by this
* liblzma build. You can assume that LZMA_CHECK_NONE and LZMA_CHECK_CRC32
* are always available.
* Return true if the given Check ID is supported by this liblzma build.
* Otherwise false is returned. It is safe to call this with a value that
* is not in the range [0, 15]; in that case the return value is always false.
*
* You can assume that LZMA_CHECK_NONE and LZMA_CHECK_CRC32 are always
* supported (even if liblzma is built with limited features).
*/
extern const lzma_bool lzma_available_checks[LZMA_CHECK_ID_MAX + 1];
extern LZMA_API(lzma_bool) lzma_check_is_supported(lzma_check check)
lzma_nothrow lzma_attr_const;
/**
* \brief Size of the Check field with different Check IDs
* \brief Get the size of the Check field with the given Check ID
*
* Although not all Check IDs have a check algorithm associated, the size of
* every Check is already frozen. This array contains the size (in bytes) of
* the Check field with specified Check ID. The values are taken from the
* section 2.2.2 of the .lzma file format specification:
* { 0, 4, 4, 8, 16, 32, 32, 64 }
* every Check is already frozen. This function returns the size (in bytes) of
* the Check field with the specified Check ID. The values are:
* { 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64 }
*
* If the argument is not in the range [0, 15], UINT32_MAX is returned.
*/
extern const uint32_t lzma_check_sizes[LZMA_CHECK_ID_MAX + 1];
extern LZMA_API(uint32_t) lzma_check_size(lzma_check check)
lzma_nothrow lzma_attr_const;
/**
* \brief Maximum size of a Check field
*/
#define LZMA_CHECK_SIZE_MAX 64
/**
* \brief Calculate CRC32
*
* Calculates CRC32 using the polynomial from the IEEE 802.3 standard.
* Calculate CRC32 using the polynomial from the IEEE 802.3 standard.
*
* \param buf Pointer to the input buffer
* \param size Size of the input buffer
* \param crc Previously returned CRC value. This is used to
* calculate the CRC of a big buffer in smaller chunks.
* Set to zero when there is no previous value.
* Set to zero when starting a new calculation.
*
* \return Updated CRC value, which can be passed to this function
* again to continue CRC calculation.
*/
extern uint32_t lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc);
extern LZMA_API(uint32_t) lzma_crc32(
const uint8_t *buf, size_t size, uint32_t crc)
lzma_nothrow lzma_attr_pure;
/**
* \brief Calculate CRC64
*
* Calculates CRC64 using the polynomial from the ECMA-182 standard.
* Calculate CRC64 using the polynomial from the ECMA-182 standard.
*
* This function is used similarly to lzma_crc32(). See its documentation.
*/
extern uint64_t lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc);
extern LZMA_API(uint64_t) lzma_crc64(
const uint8_t *buf, size_t size, uint64_t crc)
lzma_nothrow lzma_attr_pure;
/*
* SHA256 functions are currently not exported to public API.
* Contact the author if you think it should be.
* SHA-256 functions are currently not exported to public API.
* Contact Lasse Collin if you think it should be.
*/
/**
* \brief Get the type of the integrity check
*
* This function can be called only immediately after lzma_code() has
* returned LZMA_NO_CHECK, LZMA_UNSUPPORTED_CHECK, or LZMA_GET_CHECK.
* Calling this function in any other situation has undefined behavior.
*/
extern LZMA_API(lzma_check) lzma_get_check(const lzma_stream *strm)
lzma_nothrow;

View File

@@ -0,0 +1,412 @@
/**
* \file lzma/container.h
* \brief File formats
*/
/*
* Author: Lasse Collin
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
*
* See ../lzma.h for information about liblzma as a whole.
*/
#ifndef LZMA_H_INTERNAL
# error Never include this file directly. Use <lzma.h> instead.
#endif
/************
* Encoding *
************/
/**
* \brief Default compression preset
*
* It's not straightforward to recommend a default preset, because in some
* cases keeping the resource usage relatively low is more important that
* getting the maximum compression ratio.
*/
#define LZMA_PRESET_DEFAULT UINT32_C(6)
/**
* \brief Mask for preset level
*
* This is useful only if you need to extract the level from the preset
* variable. That should be rare.
*/
#define LZMA_PRESET_LEVEL_MASK UINT32_C(0x1F)
/*
* Preset flags
*
* Currently only one flag is defined.
*/
/**
* \brief Extreme compression preset
*
* This flag modifies the preset to make the encoding significantly slower
* while improving the compression ratio only marginally. This is useful
* when you don't mind wasting time to get as small result as possible.
*
* This flag doesn't affect the memory usage requirements of the decoder (at
* least not significantly). The memory usage of the encoder may be increased
* a little but only at the lowest preset levels (0-3).
*/
#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31)
/**
* \brief Calculate approximate memory usage of easy encoder
*
* This function is a wrapper for lzma_raw_encoder_memusage().
*
* \param preset Compression preset (level and possible flags)
*/
extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset)
lzma_nothrow lzma_attr_pure;
/**
* \brief Calculate approximate decoder memory usage of a preset
*
* This function is a wrapper for lzma_raw_decoder_memusage().
*
* \param preset Compression preset (level and possible flags)
*/
extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
lzma_nothrow lzma_attr_pure;
/**
* \brief Initialize .xz Stream encoder using a preset number
*
* This function is intended for those who just want to use the basic features
* if liblzma (that is, most developers out there).
*
* \param strm Pointer to lzma_stream that is at least initialized
* with LZMA_STREAM_INIT.
* \param preset Compression preset to use. A preset consist of level
* number and zero or more flags. Usually flags aren't
* used, so preset is simply a number [0, 9] which match
* the options -0 ... -9 of the xz command line tool.
* Additional flags can be be set using bitwise-or with
* the preset level number, e.g. 6 | LZMA_PRESET_EXTREME.
* \param check Integrity check type to use. See check.h for available
* checks. The xz command line tool defaults to
* LZMA_CHECK_CRC64, which is a good choice if you are
* unsure. LZMA_CHECK_CRC32 is good too as long as the
* uncompressed file is not many gigabytes.
*
* \return - LZMA_OK: Initialization succeeded. Use lzma_code() to
* encode your data.
* - LZMA_MEM_ERROR: Memory allocation failed.
* - LZMA_OPTIONS_ERROR: The given compression preset is not
* supported by this build of liblzma.
* - LZMA_UNSUPPORTED_CHECK: The given check type is not
* supported by this liblzma build.
* - LZMA_PROG_ERROR: One or more of the parameters have values
* that will never be valid. For example, strm == NULL.
*
* If initialization fails (return value is not LZMA_OK), all the memory
* allocated for *strm by liblzma is always freed. Thus, there is no need
* to call lzma_end() after failed initialization.
*
* If initialization succeeds, use lzma_code() to do the actual encoding.
* Valid values for `action' (the second argument of lzma_code()) are
* LZMA_RUN, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, and LZMA_FINISH. In future,
* there may be compression levels or flags that don't support LZMA_SYNC_FLUSH.
*/
extern LZMA_API(lzma_ret) lzma_easy_encoder(
lzma_stream *strm, uint32_t preset, lzma_check check)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Single-call .xz Stream encoding using a preset number
*
* The maximum required output buffer size can be calculated with
* lzma_stream_buffer_bound().
*
* \param preset Compression preset to use. See the description
* in lzma_easy_encoder().
* \param check Type of the integrity check to calculate from
* uncompressed data.
* \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() and free().
* \param in Beginning of the input buffer
* \param in_size Size of the input buffer
* \param out Beginning of the output buffer
* \param out_pos The next byte will be written to out[*out_pos].
* *out_pos is updated only if encoding succeeds.
* \param out_size Size of the out buffer; the first byte into
* which no data is written to is out[out_size].
*
* \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space.
* - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_easy_buffer_encode(
uint32_t preset, lzma_check check,
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
/**
* \brief Initialize .xz Stream encoder using a custom filter chain
*
* \param strm Pointer to properly prepared lzma_stream
* \param filters Array of filters. This must be terminated with
* filters[n].id = LZMA_VLI_UNKNOWN. See filter.h for
* more information.
* \param check Type of the integrity check to calculate from
* uncompressed data.
*
* \return - LZMA_OK: Initialization was successful.
* - LZMA_MEM_ERROR
* - LZMA_OPTIONS_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm,
const lzma_filter *filters, lzma_check check)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Initialize .lzma encoder (legacy file format)
*
* The .lzma format is sometimes called the LZMA_Alone format, which is the
* reason for the name of this function. The .lzma format supports only the
* LZMA1 filter. There is no support for integrity checks like CRC32.
*
* Use this function if and only if you need to create files readable by
* legacy LZMA tools such as LZMA Utils 4.32.x. Moving to the .xz format
* is strongly recommended.
*
* The valid action values for lzma_code() are LZMA_RUN and LZMA_FINISH.
* No kind of flushing is supported, because the file format doesn't make
* it possible.
*
* \return - LZMA_OK
* - LZMA_MEM_ERROR
* - LZMA_OPTIONS_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_alone_encoder(
lzma_stream *strm, const lzma_options_lzma *options)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Calculate output buffer size for single-call Stream encoder
*
* When trying to compress uncompressible data, the encoded size will be
* slightly bigger than the input data. This function calculates how much
* output buffer space is required to be sure that lzma_stream_buffer_encode()
* doesn't return LZMA_BUF_ERROR.
*
* The calculated value is not exact, but it is guaranteed to be big enough.
* The actual maximum output space required may be slightly smaller (up to
* about 100 bytes). This should not be a problem in practice.
*
* If the calculated maximum size doesn't fit into size_t or would make the
* Stream grow past LZMA_VLI_MAX (which should never happen in practice),
* zero is returned to indicate the error.
*
* \note The limit calculated by this function applies only to
* single-call encoding. Multi-call encoding may (and probably
* will) have larger maximum expansion when encoding
* uncompressible data. Currently there is no function to
* calculate the maximum expansion of multi-call encoding.
*/
extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size)
lzma_nothrow;
/**
* \brief Single-call .xz Stream encoder
*
* \param filters Array of filters. This must be terminated with
* filters[n].id = LZMA_VLI_UNKNOWN. See filter.h
* for more information.
* \param check Type of the integrity check to calculate from
* uncompressed data.
* \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() and free().
* \param in Beginning of the input buffer
* \param in_size Size of the input buffer
* \param out Beginning of the output buffer
* \param out_pos The next byte will be written to out[*out_pos].
* *out_pos is updated only if encoding succeeds.
* \param out_size Size of the out buffer; the first byte into
* which no data is written to is out[out_size].
*
* \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space.
* - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_stream_buffer_encode(
lzma_filter *filters, lzma_check check,
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size)
lzma_nothrow lzma_attr_warn_unused_result;
/************
* Decoding *
************/
/**
* This flag makes lzma_code() return LZMA_NO_CHECK if the input stream
* being decoded has no integrity check. Note that when used with
* lzma_auto_decoder(), all .lzma files will trigger LZMA_NO_CHECK
* if LZMA_TELL_NO_CHECK is used.
*/
#define LZMA_TELL_NO_CHECK UINT32_C(0x01)
/**
* This flag makes lzma_code() return LZMA_UNSUPPORTED_CHECK if the input
* stream has an integrity check, but the type of the integrity check is not
* supported by this liblzma version or build. Such files can still be
* decoded, but the integrity check cannot be verified.
*/
#define LZMA_TELL_UNSUPPORTED_CHECK UINT32_C(0x02)
/**
* This flag makes lzma_code() return LZMA_GET_CHECK as soon as the type
* of the integrity check is known. The type can then be got with
* lzma_get_check().
*/
#define LZMA_TELL_ANY_CHECK UINT32_C(0x04)
/**
* This flag enables decoding of concatenated files with file formats that
* allow concatenating compressed files as is. From the formats currently
* supported by liblzma, only the .xz format allows concatenated files.
* Concatenated files are not allowed with the legacy .lzma format.
*
* This flag also affects the usage of the `action' argument for lzma_code().
* When LZMA_CONCATENATED is used, lzma_code() won't return LZMA_STREAM_END
* unless LZMA_FINISH is used as `action'. Thus, the application has to set
* LZMA_FINISH in the same way as it does when encoding.
*
* If LZMA_CONCATENATED is not used, the decoders still accept LZMA_FINISH
* as `action' for lzma_code(), but the usage of LZMA_FINISH isn't required.
*/
#define LZMA_CONCATENATED UINT32_C(0x08)
/**
* \brief Initialize .xz Stream decoder
*
* \param strm Pointer to properly prepared lzma_stream
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
* to effectively disable the limiter.
* \param flags Bitwise-or of zero or more of the decoder flags:
* LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK,
* LZMA_TELL_ANY_CHECK, LZMA_CONCATENATED
*
* \return - LZMA_OK: Initialization was successful.
* - LZMA_MEM_ERROR: Cannot allocate memory.
* - LZMA_OPTIONS_ERROR: Unsupported flags
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_stream_decoder(
lzma_stream *strm, uint64_t memlimit, uint32_t flags)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Decode .xz Streams and .lzma files with autodetection
*
* This decoder autodetects between the .xz and .lzma file formats, and
* calls lzma_stream_decoder() or lzma_alone_decoder() once the type
* of the input file has been detected.
*
* \param strm Pointer to properly prepared lzma_stream
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
* to effectively disable the limiter.
* \param flags Bitwise-or of flags, or zero for no flags.
*
* \return - LZMA_OK: Initialization was successful.
* - LZMA_MEM_ERROR: Cannot allocate memory.
* - LZMA_OPTIONS_ERROR: Unsupported flags
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_auto_decoder(
lzma_stream *strm, uint64_t memlimit, uint32_t flags)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Initialize .lzma decoder (legacy file format)
*
* Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
* There is no need to use LZMA_FINISH, but allowing it may simplify
* certain types of applications.
*
* \return - LZMA_OK
* - LZMA_MEM_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_alone_decoder(
lzma_stream *strm, uint64_t memlimit)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief Single-call .xz Stream decoder
*
* \param memlimit Pointer to how much memory the decoder is allowed
* to allocate. The value pointed by this pointer is
* modified if and only if LZMA_MEMLIMIT_ERROR is
* returned.
* \param flags Bitwise-or of zero or more of the decoder flags:
* LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK,
* LZMA_CONCATENATED. Note that LZMA_TELL_ANY_CHECK
* is not allowed and will return LZMA_PROG_ERROR.
* \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() and free().
* \param in Beginning of the input buffer
* \param in_pos The next byte will be read from in[*in_pos].
* *in_pos is updated only if decoding succeeds.
* \param in_size Size of the input buffer; the first byte that
* won't be read is in[in_size].
* \param out Beginning of the output buffer
* \param out_pos The next byte will be written to out[*out_pos].
* *out_pos is updated only if decoding succeeds.
* \param out_size Size of the out buffer; the first byte into
* which no data is written to is out[out_size].
*
* \return - LZMA_OK: Decoding was successful.
* - LZMA_FORMAT_ERROR
* - LZMA_OPTIONS_ERROR
* - LZMA_DATA_ERROR
* - LZMA_NO_CHECK: This can be returned only if using
* the LZMA_TELL_NO_CHECK flag.
* - LZMA_UNSUPPORTED_CHECK: This can be returned only if using
* the LZMA_TELL_UNSUPPORTED_CHECK flag.
* - LZMA_MEM_ERROR
* - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached.
* The minimum required memlimit value was stored to *memlimit.
* - LZMA_BUF_ERROR: Output buffer was too small.
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_stream_buffer_decode(
uint64_t *memlimit, uint32_t flags, lzma_allocator *allocator,
const uint8_t *in, size_t *in_pos, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size)
lzma_nothrow lzma_attr_warn_unused_result;

Some files were not shown because too many files have changed in this diff Show More