aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2012-07-17liblzma: Make the use of lzma_allocator const-correct.Lasse Collin71-219/+269
There is a tiny risk of causing breakage: If an application assigns lzma_stream.allocator to a non-const pointer, such code won't compile anymore. I don't know why anyone would do such a thing though, so in practice this shouldn't cause trouble. Thanks to Jan Kratochvil for the patch.
2012-07-05Build: Include validate_map.sh in the distribution.Lasse Collin1-1/+1
It's required by "make mydist". Fix also the location of EXTRA_DIST+= so that those files get distributed also if symbol versioning isn't enabled.
2012-07-04Bump the version number to 5.1.2alpha.larhzu/v5.1.2alphaLasse Collin2-2/+2
2012-06-28liblzma: Check that the first byte of range encoded data is 0x00.Lasse Collin2-5/+15
It is just to be more pedantic and thus perhaps catch broken files slightly earlier.
2012-05-28liblzma: Fix possibility of incorrect LZMA_BUF_ERROR.Lasse Collin1-1/+1
lzma_code() could incorrectly return LZMA_BUF_ERROR if all of the following was true: - The caller knows how many bytes of output to expect and only provides that much output space. - When the last output bytes are decoded, the caller-provided input buffer ends right before the LZMA2 end of payload marker. So LZMA2 won't provide more output anymore, but it won't know it yet and thus won't return LZMA_STREAM_END yet. - A BCJ filter is in use and it hasn't left any unfiltered bytes in the temp buffer. This can happen with any BCJ filter, but in practice it's more likely with filters other than the x86 BCJ. Another situation where the bug can be triggered happens if the uncompressed size is zero bytes and no output space is provided. In this case the decompression can fail even if the whole input file is given to lzma_code(). A similar bug was fixed in XZ Embedded on 2011-09-19.
2012-04-19liblzma: Remove outdated comments.Lasse Collin2-5/+1
2012-04-19liblzma: Fix Libs.private in liblzma.pc to include -lrt when needed.Lasse Collin1-1/+1
2011-10-23liblzma: Fix invalid free() in the threaded encoder.Lasse Collin1-0/+4
It was triggered if initialization failed e.g. due to running out of memory. Thanks to Arkadiusz Miskiewicz.
2011-10-23liblzma: Fix a deadlock in the threaded encoder.Lasse Collin1-1/+3
It was triggered when reinitializing the encoder, e.g. when encoding two files.
2011-06-16liblzma: Remove unneeded semicolon.Lasse Collin1-1/+1
2011-05-28liblzma: Use symbol versioning.Lasse Collin3-0/+179
Symbol versioning is enabled by default on GNU/Linux, other GNU-based systems, and FreeBSD. I'm not sure how stable this is, so it may need backward-incompatible changes before the next release. The idea is that alpha and beta symbols are considered unstable and require recompiling the applications that use those symbols. Once a symbol is stable, it may get extended with new features in ways that don't break compatibility with older ABI & API. The mydist target runs validate_map.sh which should catch some probable problems in liblzma.map. Otherwise I would forget to update the map file for new releases.
2011-05-27liblzma: Handle allocation failures correctly in lzma_index_init().Lasse Collin1-2/+5
Thanks to Jim Meyering.
2011-05-21liblzma: Try to use SHA-256 from the operating system.Lasse Collin2-8/+77
If the operating system libc or other base libraries provide SHA-256, use that instead of our own copy. Note that this doesn't use OpenSSL or libgcrypt or such libraries to avoid creating dependencies to other packages. This supports at least FreeBSD, NetBSD, OpenBSD, Solaris, MINIX, and Darwin. They all provide similar but not identical SHA-256 APIs; everyone is a little different. Thanks to Wim Lewis for the original patch, improvements, and testing.
2011-05-17Add underscores to attributes (__attribute((__foo__))).Lasse Collin16-23/+25
2011-04-12Bump the version number to 5.1.1alpha and liblzma soname to 5.0.99.larhzu/v5.1.1alphaLasse Collin2-2/+2
2011-04-12Put the unstable APIs behind #ifdef LZMA_UNSTABLE.Lasse Collin2-0/+6
This way people hopefully won't complain if these APIs change and break code that used an older API.
2011-04-12Remove doubled words from documentation and comments.Lasse Collin2-2/+2
Spot candidates by running these commands: git ls-files |xargs perl -0777 -n \ -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \ -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}' Thanks to Jim Meyering for the original patch.
2011-04-11liblzma: Add lzma_stream_encoder_mt() for threaded compression.Lasse Collin7-1/+1538
This is the simplest method to do threading, which splits the uncompressed data into blocks and compresses them independently from each other. There's room for improvement especially to reduce the memory usage, but nevertheless, this is a good start.
2011-04-11liblzma: Add the forgotten lzma_lzma2_block_size().Lasse Collin2-0/+12
This should have been in 5eefc0086d24a65e136352f8c1d19cefb0cbac7a.
2011-04-11liblzma: Document lzma_easy_(enc|dec)oder_memusage() better too.Lasse Collin1-0/+9
2011-04-11liblzma: Document lzma_raw_(enc|dec)oder_memusage() better.Lasse Collin1-2/+6
It didn't mention the return value that is used if an error occurs.
2011-04-11liblzma: Use memzero() to initialize supported_actions[].Lasse Collin1-4/+2
This is cleaner and makes it simpler to add new members to lzma_action enumeration.
2011-04-11liblzma: API comment about lzma_allocator with threaded coding.Lasse Collin1-5/+13
2011-04-11liblzma: Add an internal function lzma_mt_block_size().Lasse Collin2-26/+24
This is based lzma_chunk_size() that was included in some development version of liblzma.
2011-04-11liblzma: Don't create an empty Block in lzma_stream_buffer_encode().Lasse Collin1-7/+13
Empty Block was created if the input buffer was empty. Empty Block wastes a few bytes of space, but more importantly it triggers a bug in XZ Utils 5.0.1 and older when trying to decompress such a file. 5.0.1 and older consider such files to be corrupt. I thought that no encoder creates empty Blocks when releasing 5.0.2 but I was wrong.
2011-04-11liblzma: Fix API docs to mention LZMA_UNSUPPORTED_CHECK.Lasse Collin2-0/+4
This return value was missing from the API comments of four functions.
2011-04-11liblzma: Validate encoder arguments better.Lasse Collin3-6/+20
The biggest problem was that the integrity check type wasn't validated, and e.g. lzma_easy_buffer_encode() would create a corrupt .xz Stream if given an unsupported Check ID. Luckily applications don't usually try to use an unsupport Check ID, so this bug is unlikely to cause many real-world problems.
2011-04-11liblzma: Make lzma_stream_encoder_init() static (second try).Lasse Collin4-32/+6
It's an internal function and it's not needed by anything outside stream_encoder.c.
2011-04-11Revert "liblzma: Make lzma_stream_encoder_init() static."Lasse Collin3-4/+29
This reverts commit 352ac82db5d3f64585c07b39e4759388dec0e4d7. I don't know what I was thinking.
2011-04-10liblzma: Make lzma_stream_encoder_init() static.Lasse Collin3-29/+4
It's an internal function and it's not needed by anything outside stream_encoder.c.
2011-04-09liblzma: Add missing #ifdefs to filter_common.c.Lasse Collin1-3/+3
Passing --disable-decoders to configure broke a few encoders due to missing #ifdefs in filter_common.c. Thanks to Jason Gorski for the patch.
2011-04-05liblzma: Use TUKLIB_GNUC_REQ to check GCC version in sha256.c.Lasse Collin1-3/+3
2011-04-02liblzma: Fix a memory leak in stream_encoder.c.Lasse Collin1-1/+1
It leaks old filter options structures (hundred bytes or so) every time the lzma_stream is reinitialized. With the xz tool, this happens when compressing multiple files.
2011-03-31liblzma: Fix decoding of LZMA2 streams having no uncompressed data.Lasse Collin1-4/+4
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-01-18Add alloc_size and malloc attributes to a few functions.Lasse Collin1-1/+1
Thanks to Cristian Rodríguez for the original patch.
2010-11-15liblzma: Document the return value of lzma_lzma_preset().Lasse Collin1-0/+3
2010-10-26liblzma: Rename a few variables and constants.Lasse Collin8-186/+183
This has no semantic changes. I find the new names slightly more logical and they match the names that are already used in XZ Embedded. The name fastpos wasn't changed (not worth the hassle).
2010-10-25Bump version 5.1.0alpha.larhzu/v5.1.0alphaLasse Collin1-2/+2
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-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-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 Collin5-6/+7
lzma_chunk_size() was commented out because it is currently useless.
2010-10-02liblzma: Small fixes to comments in the API headers.Lasse Collin1-3/+7
2010-09-26Fix the preset -3e.Lasse Collin1-0/+1
depth=0 was missing.
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-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-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-01Fix a comment.Lasse Collin1-1/+1
2010-05-27Fix lzma_block_compressed_size().Lasse Collin1-3/+3
2010-05-27Remove unused chunk_size.c.Lasse Collin1-67/+0
Thanks to Jonathan Nieder for the reminder.
2010-05-26Rename MIN() and MAX() to my_min() and my_max().Lasse Collin12-21/+22
This should avoid some minor portability issues.
2010-05-26Remove the Subblock filter code for now.Lasse Collin15-2026/+0
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-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-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 Collin28-40/+40
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-01-27Use PACKAGE_URL instead of custom PACKAGE_HOMEPAGE.Lasse Collin1-1/+1
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-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-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-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-15Fix wrong indentation caused by incorrect settingsLasse Collin3-13/+13
in the text editor.
2009-11-15Add lzma_physmem().Lasse Collin6-2/+84
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-14Fix a design error in liblzma API.Lasse Collin19-117/+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-04Use a tuklib module for integer handling.Lasse Collin19-51/+29
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-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-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 Collin5-11/+11
Thanks to Christian Weisgerber for pointing out some of these.
2009-09-11Fix a couple of warnings.Lasse Collin4-10/+7
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-29Fix x86 assembler on GCC 3.Lasse Collin2-4/+10
Thanks to Karl Berry.
2009-08-27Bumped version to 4.999.9beta.Lasse Collin1-1/+1
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-16Fix data corruption in LZ/LZMA2 encoder.Lasse Collin1-1/+1
Thanks to Jonathan Stott for the bug report.
2009-07-18Added public domain notice into a few files.Lasse Collin2-0/+14
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-06Use sed instead of $(SED) so that we don't need toLasse Collin1-1/+1
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-05Use @PACKAGE_HOMEPAGE@ in liblzma.pc.in.Lasse Collin1-1/+1
2009-06-30Build system fixesLasse Collin18-359/+365
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-27Moved the Windows resource files outside the windows directoryLasse Collin1-0/+5
to prepare for building them with Autotools.
2009-06-27Hopefully improved portability of the assembler code inLasse Collin2-2/+14
Autotools based builds on Windows.
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 Collin8-25/+25
Fix the ordering of libgnu.a and LTLIBINTL on the linker command line and added missing LTLIBINTL to tests/Makefile.am.
2009-06-04Fix purporse -> purpose. Thanks to Andrew Dudman.Lasse Collin1-1/+1
Released .xz spec 1.0.2 due to this fix too.
2009-05-26Make the raw value of the Check field available to applicationsLasse Collin4-31/+42
via lzma_block structure. This changes ABI but not doesn't break API.
2009-05-02Use a GCC-specific #pragma instead of GCC-specificLasse Collin2-5/+5
-Wno-uninitialized to silence a bogus warning.
2009-04-28Fixed a crash in liblzma.Lasse Collin11-13/+13
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-15Fix uint32_t -> size_t in ARM and ARM-Thumb filters.Lasse Collin2-2/+2
On 64-bit system it would have gone into infinite loop if a single input buffer was over 4 GiB (unlikely).
2009-04-13Put the interesting parts of XZ Utils into the public domain.Lasse Collin143-1459/+617
Some minor documentation cleanups were made at the same time.
2009-04-10Fix off-by-one in LZ decoder.Lasse Collin1-1/+1
Fortunately, this bug had no security risk other than accepting some corrupt files as valid.
2009-02-18Added files missing from the previous commit.Lasse Collin2-1/+39
2009-02-17Added lzma_easy_buffer_encode(). Splitted easy.c into smallLasse Collin6-47/+175
pieces to avoid unneeded dependencies making statically linked applications bigger than needed.
2009-02-13Changed how the version number is specified in various places.Lasse Collin2-4/+68
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-13Improve support for DOS-like systems.Lasse Collin2-6/+6
Here DOS-like means DOS, Windows, and OS/2.
2009-02-09Let the user specify custom CFLAGS on the make commandLasse Collin1-1/+1
line. Previously custom CFLAGS worked only when they were passed to configure.
2009-02-08Add a separate internal function to initialize the CRC32Lasse Collin3-3/+12
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-07Support LZMA_API_STATIC in assembler files toLasse Collin2-0/+6
avoid __declspec(dllexport) equivalent.
2009-02-07Introduced LZMA_API_STATIC macro, which the applicationsLasse Collin2-8/+25
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-02Updated the x86 assembler code:Lasse Collin2-22/+144
- 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-02Modify LZMA_API macro so that it works on Windows withLasse Collin54-176/+177
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-01Fix a bug in lzma_block_buffer_decode(), although thisLasse Collin1-4/+4
function should be rewritten anyway.
2009-02-01Added initial version of raw buffer-to-buffer codingLasse Collin4-20/+221
functions, and cleaned up filter.h API header a little. May be very buggy, not tested yet.
2009-02-01Use __cdecl also for function pointers in liblzma API whenLasse Collin3-20/+20
on Windows.
2009-01-31Add LZMA_API to liblzma API headers. It's useful at leastLasse Collin13-86/+128
on Windows. sysdefs.h no longer #includes lzma.h, so lzma.h has to be #included separately where needed.
2009-01-31Fix two lines in lzma.h on which the # wasn't at theLasse Collin1-2/+2
beginning of the line.
2009-01-31Add support for using liblzma headers in MSVC, which has noLasse Collin1-24/+46
stdint.h or inttypes.h.
2009-01-31Fix # -> ## in a macro in lzma.h.Lasse Collin1-1/+1
2009-01-30Remove dangling crc64_init.c.Lasse Collin1-55/+0
2009-01-28Fix uninitialized variables in alone_decoder.c. This bug wasLasse Collin1-0/+2
triggered by the previous commit, since these variables were not used by anything before support for a preset dictionary.
2009-01-27Added initial support for preset dictionary for raw LZMA1Lasse Collin8-27/+77
and LZMA2. It is not supported by the .xz format or the xz command line tool yet.
2009-01-26Regenerate the CRC tables without trailing blanks.Lasse Collin4-2024/+2024
2009-01-26remove trailing blanks from all but .xz filesJim Meyering2-2/+2
2009-01-26Add lzma_block_buffer_decode().Lasse Collin3-0/+129
2009-01-26Add more sanity checks to lzma_stream_buffer_decode().Lasse Collin1-0/+7
2009-01-26Avoid hardcoded constant in easy.c.Lasse Collin1-1/+1
2009-01-26Tiny bit better sanity check in block_util.cLasse Collin1-1/+1
2009-01-25Fix a dumb bug in Block decoder, which made it returnLasse Collin1-3/+3
LZMA_DATA_ERROR with valid data. The bug was added in e114502b2bc371e4a45449832cb69be036360722.
2009-01-23Added lzma_stream_buffer_decode() and made minor cleanups.Lasse Collin4-2/+144
2009-01-22Fix a comment.Lasse Collin1-1/+1
2009-01-20Add some single-call buffer-to-buffer coding functions.Lasse Collin8-26/+744
2009-01-20Block encoder cleanupsLasse Collin2-21/+32
2009-01-20Use LZMA_PROG_ERROR in lzma_code() as documented in base.h.Lasse Collin1-16/+8
2009-01-19Fix handling of non-fatal errors in lzma_code().Lasse Collin1-1/+8
2009-01-19Move some LZMA2 constants to lzma2_encoder.h so that theyLasse Collin3-14/+16
can be used outside lzma2_encoder.c.
2009-01-19Remove dead code.Lasse Collin1-8/+0
2009-01-17Beta was supposed to be API stable but I had forgot to renameLasse Collin7-11/+11
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.
2008-12-31Bumped version to 4.999.8beta right after the releaseLasse Collin1-1/+1
of 4.999.7beta.
2008-12-31Prepare for 4.999.7beta release.Lasse Collin1-1/+1
2008-12-31Cleaned up some comments in the API headers.Lasse Collin3-14/+15
2008-12-31Renamed lzma_options_simple to lzma_options_bcj in the API.Lasse Collin6-18/+18
The internal implementation is still using the name "simple". It may need some cleanups, so I look at it later.
2008-12-31Updated src/liblzma/Makefile.am to use liblzma.pc.in, whichLasse Collin1-2/+2
should have been in the previous commit.
2008-12-31Remove lzma_init() and other init functions from liblzma API.Lasse Collin26-431/+287
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-27Revert a change made in 3b34851de1eaf358cf9268922fa0eeed8278d680Lasse Collin1-15/+8
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-27Bunch of liblzma tweaks, including some API changes.Lasse Collin23-262/+294
The API and ABI should now be very close to stable, although the code behind it isn't yet.
2008-12-18Updated Makefile.am that was missing from the previous commit.Lasse Collin1-1/+0
2008-12-17Remove the alignment functions for now. Maybe they willLasse Collin4-176/+0
be added back in some form later, but the current version wasn't modular, so it would need fixing anyway.
2008-12-15Fix a dumb bug in .lzma decoder which was introduced inLasse Collin1-15/+14
the previous commit. (Probably the previous commit has other bugs too, it wasn't tested.)
2008-12-15Bunch of liblzma API cleanups and fixes.Lasse Collin26-422/+857
2008-12-15The LZMA2 decoder fix introduced a bug to LZ decoder,Lasse Collin1-10/+23
which made LZ decoder return too early after dictionary reset. This fixes it.
2008-12-15Fix data corruption in LZMA2 decoder.Lasse Collin3-8/+32
2008-12-09Make the memusage functions of LZMA1 and LZMA2 encodersLasse Collin3-16/+35
to validate the filter options. Add missing validation to LZMA2 encoder when options are changed in the middle of encoding.
2008-12-01Validate the filter chain before checking filter-specificLasse Collin1-4/+10
memory usage.
2008-12-01Make the memusage functions of LZMA1 and LZMA2 decodersLasse Collin3-9/+17
to validate the filter options.
2008-12-01Added the changes for Delta filter that should have beenLasse Collin2-2/+2
part of 656ec87882ee74b192c4ea4a233a235eca7b04d4.
2008-12-01LZMA2 decoder cleanups. Make it require new LZMA propertiesLasse Collin1-54/+41
also in the first LZMA chunk after a dictionary reset in uncompressed chunk.
2008-12-01Added lzma_delta_coder_memusage() which also validatesLasse Collin8-39/+75
the options.
2008-11-25Remove the nowadays unneeded memory limitting malloc() wrapper.Lasse Collin5-498/+0
2008-11-23VLI encoder and decoder cleanups. Made encoder returnLasse Collin2-13/+33
LZMA_PROG_ERROR in single-call mode if there's no output space.
2008-11-19Oh well, big messy commit again. Some highlights:Lasse Collin20-358/+407
- 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-10-07Made the preset numbering more logical in liblzma API.Lasse Collin3-12/+13
2008-09-30Fixed Stream decoder to actually use the first_stream variable.Lasse Collin1-0/+5
2008-09-30Fixed uninitialized variable in Stream decoder.Lasse Collin1-0/+1
2008-09-27Fix conflicting Subblock helper filter's ID.Lasse Collin1-1/+1
2008-09-27Changed magic bytes to match the updated spec. FilenameLasse Collin2-3/+3
suffix wasn't changed yet.
2008-09-27Some API changes, bug fixes, cleanups etc.Lasse Collin30-301/+351
2008-09-17Miscellaneous LZ and LZMA encoder cleanupsLasse Collin5-117/+29
2008-09-13LZ decoder cleanupLasse Collin1-3/+2
2008-09-13Renamed constants:Lasse Collin45-189/+185
- LZMA_VLI_VALUE_MAX -> LZMA_VLI_MAX - LZMA_VLI_VALUE_UNKNOWN -> LZMA_VLI_UNKNOWN - LZMA_HEADER_ERRRO -> LZMA_OPTIONS_ERROR
2008-09-12Improved the Stream Flags handling API.Lasse Collin7-18/+123
2008-09-11Remove a check from Block encoder that should have alreadyLasse Collin1-5/+0
been removed in 2ba01bfa755e47ff6af84a978e3c8d63d7d2775e.
2008-09-11Remove bogus #includes.Lasse Collin4-36/+0
2008-09-10Bumped version to 4.999.6alpha.Lasse Collin1-1/+1
2008-09-10Check for LZMA_FILTER_RESERVED_START in filter_flags_encoder.c.larhzu/v4.999.5alphaLasse Collin1-3/+4
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-10Filter handling cleanupsLasse Collin6-151/+156
2008-09-10CommentsLasse Collin1-1/+5
2008-09-10Cleaned up Block encoder and moved the no longer sharedLasse Collin5-100/+66
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-07Changed Filter ID of LZMA to 0x20.Lasse Collin1-1/+1
2008-09-06CommentsLasse Collin5-39/+65
2008-09-06Some API cleanupsLasse Collin8-161/+279
2008-09-04Don't allow LZMA_SYNC_FLUSH with decoders anymore. There'sLasse Collin3-3/+2
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-02Auto decoder cleanupLasse Collin1-1/+1
2008-09-02Updated auto decoder to handle LZMA_CONCATENATED when decodingLasse Collin1-16/+71
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-02Stream decoder cleanupsLasse Collin1-25/+32
2008-09-02Some fixes to LZ encoder.Lasse Collin3-75/+94
2008-08-31Fix wrong pointer calculation in LZMA encoder.Lasse Collin1-1/+3
2008-08-28Sort of garbage collection commit. :-| Many things are stillLasse Collin140-6879/+8290
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-06-20Remove some redundant code from LZMA encoder.Lasse Collin1-14/+1
2008-06-19Add limit of lc + lp <= 4. Now we can allocate theLasse Collin6-91/+43
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-18CommentsLasse Collin1-5/+2
2008-06-18Update the code to mostly match the new simpler file formatLasse Collin92-6733/+3646
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-11Fix uninitialized variable in LZMA encoder. This wasLasse Collin1-0/+2
introduced in 369f72fd656f537a9a8e06f13e6d0d4c242be22f.
2008-06-01Fix a buffer overflow in the LZMA encoder. It was due to myLasse Collin8-620/+532
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-05-11Remove support for pre-C89 libc versions that lack memcpy,Lasse Collin1-1/+1
memmove, and memset.
2008-05-06Bunch of grammar fixes from meyering.Lasse Collin1-3/+3
2008-05-06Typo fixLasse Collin1-1/+1
2008-04-28Fixed wrong spelling "limitter" to "limiter". This affectsLasse Collin5-11/+11
liblzma's API.