aboutsummaryrefslogtreecommitdiff
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-10-23Bump version to 5.0.0 and liblzma version-info to 5:0:0.Lasse Collin2-5/+5
2010-10-23liblzma: Make lzma_code() check the reserved members in lzma_stream.Lasse Collin1-0/+14
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-23Windows: Use MinGW's stdio functions.Lasse Collin1-0/+5
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-23liblzma: Use 512 as INDEX_GROUP_SIZE.Lasse Collin1-1/+1
This lets compiler use shifting instead of 64-bit division.
2010-10-23liblzma: A few ABI tweaks to reserve space in structures.Lasse Collin3-7/+8
2010-10-21xz: Make sure that message_strm() can never return NULL.Lasse Collin1-2/+5
2010-10-21liblzma: Update the comments in the API headers.Lasse Collin14-107/+136
Adding support for LZMA_FINISH for Index encoding and decoding needed tiny additions to the relevant .c files too.
2010-10-19Clean up a few FIXMEs and TODOs.Lasse Collin6-7/+8
lzma_chunk_size() was commented out because it is currently useless.
2010-10-12xz: Avoid raise() also on OpenVMS.Lasse Collin1-1/+1
This is similar to DOS/DJGPP that killing the program with a signal will print a backtrace or a similar message.
2010-10-11xz: Avoid SA_RESTART for portability reasons.Lasse Collin3-23/+25
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-10xz: Use "%"PRIu32 instead of "%d" in a format string.Lasse Collin1-1/+1
2010-10-10lzmainfo: Use "%"PRIu32 instead of "%u" for uint32_t.Lasse Collin1-1/+1
2010-10-10lzmainfo: Use fileno(stdin) instead of STDIN_FILENO.Lasse Collin1-1/+1
2010-10-09lzmainfo: Use setmode() on DOS-like systems.Lasse Collin1-0/+9
2010-10-09OS/2 and DOS: Be less verbose on signals.Lasse Collin1-0/+7
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-09lzmainfo: Add Windows resource file.Lasse Collin2-0/+21
2010-10-09Add missing public domain notice to lzmadec_w32res.rc.Lasse Collin1-0/+7
2010-10-09Windows: Update common_w32res.rc.Lasse Collin1-6/+3
2010-10-08Use LZMA_VERSION_STRING instead of PACKAGE_VERSION.Lasse Collin1-1/+1
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-08Build: Add options to disable individual command line tools.Lasse Collin4-40/+55
2010-10-05Build: Remove the static/dynamic tricks.Lasse Collin3-9/+3
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-04A few more languages files to the xz man page.Lasse Collin1-21/+24
Thanks to Jonathan Nieder.
2010-10-02liblzma: Small fixes to comments in the API headers.Lasse Collin1-3/+7
2010-09-28Fix accomodate -> accommodate on the xz man page.Lasse Collin1-1/+1
2010-09-27Major man page updates.Lasse Collin7-641/+1435
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-26Fix the preset -3e.Lasse Collin1-0/+1
depth=0 was missing.
2010-09-15xz: Edit a translators comment.Lasse Collin1-1/+1
2010-09-10xz: Add a comment to translators about "literal context bits".Lasse Collin1-0/+4
2010-09-10xz: Multiple fixes.Lasse Collin10-187/+393
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-07xz: Add a note to translators.Lasse Collin1-0/+2
2010-09-07Fix use of N_() and ngettext().Lasse Collin2-4/+4
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-06xz: Improve a comment.Lasse Collin1-3/+4
2010-09-05xz: Update the comment about NetBSD in file_io.c.Lasse Collin1-4/+4
Thanks to Joerg Sonnenberger.
2010-09-05xz: Use an array instead of pointer for stdin_filename.Lasse Collin2-2/+2
Thanks Joerg Sonnenberger.
2010-09-05xz: Hopefully ease translating the messages in list.c.Lasse Collin1-10/+23
2010-09-04xz: Fix grammar.Lasse Collin1-2/+1
2010-09-04xz: Use lzma_lzma_preset() to initialize the options structure.Lasse Collin1-12/+2
2010-09-04Don't set lc=4 with --extreme.Lasse Collin1-1/+0
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-04xz: Minor improvements to --help and --long-help.Lasse Collin1-12/+12
2010-09-03xz: Make -vv show also decompressor memory usage.Lasse Collin1-0/+7
2010-09-03Tweak the compression presets -0 .. -5.Lasse Collin1-10/+19
"Extreme" mode might need some further tweaking still. Docs were not updated yet.
2010-09-03liblzma: Adjust default depth calculation for HC3 and HC4.Lasse Collin1-3/+4
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-03xz: Make --help two lines shorter.Lasse Collin1-2/+5
At least for now, the --help option doesn't list any options that take arguments, so "Mandatory arguments to..." can be omitted.
2010-09-02xz: Make setting a preset override a custom filter chain.Lasse Collin1-0/+9
This is more logical behavior than ignoring preset level options once a custom filter chain has been specified.
2010-09-02xz: Always warn if adjusting dictionary size due to memlimit.Lasse Collin1-19/+9
2010-08-07Disable the memory usage limiter by default.Lasse Collin10-448/+373
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-06Add missing const to a global constant in xz.Lasse Collin2-2/+2
2010-07-28Language fixes for man pages.Lasse Collin2-5/+5
Thanks to A. Costa and Jonathan Nieder.
2010-06-15Add --no-adjust.Lasse Collin5-9/+28
2010-06-11Clarify the description of the default memlimit in the man page.Lasse Collin1-2/+2
Thanks to Denis Excoffier.
2010-06-11Fix string to uint64_t conversion.Lasse Collin2-4/+19
Thanks to Denis Excoffier for the bug report.
2010-06-02Fix compiling with -Werror.Lasse Collin1-2/+2
2010-06-02Silence a bogus Valgrind warning.Lasse Collin1-1/+5
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-02Fix a Windows-specific FIXME in signal handling code.Lasse Collin3-13/+48
2010-06-02Adjust SA_RESTART workaround.Lasse Collin1-7/+7
I want to get a bug report if something else than DJGPP lacks SA_RESTART.
2010-06-01xz man page updates.Lasse Collin1-19/+366
- Concatenating .xz files and padding - List mode - Robot mode - A few examples (but many more are needed)
2010-06-01Major update to xz --list.Lasse Collin1-181/+471
2010-06-01Rename message_filters_get() to message_filters_to_str().Lasse Collin2-3/+3
2010-06-01Fix a comment.Lasse Collin1-1/+1
2010-05-27Fix lzma_block_compressed_size().Lasse Collin1-3/+3
2010-05-27Take Cygwin into account in some #if lines.Lasse Collin2-3/+3
This change is no-op, but good to have just in case for the future.
2010-05-27Remove references to the Subblock filter in xz and tests.Lasse Collin1-9/+0
Thanks to Jonathan Nieder.
2010-05-27Remove unused chunk_size.c.Lasse Collin1-67/+0
Thanks to Jonathan Nieder for the reminder.
2010-05-27Use my_min() instead of MIN() in src/xz/list.cJonathan Nieder1-1/+1
This should have been done in 920a69a8d8e4203c5edddd829d932130eac188ea.
2010-05-26Rename MIN() and MAX() to my_min() and my_max().Lasse Collin14-29/+29
This should avoid some minor portability issues.
2010-05-26Better #error message.Lasse Collin1-2/+2
2010-05-26Remove the Subblock filter code for now.Lasse Collin18-2102/+1
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-16Split message_filters().Lasse Collin3-69/+134
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-14Omit lzma_restrict from the API headers.Lasse Collin3-21/+7
It isn't really useful so omitting it makes things shorter and slightly more readable.
2010-05-10Updates to tuklib_physmem and tuklib_cpucores.Lasse Collin2-3/+44
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-04-12Show both elapsed time and estimated remaining time in xz -v.Lasse Collin1-48/+38
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-03-07Fix xzgrep to not break if filenames have spaces or quotes.Lasse Collin1-1/+1
Thanks to someone who reported the bug on IRC.
2010-03-07Treat all integer multiplier suffixes as base-2.Lasse Collin3-76/+67
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-07Consistently round up the memory usage limit in messages.Lasse Collin2-4/+8
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-07Increase the default memory usage limit on "low-memory" systems.Lasse Collin4-34/+80
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-06Fix missing initialization in lzma_strm_init().Lasse Collin1-0/+1
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 18c10c30d2833f394cd7bce0e6a821044b15832f 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-02-12Collection of language fixes to comments and docs.Lasse Collin41-70/+70
Thanks to Jonathan Nieder.
2010-02-12Fix jl -> jb in ASM files.Lasse Collin2-3/+3
2010-02-12Use __APPLE__ instead of __MACH__ in ASM files.Lasse Collin2-8/+8
This allows the files to work on HURD. Thanks to Jonathan Nieder.
2010-02-07Subtle change to liblzma Block handling API.Lasse Collin2-22/+20
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-02Fix wrong assertion.Lasse Collin1-2/+3
This was added in 455e68c030fde8a8c2f5e254c3b3ab9489bf3735.
2010-02-01Fix typos in comments.Lasse Collin1-1/+1
2010-02-01Fix signal handling for --list.Lasse Collin1-5/+14
2010-02-01Fix compression of symlinks with --force.Lasse Collin1-1/+13
xz --force accepted symlinks, but didn't remove them after successful compression. Instead, an error message was displayed.
2010-01-31Select the default integrity check type at runtime.Lasse Collin1-5/+14
Previously it was set statically to CRC64 or CRC32 depending on options passed to the configure script.
2010-01-31Improve displaying of the memory usage limit.Lasse Collin4-13/+45
2010-01-31Don't use uninitialized sigset_t.Lasse Collin1-10/+24
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-31Delay opening the destionation file and other fixes.Lasse Collin6-125/+157
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-29Add list.h to src/xz/Makefile.am.Lasse Collin1-0/+1
This should have been already in 0bc9eab243dee3be764b3530433a7fcdc3f7c6a1.
2010-01-27Silence two compiler warnings on DOS-like systems.Lasse Collin2-1/+8
2010-01-27Use PACKAGE_URL instead of custom PACKAGE_HOMEPAGE.Lasse Collin4-4/+4
2010-01-26Add a missing space to an error message.Lasse Collin1-1/+1
Thanks to Robert Readman.
2010-01-26Use past tense in error message in io_unlink().Lasse Collin1-2/+12
Added a note to translators too. Thanks to Robert Readman.
2010-01-26Fix too small static buffer in util.c.Lasse Collin1-5/+4
This was introduced in 0dd6d007669b946543ca939a44243833c79e08f4 two days ago.
2010-01-26Minor comment fix.Lasse Collin1-2/+2
2010-01-24Add initial version of xz --list.Lasse Collin5-359/+668
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-24Add io_pread().Lasse Collin2-0/+42
It will be used by --list.
2010-01-24Set LC_NUMERIC=C when --robot is used.Lasse Collin1-0/+4
It is to ensure that floating point numbers will always have a dot as the decimal separator.
2010-01-24Some improvements to printing sizes in xz.Lasse Collin5-90/+166
2010-01-15Update the xz man page to match the previous two commits.Lasse Collin1-6/+3
2010-01-13Don't read compressed data from a terminal or write itLasse Collin2-15/+13
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-13Don't compress or decompress special files unless writingLasse Collin1-5/+10
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-12Add IRIX-specific code to tuklib_physmem and tuklib_cpucores.Lasse Collin2-0/+25
This is untested but it will get tested soon and, if needed, fixed before 5.0.0. Thanks to Stuart Shelton.
2010-01-01Fix _memconfig() functions.Lasse Collin4-19/+20
This affects lzma_memusage() and lzma_memlimit_get().
2009-12-31Revised the Index handling code.Lasse Collin8-724/+1466
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-31Add missing lzma_nothrow in filter.h.Lasse Collin1-2/+2
2009-12-09Remove redefinition of _(msgid) macro from lzmainfo.c.Lasse Collin1-7/+0
2009-12-09Always rely on GCC's auto-import on Windows.Lasse Collin1-7/+9
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-07Fix file_io.c on DOS-like systems.Lasse Collin1-0/+4
The problem was introduced when adding sparse file support in 465d1b0d6518c5d980f2db4c2d769f9905bdd902. Thanks to Charles Wilson.
2009-12-07Add a note for translators to add a bug reporting addressLasse Collin1-0/+4
for translation bugs.
2009-12-07Prevent xgettext from taking one regular string as a C format string.Lasse Collin1-1/+1
Thanks to Marek Černocký.
2009-11-28Remove duplicate code in io_open_dest().Lasse Collin1-8/+1
Fix a missing _() in the error message too.
2009-11-26Typo fix to sysdefs.h.Lasse Collin1-1/+1
Thanks to Jonathan Nieder.
2009-11-25Add missing error check to coder.c.Lasse Collin1-9/+11
With bad luck this could cause a segfault due to reading (but not writing) past the end of the buffer.
2009-11-25Fix bugs in lzma_index_read() and lzma_index_cat().Lasse Collin1-11/+19
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-25Index decoder fixes.Lasse Collin2-17/+32
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-25Create sparse files by default when decompressing intoLasse Collin6-56/+272
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-22Add missing consts to pointer casts.Lasse Collin2-4/+5
2009-11-22Make fastpos.h use tuklib_integer.h instead of bsr.hLasse Collin3-65/+1
when --enable-small has been specified.
2009-11-22Update tuklib_integer.h with bit scan functions.Lasse Collin1-8/+181
Thanks to Joachim Henke for the original patch.
2009-11-16Add support for --info-memory and --robot to xz.Lasse Collin6-55/+133
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-15Fix wrong indentation caused by incorrect settingsLasse Collin3-13/+13
in the text editor.
2009-11-15Add lzma_physmem().Lasse Collin10-11/+88
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-14Some updates to xz man page.Lasse Collin1-5/+49
2009-11-14Fix description of --memory in --long-help.Lasse Collin1-2/+1
2009-11-14Fix a design error in liblzma API.Lasse Collin20-118/+273
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-10-17Fix wrong function name in the previous commit.Lasse Collin2-2/+2
It was meant to be lzma_filters_copy(), not lzma_filters_dup().
2009-10-17Add lzma_filters_copy().Lasse Collin2-0/+113
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-16Escape dashes in xzmore.1Jonathan Nieder1-2/+2
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-16Mention --check=none in --long-help. It was already inLasse Collin1-1/+1
the man page though. Thanks to Jim Meyering for noticing this.
2009-10-04Use a tuklib module for integer handling.Lasse Collin23-274/+386
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-02Add support for --enable-assume-ram=SIZE.Lasse Collin2-6/+6
2009-10-02Use unaligned access (if possible) on both endiannessesLasse Collin1-2/+2
in lz_encoder_hash.h.
2009-10-02Make liblzma produce the same output on both endiannesses.Lasse Collin6-14/+128
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-09-27Work around a bug in Interix header files.Lasse Collin1-0/+6
Thanks to Markus Duft for the patch.
2009-09-24Fix an error in OpenVMS-specific code.Lasse Collin1-1/+1
Thanks to Jouk Jansen.
2009-09-22Better fixes for OpenVMS support.Lasse Collin1-3/+16
Thanks to Jouk Jansen.
2009-09-22Avoid non-standard preprocessor construct.Lasse Collin1-4/+7
Thanks to Jouk Jansen.
2009-09-21Make sure that TUKLIB_DOSLIKE doesn't get defined on Cygwin.Lasse Collin1-1/+2
Thanks to Charles Wilson.
2009-09-19Various changes.Lasse Collin30-308/+548
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-15Fix incorrect use of "restrict".Lasse Collin3-4/+4
2009-09-12Fix GCC version check for nothrow attribute.Lasse Collin1-1/+1
2009-09-12A few grammar fixes.Lasse Collin7-23/+23
Thanks to Christian Weisgerber for pointing out some of these.
2009-09-11Use $(LN_EXEEXT) in symlinks to executables.Lasse Collin1-2/+2
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-11Fix a couple of warnings.Lasse Collin4-10/+7
2009-09-05Add OS/2-specific code to physmem.h.Lasse Collin1-11/+21
Also move DJGPP-specific code near the code meant for other DOS-like systems.
2009-09-05Use sysctl() != -1 instead of !sysctl() to check ifLasse Collin2-2/+2
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-01Refactored option parsing.Lasse Collin1-35/+35
2009-09-01Fix options parsing bug in xz.Lasse Collin1-4/+2
xz used to reject "xz --lzma2=pb=2," while "xz --lzma2=pb=2,," worked. Now both work.
2009-08-31Revert 43f44160b1ddcbf7e5205c37db09b3bebe7226f9Lasse Collin2-10/+4
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-29Use even more hackish way to support thousand separators.Lasse Collin1-11/+25
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-29Fix sysctl() usage.Lasse Collin2-2/+2
This fixes build on *BSDs and Darwin. Thanks to Jukka Salmi for the patches. Richard Koch reported the problem too.
2009-08-29Fix x86 assembler on GCC 3.Lasse Collin2-4/+10
Thanks to Karl Berry.
2009-08-27Update xz man page date.Lasse Collin1-1/+1
2009-08-27Bumped version to 4.999.9beta.Lasse Collin1-1/+1
2009-08-27Some xz man page improvements.Lasse Collin1-16/+62
2009-08-27Updates to liblzma API headers.Lasse Collin12-197/+275
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-17Some xz man changes.Lasse Collin1-45/+43
2009-08-16Fix data corruption in LZ/LZMA2 encoder.Lasse Collin1-1/+1
Thanks to Jonathan Stott for the bug report.
2009-08-13Link lzmainfo against shared liblzma by default.Lasse Collin1-2/+2
2009-08-13Fix xz Makefile.am for the man page.Lasse Collin1-0/+2
install-exec-hook -> install-data-hook
2009-08-13Add lzmainfo for backward compatibility with LZMA Utils.Lasse Collin4-1/+327
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-13Sync some error messages from xz to xzdec.Lasse Collin2-5/+5
Make xz error message translation usable outside xz (at least in upcoming lzmainfo).
2009-08-13Fix first line of xz man page.Lasse Collin1-1/+1
2009-08-10Added a rough version of the xz man page.Lasse Collin2-0/+1221
2009-08-09“xzdiff a.xz b.xz” always failsJonathan Nieder1-1/+1
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-09xzless: Support compressed standard inputJonathan Nieder1-1/+7
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-07-30xzdiff: add missing ;; to case statementJonathan Nieder1-3/+3
2009-07-23Fix incorrect usage of getopt_long(), which causedLasse Collin1-1/+0
invalid memory access if XZ_OPT was defined.
2009-07-20Avoid internal error with --format=xz --lzma1.Lasse Collin1-4/+12
2009-07-19Added missing author notice to xzless.in.Lasse Collin1-0/+1
2009-07-18Added public domain notice into a few files.Lasse Collin5-1/+36
2009-07-14Allow extra commas in filter-specific options on xz command line.Lasse Collin1-0/+7
This may slightly ease writing scripts that construct filter-specific option strings dynamically.
2009-07-14Accept --lzma2=preset=6e where "e" is equivalent to --extremeLasse Collin1-21/+59
when no custom chain is in use.
2009-07-10BCJ filters: Reject invalid start offsets with LZMA_OPTIONS_ERROR.Lasse Collin8-8/+12
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-10Look for full command names instead of substringsLasse Collin1-9/+13
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-08Remove --force from xzdec.Lasse Collin2-9/+1
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-06Use sed instead of $(SED) so that we don't need toLasse Collin4-21/+21
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-05Major update to the xzgrep and other scripts based onLasse Collin12-369/+689
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-05Use @PACKAGE_HOMEPAGE@ in liblzma.pc.in.Lasse Collin1-1/+1
2009-07-04Make "xz --decompress --stdout --force" copy unrecognizedLasse Collin1-35/+178
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-02Define PACKAGE_HOMEPAGE in configure.ac and use it inLasse Collin2-4/+4
xz and xzdec. Use also PACKAGE_NAME instead of hardcoding "XZ Utils".
2009-06-30Build system fixesLasse Collin20-361/+394
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-28Add -no-undefined to get shared liblzma on Windows.Lasse Collin1-1/+1
2009-06-27Make physmem() work on Cygwin 1.5 and older.Lasse Collin1-37/+40
2009-06-27Moved the Windows resource files outside the windows directoryLasse Collin5-0/+66
to prepare for building them with Autotools.
2009-06-27Added missing $(EXEEXT).Lasse Collin1-1/+1
2009-06-27Create correct symlinks even whenLasse Collin3-45/+65
--program-{prefix,suffix,transform} is passed to configure.
2009-06-27Silence a compiler warning on DOS-like systems.Lasse Collin1-1/+4
2009-06-27Hopefully improved portability of the assembler code inLasse Collin2-2/+14
Autotools based builds on Windows.
2009-06-26Updated comments to match renamed files.Lasse Collin4-4/+4
2009-06-26Rename process.[hc] to coder.[hc] and io.[hc] to file_io.[hc]Lasse Collin6-6/+6
to avoid problems on systems with system headers with those names.
2009-06-26Rename process_file() to coder_run().Lasse Collin3-9/+8
2009-06-26Ugly hack to make it possible to use the thousand separatorLasse Collin4-23/+78
format character with snprintf() on POSIX systems but not on non-POSIX systems and still keep xgettext working.
2009-06-26Basic support for building with Cygwin and MinGW usingLasse Collin4-9/+14
the Autotools based build system. It's not good yet, more fixes will follow.
2009-06-26Fix @variables@ to $(variables) in Makefile.am files.Lasse Collin10-44/+46
Fix the ordering of libgnu.a and LTLIBINTL on the linker command line and added missing LTLIBINTL to tests/Makefile.am.
2009-06-24Support HW_PHYSMEM64Lasse Collin1-11/+19
2009-06-24Cast a char argument to isspace() to unsigned char.Lasse Collin1-2/+9
2009-06-04Added xzdec man page.Lasse Collin2-0/+184
2009-06-04Harmonized xzdec --memory with xz --memory and madeLasse Collin1-21/+53
minor cleanups.