diff options
author | Martin Matuska <mm@FreeBSD.org> | 2010-05-07 18:59:06 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2010-05-07 18:59:06 +0000 |
commit | c19dc90688c2dacd857449ee2edceb09c3811e20 (patch) | |
tree | 930e9402a94c661612fa29e89b59d7b967d4d1aa | |
download | src-c19dc90688c2dacd857449ee2edceb09c3811e20.tar.gz src-c19dc90688c2dacd857449ee2edceb09c3811e20.zip |
Vendor import of xz (stripped)vendor/xz/20100412
Git revision: a290cfee3e23f046889c022aa96b4eca2016fdda
Approved by: delphij (mentor)
Notes
Notes:
svn path=/vendor/xz/dist/; revision=207753
svn path=/vendor/xz/20100412/; revision=207754; tag=vendor/xz/20100412
195 files changed, 42846 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000000..63a9815bc035 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,27 @@ + +Authors of XZ Utils +=================== + + XZ Utils is developed and maintained by Lasse Collin + <lasse.collin@tukaani.org>. + + 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. + + 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. + diff --git a/COPYING b/COPYING new file mode 100644 index 000000000000..43c90d0598c5 --- /dev/null +++ b/COPYING @@ -0,0 +1,65 @@ + +XZ Utils Licensing +================== + + Different licenses apply to different files in this package. Here + is a rough summary of which licenses apply to which parts of this + package (but check the individual files to be sure!): + + - 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 + + 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. + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000000..a3cb84ad49bd --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4716 @@ +commit a290cfee3e23f046889c022aa96b4eca2016fdda +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Apr 12 21:55:56 2010 +0300 + + 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. + +commit a1f7a986b8d708f9290da9799ca1b8d7082fad3e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Mar 31 16:47:25 2010 +0300 + + Add a simple tip to faq.txt about tar and xz. + + Thanks to Gilles Espinasse. + +commit c737eec91d200d730aa82662affd6b06ebb0bff0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Mar 22 21:03:03 2010 +0200 + + Updated THANKS. + +commit f4b2b52624b802c786e4e2a8eb6895794dd93b24 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 7 19:52:25 2010 +0200 + + Fix xzgrep to not break if filenames have spaces or quotes. + + Thanks to someone who reported the bug on IRC. + +commit cf38da00a140bd3bd65b192390ae5553380fd774 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 7 13:59:32 2010 +0200 + + 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. + +commit 00fc1211ae7b687ac912098f4479112059deccbd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 7 13:50:23 2010 +0200 + + 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. + +commit 9886d436ff5615fc70eef32ff757b1e934069621 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 7 13:34:34 2010 +0200 + + 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. + +commit 2672bcc9f85ba28ff648e092e9eb4cd9e69ce418 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 7 13:29:28 2010 +0200 + + 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. + +commit 5527b7269a997e7f335d60f237a64bbf225d9dc7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Mar 6 21:36:19 2010 +0200 + + Updated THANKS. + +commit d0d1c51aea4351288a7e533cce28cb7f852f6b05 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Mar 6 21:17:20 2010 +0200 + + 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 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. + +commit eb7d51a3faf9298c0c7aa9aaeae1023dcf9e37ea +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 12 13:16:15 2010 +0200 + + Collection of language fixes to comments and docs. + + Thanks to Jonathan Nieder. + +commit 4785f2021aa6a23f1caf724fcc823e562584f225 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 12 12:41:20 2010 +0200 + + Fix jl -> jb in ASM files. + +commit 6b50c9429bf85521d355adc61745d06ee017f8c8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 12 12:31:22 2010 +0200 + + Use __APPLE__ instead of __MACH__ in ASM files. + + This allows the files to work on HURD. + + Thanks to Jonathan Nieder. + +commit 6503fde658a5cdbdd907a788865470dd64771601 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 7 19:48:06 2010 +0200 + + 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. + +commit dd7c3841ff78cb94ce02b0220c6e4748460970f7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Feb 2 11:50:11 2010 +0200 + + Fix wrong assertion. + + This was added in 455e68c030fde8a8c2f5e254c3b3ab9489bf3735. + +commit 9d67588c1597849504a3e5ac8bf6f06e7d2ee8be +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 1 22:48:42 2010 +0200 + + Updated TODO. + +commit fef6333f52c8801308c3b78acb7942988541d137 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 1 22:47:54 2010 +0200 + + Fix typos in comments. + +commit 455e68c030fde8a8c2f5e254c3b3ab9489bf3735 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 1 22:46:56 2010 +0200 + + Fix signal handling for --list. + +commit 82220a149015616f75641ee8bbea415137535b9b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 1 11:44:45 2010 +0200 + + Fix compression of symlinks with --force. + + xz --force accepted symlinks, but didn't remove + them after successful compression. Instead, an error + message was displayed. + +commit d4da177d5ba3d2ef7323a6f1e06ca16e0478810e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 1 10:20:57 2010 +0200 + + Fix a comment. + +commit f9dd797a423a148903cf345b4146cb1fe1eab11d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 23:43:54 2010 +0200 + + Updated THANKS. + +commit ee5ddb8b28419fe4923ded5c18a50570a762dcab +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 23:41:29 2010 +0200 + + Updated TODO. + +commit 11936ad3f5a2e97bda3463c7a56a2f4bb9265ea6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 23:35:04 2010 +0200 + + Mention TODO in README. + +commit 2901a8e7e82af05675b8cd8758a8ceddb111359f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 23:31:14 2010 +0200 + + Updated INSTALL. + +commit 8884e16864ba53fb4b58623d7537d7ef30c28e11 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 23:28:51 2010 +0200 + + 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. + +commit 34eb5e201d62f7f46bbe6fe97cfe08cb31b3b88c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 19:52:38 2010 +0200 + + 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. + +commit 96a4f840e3b9ca5c81e5711ff9c267b194f93ef1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 18:17:50 2010 +0200 + + Improve displaying of the memory usage limit. + +commit b3cc4d8edd68a0250cc69680c99b9f7343f99cf2 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 12:53:56 2010 +0200 + + 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. + +commit 231c3c7098f1099a56abb8afece76fc9b8699f05 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 31 12:01:54 2010 +0200 + + 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. + +commit 0dbd0641db99d5e73d51d04ce7a71e52dc6b4105 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 29 22:48:04 2010 +0200 + + Add list.h to src/xz/Makefile.am. + + This should have been already in + 0bc9eab243dee3be764b3530433a7fcdc3f7c6a1. + +commit b4b1a56e0cbd597157858264f5c7189201ac9018 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 29 13:24:27 2010 +0200 + + Add lzmainfo.1 to manfiles list to convert to .txt and .pdf. + +commit 5574d64e03ad3a3d6e00e4b0d3e81c7b5529ec95 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 27 16:42:11 2010 +0200 + + Silence two compiler warnings on DOS-like systems. + +commit b063cc34a30a4edf109343ff373b2b62b8ca72d3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 27 13:31:03 2010 +0200 + + Use PACKAGE_URL instead of custom PACKAGE_HOMEPAGE. + +commit 38b8035b5cb5f56457c5fa5a891d6900fcf5984f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 26 23:37:46 2010 +0200 + + Add a missing space to an error message. + + Thanks to Robert Readman. + +commit e5496f9628ff5979392a80421d0b63a4de8015b4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 26 22:53:37 2010 +0200 + + Use past tense in error message in io_unlink(). + + Added a note to translators too. + + Thanks to Robert Readman. + +commit d9a9800597ea540090e434132c3b511217df0a2b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 26 15:42:24 2010 +0200 + + Fix too small static buffer in util.c. + + This was introduced in + 0dd6d007669b946543ca939a44243833c79e08f4 two days ago. + +commit d0b4bbf5da068503c099cd456e294d7673548cc0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 26 14:46:43 2010 +0200 + + Minor comment fix. + +commit 0bc9eab243dee3be764b3530433a7fcdc3f7c6a1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 24 23:50:54 2010 +0200 + + 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. + +commit df254ce03be016e217b511e7acd5d493f9929ca5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 24 22:46:11 2010 +0200 + + Add io_pread(). + + It will be used by --list. + +commit ef68dd4a92976276304de2aedfbe34ae91a86abb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 24 22:45:14 2010 +0200 + + 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. + +commit 0dd6d007669b946543ca939a44243833c79e08f4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 24 16:57:40 2010 +0200 + + Some improvements to printing sizes in xz. + +commit 2a98fdffd68c66371279c211c29153c808ad5c1d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 20 22:02:35 2010 +0200 + + Fix a typo in README. + + Thanks to R. Bijker. + +commit 07a11dad44e041b01dcfc73e8d4e00731158c06d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 17 11:59:54 2010 +0200 + + 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). + +commit 37f31ead9d2b4e467df11450cf29ed7d7e3e25f3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 15 11:05:11 2010 +0200 + + Update the xz man page to match the previous two commits. + +commit 3ffd5d81a43210c8da56da5c5b3637d3f8bc63c7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 13 19:10:25 2010 +0200 + + 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. + +commit 23ac2c44c3ac76994825adb7f9a8f719f78b5ee4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 13 18:12:40 2010 +0200 + + 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. + +commit cee12aa852ec0902983dc1f153346ef750157fb9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 12 16:30:33 2010 +0200 + + Updated THANKS. + +commit 153c7740c54b3c90129dbd3d6153ac1303c4d605 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 12 16:18:14 2010 +0200 + + 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. + +commit 8ea8dc754a7a5bc2d60db1eac201839cabdab6a1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 1 00:29:10 2010 +0200 + + Fix _memconfig() functions. + + This affects lzma_memusage() and lzma_memlimit_get(). + +commit 1a7ec87c8ee61dfc2e496d2e1fb7ab0939804691 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Dec 31 22:45:53 2009 +0200 + + 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. + +commit f29997a846e673cb3b8cbd57de47ed313b3978bb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Dec 31 21:13:25 2009 +0200 + + Remove c-format tag in cs.po. + + It was fixed in the C code earlier. + +commit 097bad000363e0bf29f8274ad2d7ab59f7dbf644 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Dec 31 21:11:05 2009 +0200 + + Add missing lzma_nothrow in filter.h. + +commit b56cb1fc31fa2381f92eefc040df85667048d626 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 9 18:13:44 2009 +0200 + + Remove redefinition of _(msgid) macro from lzmainfo.c. + +commit 171b03febfe09d9fae6ac8be6aa4518bcaf427d2 +Author: Jonathan Nieder <jrnieder@gmail.com> +Date: Tue Dec 8 19:41:57 2009 -0600 + + 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> + +commit f7e44c6c11f630519072971b8b07a5729c096c36 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 9 00:38:55 2009 +0200 + + 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. + +commit 7b76a3e2336f25088957cba92b0dbd854d9caa3c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 7 21:46:53 2009 +0200 + + Fix file_io.c on DOS-like systems. + + The problem was introduced when adding sparse file + support in 465d1b0d6518c5d980f2db4c2d769f9905bdd902. + + Thanks to Charles Wilson. + +commit 0696f5d268362221380e039bad48a86e29067c6a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 7 20:54:21 2009 +0200 + + 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. + +commit 5e817a50d276f0a3607638c1c1d449d50b9aa4e5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 7 20:32:08 2009 +0200 + + Add a note for translators to add a bug reporting address + for translation bugs. + +commit 6db1c35be9e1e364cdacff6878910e1b7aac2a37 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 7 20:07:02 2009 +0200 + + Prevent xgettext from taking one regular string as a C format string. + + Thanks to Marek Černocký. + +commit e0c2776b6ffbd2b1900fde353aceac734edc93d7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 28 17:45:22 2009 +0200 + + Remove duplicate code in io_open_dest(). + + Fix a missing _() in the error message too. + +commit f057a33c6f7c5992389479f2d4feabf2900ba7ee +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Nov 26 10:11:23 2009 +0200 + + Typo fix to sysdefs.h. + + Thanks to Jonathan Nieder. + +commit 8767b41534eafdf5e742e12190646bf5740b0cdb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Nov 26 10:10:36 2009 +0200 + + Fix a memory leak in test_index.c. + + This was introduced in + bd13b04e202b6f495a68eb0766f97085b7c50a06. + + Thanks to Jim Meyering for noticing it. + +commit 919fbaff860acdaa4bcd216500a0b1c960a6db92 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Nov 25 14:22:19 2009 +0200 + + 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. + +commit bd13b04e202b6f495a68eb0766f97085b7c50a06 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Nov 25 13:04:10 2009 +0200 + + 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. + +commit 1f196909143b888e062bd9a0c4ba8c34d3019bfa +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Nov 25 12:52:56 2009 +0200 + + 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. + +commit 465d1b0d6518c5d980f2db4c2d769f9905bdd902 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Nov 25 11:19:20 2009 +0200 + + 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. + +commit 37de544414fc2dc5039471d1002ebd015eb3e627 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 22 12:43:06 2009 +0200 + + Updated THANKS. + +commit f1a28b96c900c658fe016852ff62f6c24d1f50fa +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 22 12:05:33 2009 +0200 + + Add missing consts to pointer casts. + +commit b9b5c54cd438b3ae47b44cc211b71f3bc53e35ef +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 22 12:00:30 2009 +0200 + + 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. + +commit 0733f4c9994db696420a405810d5f02c79ebc404 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 22 11:55:03 2009 +0200 + + Make fastpos.h use tuklib_integer.h instead of bsr.h + when --enable-small has been specified. + +commit 7ac3985d891dcc5773543f84cc5bce6c14841b12 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 22 11:52:30 2009 +0200 + + Update tuklib_integer.h with bit scan functions. + + Thanks to Joachim Henke for the original patch. + +commit c74c132f7f79a842c073c66575a4fdb985e4c2e3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Nov 20 12:51:19 2009 +0200 + + 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. + +commit d315ca4930ff96e1428c6021c96f209e1abdd83e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Nov 16 18:16:45 2009 +0200 + + 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. + +commit e330fb7e6b8162894280c8a3dc22fdc05cd2d85e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 15 12:54:45 2009 +0200 + + Fix wrong indentation caused by incorrect settings + in the text editor. + +commit 93e418562cf127a9171e87bcd4e9af8e1bfcdae4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 15 12:40:17 2009 +0200 + + 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. + +commit cf39faca59083d38422058c6c97aa757ea7797d0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 14 20:21:19 2009 +0200 + + Updated THANKS. + +commit 2ddcae247c284cc2f396b6cfdab57790c7588b5f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 14 20:20:03 2009 +0200 + + Some updates to xz man page. + +commit 19b2674f07f8b588dfaf6638396b4b42866d7e23 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 14 19:51:03 2009 +0200 + + Fix description of --memory in --long-help. + +commit 2291346f0cccf88e605d84b75c9c5aaaaddb5df8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 14 19:45:39 2009 +0200 + + Update the debug programs so that they compile again. + +commit 418d64a32e8144210f98a810738fed5a897e8367 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 14 18:59:19 2009 +0200 + + 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. + +commit f0bf7634b77263a4dd02b20c71861ab67995da68 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Oct 17 11:11:58 2009 +0300 + + Fix wrong function name in the previous commit. + + It was meant to be lzma_filters_copy(), not lzma_filters_dup(). + +commit 6d118a0b9def82e96afba7386ec8d7da0b59649f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Oct 17 01:47:07 2009 +0300 + + 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. + +commit 78e92c18470483e161388e679c1ee556adb3a691 +Author: Jonathan Nieder <jrnieder@gmail.com> +Date: Thu Oct 15 20:44:13 2009 -0500 + + 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. + +commit 7b7fe902d98da28e5769e2aa1e0c08c92384f7ee +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Oct 16 20:35:39 2009 +0300 + + Mention --check=none in --long-help. It was already in + the man page though. + + Thanks to Jim Meyering for noticing this. + +commit ebfb2c5e1f344e5c6e549b9dedaa49b0749a4a24 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Oct 4 22:57:12 2009 +0300 + + 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. + +commit 29fd321033276261b87da7be5223db33d879a4c7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Oct 2 14:35:56 2009 +0300 + + Add support for --enable-assume-ram=SIZE. + +commit 3782b3fee4812b0dd4ffdfa6563ed49f73060f25 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Oct 2 11:28:17 2009 +0300 + + Use unaligned access (if possible) on both endiannesses + in lz_encoder_hash.h. + +commit c5f68b5cc79085a87f950fea53843e27f328068e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Oct 2 11:03:26 2009 +0300 + + 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. ;-) + +commit 4a84d1adfda35e4fb4d41ecf0feb8223b100517a +Author: Mike Frysinger <vapier@gentoo.org> +Date: Sat Sep 26 12:51:50 2009 -0400 + + add lzmainfo to gitignore + + Signed-off-by: Mike Frysinger <vapier@gentoo.org> + +commit 188a1dcd0cc7867810ed3a55c598d0680922c63b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Sep 27 11:53:36 2009 +0300 + + Updated THANKS. + +commit db9119b9181b307e7ac5d2bae82444d04b902b59 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Sep 27 11:48:54 2009 +0300 + + Work around a bug in Interix header files. + + Thanks to Markus Duft for the patch. + +commit b3d105e69786a45963176fd2193abe75e05ba738 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 24 17:50:17 2009 +0300 + + Fix an error in OpenVMS-specific code. + + Thanks to Jouk Jansen. + +commit 5e000ff00d4d01e559397b49eb648ad3f159d496 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 22 18:59:56 2009 +0300 + + Added OpenVMS-specific information to INSTALL. + +commit 932b2e204463d70f3eee5b8a1ea5a23bf9d001a4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 22 14:03:02 2009 +0300 + + Better fixes for OpenVMS support. + + Thanks to Jouk Jansen. + +commit 4c3630ec4179fe9265407a35c4db1374ffc82372 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 22 13:40:19 2009 +0300 + + Avoid non-standard preprocessor construct. + + Thanks to Jouk Jansen. + +commit 0deb1bb60addd1306b525e0ac0ad2a84eb0390d9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Sep 21 19:50:09 2009 +0300 + + Make sure that TUKLIB_DOSLIKE doesn't get defined on Cygwin. + + Thanks to Charles Wilson. + +commit e599bba4216c0edb8cc8f40adad3a6dba88685f4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 19 09:47:30 2009 +0300 + + 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. + +commit 49cfc8d392cf535f8dd10233225b1fc726fec9ef +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 15 21:07:23 2009 +0300 + + Fix incorrect use of "restrict". + +commit 15ffd675ab7af84592eb1c23b0e9f4699aa0fd8c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 12 14:09:17 2009 +0300 + + Fix GCC version check for nothrow attribute. + +commit 6bfdd3a88a819f04c8f202e7d3c6f88a01c7d224 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 12 14:08:15 2009 +0300 + + Updated THANKS. + +commit 4ab7b16b9573bdfa32279e4adadff684d5cd58ac +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 12 14:07:36 2009 +0300 + + A few grammar fixes. + + Thanks to Christian Weisgerber for pointing out some of these. + +commit 8905a33daadcd2d6557c83c81c490b827d566c94 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Sep 11 17:08:15 2009 +0300 + + Updated THANKS. + +commit 68059334ff435300ab1ce2c616b0eee1b0d88dd9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Sep 11 17:06:32 2009 +0300 + + Add PACKAGE_HOMEPAGE to {windows,dos}/config.h to fix build errors. + +commit 221be761f467da76875247bc02d7a1716682075d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Sep 11 10:24:09 2009 +0300 + + 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. + +commit 18a4233a53d9b82abac7db7d7804684c5fea9c2c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Sep 11 09:25:09 2009 +0300 + + Fix a couple of warnings. + +commit 429910b2ba67611d8df60d1a9da9641bdb5f82b4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 5 18:39:21 2009 +0300 + + Add OS/2-specific code to physmem.h. + + Also move DJGPP-specific code near the code meant + for other DOS-like systems. + +commit 7aca7b3174bcbba4a4915682ff0cd405d63f5740 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 5 01:21:15 2009 +0300 + + Updated THANKS. + +commit 60ccb80c9c4a0d771acc5b7d9d6f32b17fed1071 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 5 01:20:29 2009 +0300 + + 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. + +commit 173368911cf09ab0b03fc4db8f3d4b81d86dce32 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 2 09:43:51 2009 +0300 + + Mention in INSTALL that --enable-small doesn't modify CFLAGS. + +commit 319a0fd7d7e9ebbb71ca6930abfc20777cb4aacc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 1 20:40:01 2009 +0300 + + Refactored option parsing. + +commit 25adaaa56e2e51a47a910a8d73452414619a2e53 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 1 20:23:30 2009 +0300 + + Fix options parsing bug in xz. + + xz used to reject "xz --lzma2=pb=2," while + "xz --lzma2=pb=2,," worked. Now both work. + +commit 5f6dddc6c911df02ba660564e78e6de80947c947 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 1 20:20:19 2009 +0300 + + Updated TODO. + +commit 655457b9ada5ec7db398c5392e41290f3f332ea8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Aug 31 21:59:25 2009 +0300 + + Revert 43f44160b1ddcbf7e5205c37db09b3bebe7226f9 + 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. + +commit 162189c3477953805a28f96d3a75cb9ab9417928 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 30 17:29:19 2009 +0300 + + Updated THANKS. + +commit 2331f5f97af3e5897e23da45d9df3d664099c7f8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 30 17:28:52 2009 +0300 + + Add more OS/2 specific info to INSTALL. + +commit 94c66b3297b3ad307eee93cf6b160e3c43997f11 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Aug 29 14:43:52 2009 +0300 + + 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. + +commit 3432e9c6aab851da1227b63dce645d7f190c04d8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Aug 29 13:42:56 2009 +0300 + + Updated THANKS. + +commit 27414daadf5727e8ab942374b5ec1c8990122878 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Aug 29 13:39:21 2009 +0300 + + Fix sysctl() usage. + + This fixes build on *BSDs and Darwin. + + Thanks to Jukka Salmi for the patches. + Richard Koch reported the problem too. + +commit 43f44160b1ddcbf7e5205c37db09b3bebe7226f9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Aug 29 13:35:23 2009 +0300 + + Fix x86 assembler on GCC 3. + + Thanks to Karl Berry. + +commit 682efdc1f9492fdd76c9ce82e7c00ca0768067e8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 18:36:59 2009 +0300 + + "make dist" fixes + +commit c8c184db1c95bf70f78256ec6237845a57f342af +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 17:08:33 2009 +0300 + + Update xz man page date. + +commit 9756fce565e98b8fa5fe6ead296d84e7601ec254 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 17:00:22 2009 +0300 + + Fix the debug directory. + + 6a2eb54092fc625d59921a607ff68cd1a90aa898 and + 71f18e8a066a01dda0c8e5508b135ef104e43e4c required + some changes that weren't applied in debug. + +commit 77007a7fb20187fcf3d1dd9839c79ace2d63f2ea +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 16:36:40 2009 +0300 + + Add missing files to EXTRA_DIST. + +commit 04dcbfdeb921e5f361a4487134e91e23fffbe09d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 16:21:22 2009 +0300 + + Bumped version to 4.999.9beta. + +commit fd7618611a22f42a6913bc8d518c9bbc9252d6b4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 16:17:47 2009 +0300 + + Updated THANKS. + +commit c29e76c0f910fca0a90a50b78d337f6c32623e9d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 16:12:52 2009 +0300 + + .xz file format specification 1.0.4 (probably). + + Thanks to Christian von Roques, Peter Lawler, + and Jim Meyering for the fixes. + +commit 696d7ee3953beaf4f0ed18e78917ccf300431966 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 15:43:54 2009 +0300 + + Require GNU libtool 2.2. + +commit 4c3558aa8305a8f8b6c43b8569eb539717ca9e8d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 15:34:45 2009 +0300 + + Add "dos" to EXTRA_DIST. + +commit 35b29e4424ced5a3ababf132283e519080c7b298 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 15:23:27 2009 +0300 + + Updated TODO. + +commit 23414377192c21f3f34c84cdfe0ef0fbd06a1dea +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 15:17:00 2009 +0300 + + Some xz man page improvements. + +commit 371b04e19fc9051dbaeec51ec0badec6a1f0699d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 10:41:01 2009 +0300 + + Removed doc/bugs.txt. + +commit d88c4072b36d3a76f839185799fb1d91037a1b81 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 10:40:25 2009 +0300 + + Updated README. + + It now includes bug reporting instructions/tips. + +commit 92e536d8b8d33a6b12d0802bcd7be4437046f13e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 10:21:18 2009 +0300 + + 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.) + +commit 3e2ba8b58585743e59251e69ad2783eb08357079 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 27 10:13:46 2009 +0300 + + 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. + +commit 8e8ebc17c535a1f8846718059b48417409c37050 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Aug 18 00:30:09 2009 +0300 + + Install faq.txt. + +commit b198e770a146e4a41f91a93f0b233713f2515848 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Aug 18 00:26:48 2009 +0300 + + Updated faq.txt. + + Some questions worth answering were removed, because I + currently don't have good up to date answers to them. + +commit fe111a25cd788d31b581996e4533910388a7f0a9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Aug 17 22:45:50 2009 +0300 + + Some xz man changes. + +commit 10242a21e9abda0c5c6a03501703cc40b8a699a5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 16 22:15:42 2009 +0300 + + Updated THANKS. + +commit 3ce1916c83041113b9cad9ead5c97a527cf8aa1d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 16 22:15:13 2009 +0300 + + Fix data corruption in LZ/LZMA2 encoder. + + Thanks to Jonathan Stott for the bug report. + +commit 66da129c8ec33dd66acc92f113f7c1ca740ca81a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 15:15:37 2009 +0300 + + Updated INSTALL and PACKAGERS to match the changes + made in --enable-dynamic. + +commit 8238c4b2402f952c4e492e5b778aa272e57b6705 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 15:03:46 2009 +0300 + + Link lzmainfo against shared liblzma by default. + +commit 71f18e8a066a01dda0c8e5508b135ef104e43e4c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 15:00:21 2009 +0300 + + 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. + +commit 5aa4678b2342dcfc1d2b31aa9fa4f39c539e4b61 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 12:56:47 2009 +0300 + + Fix xz Makefile.am for the man page. + + install-exec-hook -> install-data-hook + +commit e51b4e49e800bd84e6d589dca2964d3985e88139 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 12:55:45 2009 +0300 + + 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. + +commit a4165d0584376d948c213ec93c6065d24ff6a5e7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 12:42:36 2009 +0300 + + Sync some error messages from xz to xzdec. + + Make xz error message translation usable outside + xz (at least in upcoming lzmainfo). + +commit df636eb4e066b4e154ce8e66e82c87ba1db652a6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 09:37:21 2009 +0300 + + Add xz man page to manfiles in toplevel Makefile.am. + +commit 180bdf58ea5bb07941e0a99b304d9aa832198748 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 13 09:37:01 2009 +0300 + + Fix first line of xz man page. + +commit e1ce2291e759b50ebfcf7cbbcc04cd098f1705a4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Aug 10 11:22:31 2009 +0300 + + Added a rough version of the xz man page. + +commit e71903fc6101f1c039d702e335b08aad1e1b4100 +Author: Jonathan Nieder <jrnieder@gmail.com> +Date: Sun Aug 9 13:41:20 2009 -0500 + + “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.) + +commit 1d314b81aa5b0c4530638ffabd4e0edb52e5362c +Author: Jonathan Nieder <jrnieder@gmail.com> +Date: Sun Aug 9 13:22:12 2009 -0500 + + 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. + +commit a7f5d2fe4826ac68839d00059f05004fb81d5c69 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 9 20:57:46 2009 +0300 + + GPLv2+ not GPLv2 for Doxyfile.in is probably OK. + +commit b735cde20cc14857136ae65a0e5d336ed7ddc862 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 2 00:27:29 2009 +0300 + + 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. + +commit 0fd157cc008446adfc8f91394f5503868025a642 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 2 00:11:37 2009 +0300 + + Updated THANKS. + +commit b198da96ff9ac8c89b466b4d196c5f3fe1c7904f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 2 00:10:22 2009 +0300 + + Updated TODO. + +commit 669413bb2db954bbfde3c4542fddbbab53891eb4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jul 30 12:25:55 2009 +0300 + + Updated THANKS. + +commit dbbd8fb870ae789d96497911006c869d37148c15 +Author: Jonathan Nieder <jrnieder@gmail.com> +Date: Tue Jul 28 17:37:24 2009 -0500 + + xzdiff: add missing ;; to case statement + +commit adbad2d16cb5909f85d4a429011005613ea62ffe +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jul 24 13:15:06 2009 +0300 + + Added history.txt to doc_DATA. + +commit e0236f12569eb36f9b81ce7a1e52e0f73698ac27 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jul 24 12:00:40 2009 +0300 + + Updated .gitignore files. + +commit 2f34fb269265e3aba43a2a9c734020a45268826d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jul 24 11:34:02 2009 +0300 + + Minor improvements to COPYING. + +commit 0db1befcfbc120377df4b89923762f16d25f548a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jul 23 19:10:55 2009 +0300 + + Fix incorrect usage of getopt_long(), which caused + invalid memory access if XZ_OPT was defined. + +commit 8f8ec942d6d21ada2096eaf063411bc8bc7e2d48 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jul 20 15:43:32 2009 +0300 + + Avoid internal error with --format=xz --lzma1. + +commit 99f9e879a6a8bb54a65da99c12e0f390216c152a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jul 19 13:14:20 2009 +0300 + + 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. + +commit ef4cf1851de89022cba5674784f1a8f6343c15b0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jul 19 11:09:31 2009 +0300 + + Added missing author notice to xzless.in. + +commit 4c9c989d45b188667799a7a1d6c728ed43f7bf77 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jul 18 18:54:55 2009 +0300 + + 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. + +commit 366e436090a7a87215e9bf0e3ddcd55f05b50587 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jul 18 14:34:08 2009 +0300 + + Updated the totally outdated TODO file. + +commit 64e498c89d8b9966e8663f43bf64d47c26c55c62 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jul 18 11:26:39 2009 +0300 + + Added public domain notice into a few files. + +commit a35755c5de808df027675688855d1b621a4fb428 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jul 14 21:10:36 2009 +0300 + + Allow extra commas in filter-specific options on xz command line. + + This may slightly ease writing scripts that construct + filter-specific option strings dynamically. + +commit 98f3cac1ad31191c5160a7e48398bf85141e941c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jul 14 18:04:31 2009 +0300 + + Accept --lzma2=preset=6e where "e" is equivalent to --extreme + when no custom chain is in use. + +commit d873a09e956363e54bf58c577c8f7e487b6fb464 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jul 12 19:08:30 2009 +0300 + + 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. + +commit cd69a5a6c16c289f6f8e2823b03c72289472270f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jul 10 11:39:38 2009 +0300 + + 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. + +commit eed9953732b801f6c97317fb3160445a8754180b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jul 10 11:33:21 2009 +0300 + + 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. + +commit 6f62fa88f4ff7ba78565c314c0e6e71c498fa658 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jul 8 23:06:46 2009 +0300 + + Updated THANKS. + +commit 1754b7e03e2aa7e2e0196807fe8b0f3f5a637b0e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jul 8 23:05:29 2009 +0300 + + Portability improvement to version.sh. + +commit 3bdb53792c0e3e3febe9370e56eda5b08f89410f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jul 8 22:50:16 2009 +0300 + + 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. + +commit 5f16ef4abf220028a9ddbcb138217597a9455f62 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jul 6 10:36:04 2009 +0300 + + 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. + +commit 96e4b257e101d72072d43e144897d92920270669 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jul 5 22:25:17 2009 +0300 + + 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. + +commit 25cc7a6e8c2506a0d80084a4c1c67d33e7439100 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jul 5 19:26:53 2009 +0300 + + Use @PACKAGE_HOMEPAGE@ in liblzma.pc.in. + +commit 18c10c30d2833f394cd7bce0e6a821044b15832f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jul 4 00:40:44 2009 +0300 + + 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(). + +commit 0a289c01ac821ea9c4250aa906b0ae3cfa953633 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jul 2 14:30:38 2009 +0300 + + Define PACKAGE_HOMEPAGE in configure.ac and use it in + xz and xzdec. + + Use also PACKAGE_NAME instead of hardcoding "XZ Utils". + +commit 5cc99db5bae8633f85559e5cdaef4cd905a4ee9c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jul 1 12:21:24 2009 +0300 + + Avoid visibility related compiler warnings on Windows. + +commit 7653d1cf48080e63b189ed9d58dea0e82b6b1c5e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jun 30 17:14:39 2009 +0300 + + Use static liblzma by default also for tests. + +commit f42ee981668b545ab6d06c6072e262c29605273c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jun 30 17:09:57 2009 +0300 + + 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. + +commit 89dac1db6f168d7469cfbc4432651d4724c5c0de +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jun 29 22:19:51 2009 +0300 + + Added a comment about "autoconf -fi" to autogen.sh. + +commit 6e685aae4594bc0af1b5032e01bb37d0edaa3ebd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jun 28 10:04:24 2009 +0300 + + Add -no-undefined to get shared liblzma on Windows. + +commit 73f560ee5fa064992b76688d9472baf139432540 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jun 27 22:57:15 2009 +0300 + + Make physmem() work on Cygwin 1.5 and older. + +commit 7ff0004fbce24ae72eddfe392828ffd7d4639ed1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jun 27 17:28:01 2009 +0300 + + Moved the Windows resource files outside the windows directory + to prepare for building them with Autotools. + +commit 449c634674f35336a4815d398172e447659a135e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jun 27 13:05:03 2009 +0300 + + Added missing $(EXEEXT). + +commit 792db79f27ad9ab1fb977e23be65c7761f545752 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jun 27 12:32:40 2009 +0300 + + Create correct symlinks even when + --program-{prefix,suffix,transform} is passed to configure. + +commit 0adc72feb84f5b903f6ad9d3f759b1c326fafc6b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jun 27 10:02:24 2009 +0300 + + Silence a compiler warning on DOS-like systems. + +commit ad12edc95254ede3f0cb8dec8645e8789e984c4f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jun 27 09:35:15 2009 +0300 + + Updated the filenames in POTFILES.in too. + +commit b2b1f867532732fe9969131f8713bdd6b0731763 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jun 27 00:43:06 2009 +0300 + + Hopefully improved portability of the assembler code in + Autotools based builds on Windows. + +commit c393055947247627a09b6a6b8f20aa0c32f9be16 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 21:17:29 2009 +0300 + + Updated THANKS (most of today's commits are based on + Charles Wilson's patches). + +commit da0af22e4b4139b8a10710945f8b245b3a77c97d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 21:00:35 2009 +0300 + + Updated comments to match renamed files. + +commit 65014fd211dfbd4be48685998cb5a12aaa29c8d2 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 20:49:54 2009 +0300 + + Rename process.[hc] to coder.[hc] and io.[hc] to file_io.[hc] + to avoid problems on systems with system headers with those + names. + +commit 5e1257466dcb66f1d7a3f71814a5ad885cba43e8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 20:43:36 2009 +0300 + + Rename process_file() to coder_run(). + +commit cad62551c5fa9865dbe0841a0b3bc729c4fbe8fc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 20:36:45 2009 +0300 + + 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. + +commit fe378d47074b16c52b00fe184d119287c68ce2e7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 15:40:40 2009 +0300 + + Added missing source files to windows/Makefile. + +commit 390a6408563067613b29de895cb40e4d0386d62c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 15:37:53 2009 +0300 + + Basic support for building with Cygwin and MinGW using + the Autotools based build system. It's not good yet, more + fixes will follow. + +commit 1c9360b7d1197457aaad2f8888b99f1149861579 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 14:47:31 2009 +0300 + + 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. + +commit d45615c555e250209ebb55aa3649abe790f1eeac +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 14:20:02 2009 +0300 + + Allow to explicitly specify autotool versions in autogen.sh. + +commit eaf8367368a329afa48785380f9dca6b681f3397 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 26 14:18:32 2009 +0300 + + Add version.sh to EXTRA_DIST. + +commit b317b218e2d383dd27a700094c0de4510540ea18 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jun 24 20:14:10 2009 +0300 + + Support HW_PHYSMEM64 + +commit ae82dde5d9cc60c80cc89601b6c51cc1611d48e7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jun 24 13:01:59 2009 +0300 + + Cast a char argument to isspace() to unsigned char. + +commit 1735d31ea347210e914df038eeea4b2626e76e42 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 5 13:46:26 2009 +0300 + + A few more spelling fixes. Released the .xz spec 1.0.3. + +commit 8ed156ce894966103e895aa08f2a9fb912f6fad5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jun 4 23:42:12 2009 +0300 + + Added xzdec man page. + +commit f6df39afaa84f71439507178a49b2a5dda6e824c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jun 4 23:26:47 2009 +0300 + + Harmonized xzdec --memory with xz --memory and made + minor cleanups. + +commit 1774f27c61ce294a56712ca2f4785f90a62441bc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jun 4 22:59:55 2009 +0300 + + Fix purporse -> purpose. Thanks to Andrew Dudman. + Released .xz spec 1.0.2 due to this fix too. + +commit cb613455642f48fb51059e22018615f64c59b70f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jun 1 14:53:57 2009 +0300 + + The .xz file format version 1.0.1 + +commit 083c23c680ff844846d177cfc58bb7a874e7e6b9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue May 26 14:48:48 2009 +0300 + + Make the raw value of the Check field available to applications + via lzma_block structure. + + This changes ABI but not doesn't break API. + +commit b4f5c814090dc07d4350453576305e41eb9c998d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat May 23 16:57:21 2009 +0300 + + Remove undocumented alternative option names --bcj, --ppc, + and --itanium. + +commit b1edee2cdc7ef4411b1a21c07094ec763f071281 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat May 23 15:12:23 2009 +0300 + + Add support for specifying the BCJ filter start offset + in the xz command line tool. + +commit 72aa0e9c5f4289f10ef5bf240a9448d3017f1ceb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat May 23 14:51:09 2009 +0300 + + Updated THANKS. + +commit dcedb6998cefeca6597dd1219328a3abf5acf66d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 22 16:40:50 2009 +0300 + + Added support for --quiet and --no-warn to xzdec. + Cleaned up the --help message a little. + +commit 5f735dae80aa629853f4831d7b84ec1c614979eb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 22 15:11:52 2009 +0300 + + 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. + +commit b60376249e0c586910c4121fab4f791820cc1289 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 22 14:43:00 2009 +0300 + + Add --no-warn. + +commit b4f92f522d4b854c0adb7c38be7531e1a6a7b008 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 22 14:27:40 2009 +0300 + + Fix a comment. + +commit 4dd21d23f22569285ae706b58b0e5904b8db1839 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 22 14:21:20 2009 +0300 + + Remove the --info option, which was an alias for --list. + +commit 8836139b63ce774bdd62abf17ab69b290e08229e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 22 12:27:43 2009 +0300 + + 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. + +commit b0063023f8adb06ea735ec4af5c6f5b7bdb8e84d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 22 11:29:50 2009 +0300 + + 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. + +commit 071b825b23911a69dd1cd2f8cda004ef8a781fae +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu May 21 17:22:01 2009 +0300 + + 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. + +commit 03ca67fd37dd43fa7f590de340899cd497c10802 +Author: ABCD <en.abcd@gmail.com> +Date: Wed May 20 17:31:18 2009 -0400 + + 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. + +commit a6f43e64128a6da5cd641de1e1e527433b3e5638 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat May 2 16:10:14 2009 +0300 + + Use a GCC-specific #pragma instead of GCC-specific + -Wno-uninitialized to silence a bogus warning. + +commit f6ce63ebdb45a857c8949960c83c9580ae888951 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat May 2 14:46:50 2009 +0300 + + 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. + +commit be06858d5cf8ba46557395035d821dc332f3f830 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 1 11:28:52 2009 +0300 + + Remove docs that are too outdated to be updated + (rewrite will be better). + +commit 0255401e57c96af87c6b159eca28974e79430a82 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 1 11:21:46 2009 +0300 + + Added documentation about the legacy .lzma file format. + +commit 1496ff437c46f38303e0e94c511ca604b3a11f85 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 1 11:20:23 2009 +0300 + + Renamed the file format specification to xz-file-format.txt + which is the filename used on the WWW. + +commit 21c6b94373d239d7e86bd480fcd558e30391712f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Apr 28 23:08:32 2009 +0300 + + 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. + +commit e518d167aa5958e469982f4fb3a24b9b6a2b5d1c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Apr 15 14:13:38 2009 +0300 + + 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). + +commit 31decdce041581e57c0d8a407d4795b114ef27ca +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Apr 14 11:48:46 2009 +0300 + + Minor fixes to test files' README. + +commit 4787d654434891c7df5b43959b0d2873718f06e0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Apr 13 16:36:41 2009 +0300 + + Updated history.txt. + +commit 2f0bc9cd40f709152a0177c8e585c0757e9af9c9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Apr 13 14:49:48 2009 +0300 + + Quick & dirty update to support xz in diff/grep/more scripts. + +commit 02ddf09bc3079b3e17297729b9e43f14d407b8fc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Apr 13 11:27:40 2009 +0300 + + Put the interesting parts of XZ Utils into the public domain. + Some minor documentation cleanups were made at the same time. + +commit e79c42d854657ae7f75613bd80c1a35ff7c525cb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Apr 10 11:17:02 2009 +0300 + + Fix off-by-one in LZ decoder. + + Fortunately, this bug had no security risk other than accepting + some corrupt files as valid. + +commit 94eb9ad46f1fded6d8369cf3d38bb9754c1375af +Author: Pavel Roskin <proski@gnu.org> +Date: Tue Mar 31 12:15:01 2009 -0400 + + Fix minor typos in README + +commit 9bab5336ebd765ec4e12252f416eefdf04eba750 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Mar 31 21:52:51 2009 +0300 + + Add a note and work-around instructions to README about + problems detecting a C99 compiler when some standard + headers are missing. + +commit a0497ff7a06f9350349264fe9b52dfefc6d53ead +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Mar 18 16:54:38 2009 +0200 + + Updated THANKS. + +commit 390e69887fc5e0a108eb41203bed9acd100a3d76 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Mar 18 16:51:41 2009 +0200 + + Fix wrong macro names in lc_cpucores.m4 and cpucores.h. + Thanks to Bert Wesarg. + +commit 0df9299e2478c2a0c62c05b1ae14a85a353e20d6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 1 09:03:08 2009 +0200 + + Test for Linux-specific sysinfo() only on Linux systems. + Some other systems have sysinfo() with different semantics. + +commit cf751edfde3ad6e088dc18e0522d31ae38405933 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 1 09:00:06 2009 +0200 + + Added AC_CONFIG_MACRO_DIR to configure.ac. + +commit 63df14c57dee7c461717784287056688482a7eb9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Mar 1 08:58:41 2009 +0200 + + Fix the Autoconf test for getopt_long replacement. + It was broken by e114502b2bc371e4a45449832cb69be036360722. + +commit fd6a380f4eda4f00be5f2aa8d222992cd74a714f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 22 19:07:54 2009 +0200 + + Add a rough explanation of --extreme to output of --help. + +commit 68bf7ac2984d3627369a240ef0491934d53f7899 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 22 18:52:49 2009 +0200 + + 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. + +commit 47c2e21f82242f50f18713a27d644c2c94ab3fea +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Feb 18 13:00:10 2009 +0200 + + Added files missing from the previous commit. + +commit 489a3dbaa0465f04400804e956a1cfbbee3654a2 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Feb 17 10:43:00 2009 +0200 + + Added lzma_easy_buffer_encode(). Splitted easy.c into small + pieces to avoid unneeded dependencies making statically + linked applications bigger than needed. + +commit 7494816ab08d82f4d6409788825930c4e43cfd0d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 15 15:48:45 2009 +0200 + + Make physmem.h work on old Windows versions. + Thanks to Hongbo Ni for the original patch. + +commit 11ae4ae35fd70182c713f2d914b7cb1143bc76f0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 14 20:44:52 2009 +0200 + + Fix microsecond vs. nanosecond confusion in my_time(). + +commit 3084d662d2646ab7eb58daf0dc32cf3f9a74eec7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 14 00:45:29 2009 +0200 + + 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. + +commit 9c62371eab2706c46b1072f5935e28cb4cd9dca8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 13 18:23:50 2009 +0200 + + Initial port to DOS using DJGPP. + +commit 0dae8b7751d09e9c5a482d5519daaee4800ce203 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 13 18:02:05 2009 +0200 + + Windows port: Take advantage of the version number macros. + Now the version number is not duplicated in the + Windows-specific files anymore. + +commit fdbc0cfa71f7d660855098a609175ba384259529 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 13 18:00:03 2009 +0200 + + 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. + +commit 1d924e584b146136989f48c13fff2632896efb3d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 13 17:30:30 2009 +0200 + + Fix handling of integrity check type in the xz command line tool. + +commit 96c46df7deb231ea68a03d8d1da9de4c774e36d8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 13 17:29:02 2009 +0200 + + Improve support for DOS-like systems. + Here DOS-like means DOS, Windows, and OS/2. + +commit b6a30ee8c2de60ecd722cd05223e4ba72f822e33 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Feb 11 20:02:32 2009 +0200 + + Remove dead directories from .gitignore. + +commit 1ec5b0027911d94cb6f98892cbc690f818d8a861 +Author: Jim Meyering <jim@meyering.net> +Date: Wed Feb 11 14:45:14 2009 +0100 + + .gitignore vs. Makefiles + + How about this for those of us who do srcdir builds? + +commit 154f5aec2de201c674841de4fcc9804c2a87af07 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Feb 10 21:48:35 2009 +0200 + + 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. + +commit e605c2663691b0a4c307786aa368d124ea081daa +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Feb 10 21:48:05 2009 +0200 + + Added resource files for the Windows build. + +commit a3bbbe05d32b1f7ea9eb98805df4dda2e811b476 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 9 14:54:31 2009 +0200 + + Let the user specify custom CFLAGS on the make command + line. Previously custom CFLAGS worked only when they were + passed to configure. + +commit 53f7598998b1860a69c51243b5d2e34623c6bf60 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 8 21:35:11 2009 +0200 + + Fix aliasing issue in physmem.h. + +commit 0e27028d74c5c7a8e036ae2a9b8cecb0ac79d3a6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 8 18:24:50 2009 +0200 + + 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. + +commit ae1ad9af54210c9a2be336b1316532da5071516c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 8 18:17:05 2009 +0200 + + Make "xz --force" to write to terminal as the error + message suggests. + +commit 79e25eded48d2fe33f31441ab7a034f902e335f8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 8 10:37:50 2009 +0200 + + Support both slash and backslash as path component + separator on Windows when parsing argv[0]. + +commit bc7c7109cc4410055a888c1c70cbd1c9445c4361 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 7 23:18:13 2009 +0200 + + Omit the wrong and (even if corrected) nowadays useless rm + from autogen.sh. + +commit edfc2031e56f8a2ccda063f02936b3a848d88723 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 7 21:41:52 2009 +0200 + + Updated THANKS. + +commit 880c3309386aac58fc4f3d7ca99bd31bcb1526a3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 7 21:17:07 2009 +0200 + + 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. + +commit 3f86532407e4ace3debb62be16035e009b56ca36 +Author: Mike Frysinger <vapier@gentoo.org> +Date: Fri Feb 6 23:38:39 2009 -0500 + + add gitignore files + + Signed-off-by: Mike Frysinger <vapier@gentoo.org> + +commit bd7ca1dad5c146b6217799ffaa230c32d207a3e5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 7 17:07:52 2009 +0200 + + Assume 32 MiB of RAM on unsupported operating systems like + the comment in hardware.c already said. + +commit d0ab8c1c73ae712adb0d26fbb9da762d99a63618 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 7 16:26:58 2009 +0200 + + 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. + +commit bfd91198e44a52bd9bfe3cd6dcae5edab7c6eb45 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 7 15:55:47 2009 +0200 + + Support LZMA_API_STATIC in assembler files to + avoid __declspec(dllexport) equivalent. + +commit 3306cf3883492720b3c34baa02f4eb4227d91c73 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 7 11:11:50 2009 +0200 + + 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. + +commit b719e63c5f4c91d2d5e2ea585d4c055ec3767d0b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 6 16:55:45 2009 +0200 + + Another grammar fix + +commit fe5434f940f75fec3611cf9d9edf78c4da8ac760 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 6 12:30:23 2009 +0200 + + Grammar fix in README. + +commit 3dfa58a9eedf5a0e566452b078801c9cbcf7a245 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 6 10:06:32 2009 +0200 + + Some MSYS installations (e.g. MsysGit) don't include + install.exe, so don't rely on it. + +commit 975d8fd72a5148d46b2e1745f7a211cf1dfd9d31 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 6 09:13:15 2009 +0200 + + 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. + +commit 094b1b09a531f0d201ec81f2b07346a995fd80b9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Feb 5 21:21:27 2009 +0200 + + Add the "windows" directory to EXTRA_DIST. + +commit e1c3412eec7acec7ca3b32c9c828f3147dc65b49 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Feb 5 09:17:51 2009 +0200 + + Added initial experimental makefile for use with MinGW. + +commit 75905a9afc0ee89954ede7d08af70d1148bf0fd9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Feb 5 09:12:57 2009 +0200 + + Various code cleanups the the xz command line tool. + It now builds with MinGW. + +commit d0c0b9e94e0af59d1d8f7f4829695d6efe19ccfe +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Feb 3 12:15:17 2009 +0200 + + Another utime() fix. + +commit ccf92a29e8c7234284f1568c1ec0fd7cb98356ca +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Feb 3 10:41:11 2009 +0200 + + Fix wrong filename argument for utime() and utimes(). + This doesn't affect most systems, since most systems + have better functions available. + +commit 99c1c2abfae2e87f3c17e929783e6d1bb7a3f302 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 2 21:19:01 2009 +0200 + + 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. + +commit 22a0c6dd940b78cdac2f4a4b4b0e7cc0ac15021f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Feb 2 20:14:03 2009 +0200 + + 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. + +commit 8dd7b6052e18621e2e6c62f40f762ee88bd3eb65 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 1 22:40:35 2009 +0200 + + Fix a bug in lzma_block_buffer_decode(), although this + function should be rewritten anyway. + +commit 55fd41431e61fb8178858283d636b6781e33e847 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 1 22:39:07 2009 +0200 + + 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. + +commit 3e54ecee5cad30a5ca361a88a99230407abc0699 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 1 00:11:20 2009 +0200 + + Fix missing newlines in xzdec.c. + +commit d64ca34f1b6f34e86adefc7f735b4eff8e6d4a35 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Feb 1 00:10:07 2009 +0200 + + Use __cdecl also for function pointers in liblzma API when + on Windows. + +commit 6a2eb54092fc625d59921a607ff68cd1a90aa898 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 31 11:01:48 2009 +0200 + + 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. + +commit d9993fcb4dfc1f93abaf31ae23b3ef1f3123892b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 31 10:13:09 2009 +0200 + + Use _WIN32 instead of WIN32 in xzdec.c to test if compiling on Windows. + +commit 2dbdc5befb33c3703e4609809101047c67caf343 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 31 10:02:52 2009 +0200 + + Fix two lines in lzma.h on which the # wasn't at the + beginning of the line. + +commit 4ab760109106dc04f39dd81c97d50f528d1b51c1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 31 09:55:05 2009 +0200 + + Add support for using liblzma headers in MSVC, which has no + stdint.h or inttypes.h. + +commit b2172cf823d3be34cb0246cb4cb32d105e2a34c9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 31 08:49:54 2009 +0200 + + Fix # -> ## in a macro in lzma.h. + +commit 1aae8698746d3c87a93f8398cdde2de9ba1f7208 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 30 18:50:16 2009 +0200 + + Updated README. + +commit f54bcf6f80d585236bc03ce49f7c73e1abaa17eb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 30 00:29:58 2009 +0200 + + Remove dangling crc64_init.c. + +commit 982da7ed314398420c38bf154a8f759d5f18b480 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 28 17:16:38 2009 +0200 + + 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. + +commit c4683a660b4372156bdaf92f0cdc54a58f95ee6f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 28 08:45:59 2009 +0200 + + Updated THANKS. + +commit 3241317093595db9f79104faafe93cb989c9f858 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 28 08:43:26 2009 +0200 + + 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. + +commit f76e39cf930f888d460b443d18f977ebedea8b2a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 27 18:36:05 2009 +0200 + + 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. + +commit 449b8c832b26c3633f3bec60095e57d2d3ada1f3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 26 20:09:17 2009 +0200 + + Regenerate the CRC tables without trailing blanks. + +commit 850f7400428dc9c5fd08a2f35a5bd2c9e45aede2 +Author: Jim Meyering <meyering@redhat.com> +Date: Mon Jan 19 21:37:16 2009 +0100 + + remove trailing blanks from all but .xz files + +commit 667481f1aad34e1ed15738e7913a9c7e256b4cf5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 26 14:34:10 2009 +0200 + + Add lzma_block_buffer_decode(). + +commit 5fb34d8324d3e7e0061df25d0086b64c8726b19d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 26 14:33:28 2009 +0200 + + Add more sanity checks to lzma_stream_buffer_decode(). + +commit c129748675a5daa8838df92bde32cc04f6ce61ba +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 26 14:33:13 2009 +0200 + + Avoid hardcoded constant in easy.c. + +commit 1859d22d75e072463db74c25bc3f5a7992e5fdf6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 26 13:06:49 2009 +0200 + + Tiny bit better sanity check in block_util.c + +commit 2c5fe958e4bbe9b147b10c255955dfe2827fb8e7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 25 01:35:56 2009 +0200 + + Fix a dumb bug in Block decoder, which made it return + LZMA_DATA_ERROR with valid data. The bug was added in + e114502b2bc371e4a45449832cb69be036360722. + +commit c81f13ff29271de7293f8af3d81848b1dcae3d19 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 23 22:27:50 2009 +0200 + + Added lzma_stream_buffer_decode() and made minor cleanups. + +commit 0b3318661ce749550b8531dfd469639a08930391 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 22 12:53:33 2009 +0200 + + Fix a comment. + +commit 9ec80355a7212a0a2f8c89d98e51b1d8b4e34eec +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 20 16:37:27 2009 +0200 + + Add some single-call buffer-to-buffer coding functions. + +commit d8b58d099340f8f4007b24b211ee41a7210c061c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 20 13:45:41 2009 +0200 + + Block encoder cleanups + +commit 0c09810cb3635cb575cb54e694d41523e7d0a335 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 20 10:35:15 2009 +0200 + + Use LZMA_PROG_ERROR in lzma_code() as documented in base.h. + +commit 2f1a8e8eb898f6c036cde55d153ad348bfab3c00 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 19 22:53:18 2009 +0200 + + Fix handling of non-fatal errors in lzma_code(). + +commit 4810b6bc25087be872960b9dd1d11ff07735dc88 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 19 14:00:33 2009 +0200 + + Move some LZMA2 constants to lzma2_encoder.h so that they + can be used outside lzma2_encoder.c. + +commit 00be5d2e09f9c7a6a8563465ad8b8042866817a4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 19 13:52:36 2009 +0200 + + Remove dead code. + +commit 128586213f77c9bd82b7e9a62927f6d0c3769d85 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 17 14:24:25 2009 +0200 + + 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. + +commit b056379490be5c584c264a967f0540041a163a1e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 15 14:29:22 2009 +0200 + + Updated THANKS. + +commit dc8f3be06d54ef6e6cfb5134dd3d25edd08cef89 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 15 14:27:32 2009 +0200 + + 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. + +commit 8286a60b8f4bd5accfbc9d229d2204bac31994f2 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 7 18:41:15 2009 +0200 + + Use pthread_sigmask() instead of sigprocmask() when pthreads + are enabled. + +commit 4fd43cb3a906f6da2943f69239ee984c4787c9a9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 20:01:00 2008 +0200 + + Bumped version to 4.999.8beta right after the release + of 4.999.7beta. + +commit 061748f5932719643cda73383db715167d543c22 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 18:59:02 2008 +0200 + + Disable Subblock filter from test_compress.sh since it is + disabled by default in configure.ac. + +commit 9c45658ddc8bd4a7819ef8547d3e7ccf73203e78 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 17:44:20 2008 +0200 + + Disable both Subblock encoder and decoder my default, + since they are not finished and may have security issues too. + +commit b59f1e98f50694cf6a8f1b342fd878feebdb2f88 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 17:42:50 2008 +0200 + + Update some files in debug directory. + +commit d1d17a40d33a9682424ca37282813492f2cba6d0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 17:41:46 2008 +0200 + + Prepare for 4.999.7beta release. + +commit 88d3e6b0b18e24142b6d3b41dc1b84b00c49fef3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 17:15:03 2008 +0200 + + Cleaned up some comments in the API headers. + +commit 322ecf93c961e45a1da8c4a794a7fdacefcd7f40 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 16:29:39 2008 +0200 + + 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. + +commit 7eea8bec3abfed883efba66264a1452a1c04f6b0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 00:57:27 2008 +0200 + + Fixed missing quoting in configure.ac. + +commit 28e75f7086dbe9501d926c370375c69dfb1236ce +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 00:48:23 2008 +0200 + + Updated src/liblzma/Makefile.am to use liblzma.pc.in, which + should have been in the previous commit. + +commit 7ed9d943b31d3ee9c5fb2387e84a241ba33afe90 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 31 00:30:49 2008 +0200 + + 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. + +commit 5cda29b5665004fc0f21d0c41d78022a6a559ab2 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Dec 27 19:40:31 2008 +0200 + + Use 28 MiB as memory usage limit for encoding in test_compress.sh. + +commit 050eb14d29e2537c014662e83599fd8a77f13c45 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Dec 27 19:32:20 2008 +0200 + + Revert a change made in 3b34851de1eaf358cf9268922fa0eeed8278d680 + 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. + +commit 4820f10d0f173864f6a2ea7479663b509ac53358 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Dec 27 19:30:19 2008 +0200 + + Some xz command line tool improvements. + +commit e33194e79d8f5ce07cb4aca909b324ae75098f7e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Dec 27 19:27:49 2008 +0200 + + 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. + +commit 4d00652e75dd2736aedc3a3a8baff3dd0ea38074 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Dec 18 13:42:52 2008 +0200 + + Updated Makefile.am that was missing from the previous commit. + +commit 634636fa56ccee6e744f78b0abed76c8940f2f8f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 17 21:49:53 2008 +0200 + + 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. + +commit 4fed98417d1687f5eccccb42a133fde3ec81216a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 17 20:11:23 2008 +0200 + + xz message handling improvements + +commit 653e457e3756ef35e5d1b2be3523b3e4b1e9ee4d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 15 23:26:43 2008 +0200 + + 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.) + +commit 671a5adf1e844bfdd6fd327016c3c28694493158 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 15 19:39:13 2008 +0200 + + Bunch of liblzma API cleanups and fixes. + +commit 17781c2c20fd77029cb32e77792889f2f211d69d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 15 14:26:52 2008 +0200 + + The LZMA2 decoder fix introduced a bug to LZ decoder, + which made LZ decoder return too early after dictionary + reset. This fixes it. + +commit f9f2d1e74398500724041f7fb3c38db35ad8c8d8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 15 11:20:22 2008 +0200 + + Added two new test files. + +commit ff7fb2c605bccc411069e07b9f11fb957aea2ddf +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 15 10:01:59 2008 +0200 + + Fix data corruption in LZMA2 decoder. + +commit 1ceebcf7e1bd30b95125f0ad67a09fdb6215d613 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Dec 13 00:54:11 2008 +0200 + + Name the package "xz" in configure.ac. + +commit a94bf00d0af9b423851905b031be5a645a657820 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Dec 12 22:43:21 2008 +0200 + + 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. + +commit 8582d392baacd2cdac07ca60041f8c661323676d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 10 01:31:00 2008 +0200 + + Remove obsolete comment. + +commit b1ae6dd731ea3636c3c2bfc7aefa71457d3328f1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 10 01:27:15 2008 +0200 + + Use "decompression" consistently in --long-help. + +commit 1ea9e7f15afd5d3981e2432710e932320597bca9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Dec 10 01:23:58 2008 +0200 + + Added preset=NUM to --lzma1 and --lzma2. This makes it easy + to take a preset as a template and modify it a little. + +commit bceb3918dbb21f34976bfdd4c171a81319de71f7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 9 17:43:31 2008 +0200 + + Put the file format specification into the public domain. + Same will be done to the actual code later. + +commit 6efa2d80d46a38861016f41f0eb6fa2ec9260fe6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 9 17:41:49 2008 +0200 + + 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. + +commit f20a03206b71ff01b827bb7a932411d6a6a4e06a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 9 10:36:24 2008 +0200 + + Updated THANKS. + +commit ef7890d56453dca1aeb2e12db29b7e418d93dde4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 1 23:04:12 2008 +0200 + + 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). + +commit ccd57afa09e332d664d6d6a7498702791ea5f659 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 1 22:59:28 2008 +0200 + + Validate the filter chain before checking filter-specific + memory usage. + +commit c596fda40b62fe1683d0ac34d0c673dcaae2aa15 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 1 22:58:22 2008 +0200 + + Make the memusage functions of LZMA1 and LZMA2 decoders + to validate the filter options. + +commit c58f469be5bb9b0bdab825c6687445fd553f4f3a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 1 22:55:18 2008 +0200 + + Added the changes for Delta filter that should have been + part of 656ec87882ee74b192c4ea4a233a235eca7b04d4. + +commit cd708015202dbf7585b84a8781462a20c42a324b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 1 22:50:28 2008 +0200 + + LZMA2 decoder cleanups. Make it require new LZMA properties + also in the first LZMA chunk after a dictionary reset in + uncompressed chunk. + +commit 656ec87882ee74b192c4ea4a233a235eca7b04d4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 1 16:30:11 2008 +0200 + + Added lzma_delta_coder_memusage() which also validates + the options. + +commit 691a9155b7a28882baf37e9d1e969e32e91dbc7a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 29 10:03:49 2008 +0200 + + Automake includes the m4 directory, so don't add it in + Makefile.am separately. + + Updated THANKS. + +commit c7007ddf06ac2b0e018d71d281c21b99f16e7ae0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Nov 28 12:00:48 2008 +0200 + + Tested using COLUMNS environment variable to avoid broken + progress indicator but since COLUMNS isn't usually available, + the code was left commented out. + +commit ae65dcfde27014e4d811e1a1308aa5d0fe8debbd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Nov 27 19:28:59 2008 +0200 + + Cleanups to message.c. + +commit a8368b75cdcd5427299001cc42839287f27b244d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Nov 25 02:37:47 2008 +0200 + + Remove the nowadays unneeded memory limitting malloc() wrapper. + +commit 69472ee5f055a2bb6f28106f0923e1461fd1d080 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Nov 23 15:09:03 2008 +0200 + + VLI encoder and decoder cleanups. Made encoder return + LZMA_PROG_ERROR in single-call mode if there's no output + space. + +commit 4249c8c15a08f55b51b7012e6aaafce3aa9eb650 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Nov 22 17:44:33 2008 +0200 + + Typo fix + +commit 6d1d6f4598d121253dbe1084c6866b66e95c361b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Nov 20 22:59:10 2008 +0200 + + Support NetBSD's errno for O_NOFOLLOW. + +commit f901a290eef67b8ea4720ccdf5f46edf775ed9d7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Nov 20 18:05:52 2008 +0200 + + Build xzdec and lzmadec from xzdec.c. xzdec supports only .xz + files and lzmadec only .lzma files. + +commit 86a0ed8f01c8ed44721223f885e679c71b7bb94c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Nov 20 11:01:29 2008 +0200 + + Minor cleanups to xzdec. + +commit 54f716ba8905d09752dcd1519455a40bd21d5317 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Nov 19 23:55:22 2008 +0200 + + Added missing check for uint16_t. + +commit 1880a3927b23f265f63b2adb86fbdb81ea09eb06 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Nov 19 23:52:24 2008 +0200 + + 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. + +commit e114502b2bc371e4a45449832cb69be036360722 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Nov 19 20:46:52 2008 +0200 + + 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 + +commit 3c3905b53462ae235c9438d86a4dc51086410932 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Oct 9 11:12:29 2008 +0300 + + Fixed the test that should have been fixed as part + of 1e8e4fd1f3e50129b4541406ad765d2aa1233943. + +commit 0f295bf7a3ece01f667caae318cc3e3424085886 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Oct 7 16:42:18 2008 +0300 + + Fixed some help messages. + +commit 1e8e4fd1f3e50129b4541406ad765d2aa1233943 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Oct 7 09:40:31 2008 +0300 + + Made the preset numbering more logical in liblzma API. + +commit 5e4df4c3c09c82bbbb1a916784e3dc717ca4ff81 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Oct 3 19:36:09 2008 +0300 + + Removed fi from po/LINGUAS. + +commit fcfb86c7770328cfffa2e83b176af9a1ba2d9128 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Oct 3 07:06:48 2008 +0300 + + Fixed suffix handling with --format=raw. + +commit bd137524f2f50e30ba054f42f1f6536cd3cee920 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Oct 2 22:51:46 2008 +0300 + + 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. + +commit 4c321a41c482821aa3c4d64cdf886a6ed904d844 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 30 17:43:55 2008 +0300 + + Renamed the test files from .lzma suffix to .xz suffix. + +commit 8e60c889a2816a63013a35c99ce26bf28f5b78eb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 30 13:57:44 2008 +0300 + + Fixed Stream decoder to actually use the first_stream variable. + +commit 3bdbc12c054d1961133ee19802af7dd3c3494543 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 30 13:56:57 2008 +0300 + + Added one more test file. + +commit a6639022fdc536e5659b070a465221b4cf7c51fa +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 30 13:34:07 2008 +0300 + + Fixed uninitialized variable in Stream decoder. + +commit ed3709000a3f17ecefab29b2235d7e2221b00003 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 30 13:27:28 2008 +0300 + + Added two test files. + +commit ea560b0ea80525752bdcd0074d24f8dc170bbe29 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 23:49:24 2008 +0300 + + Fix conflicting Subblock helper filter's ID. + +commit ad97483b6e55142fd8d5c041db057017a891cd95 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 23:37:13 2008 +0300 + + Changed magic bytes to match the updated spec. Filename + suffix wasn't changed yet. + +commit 7a57069167e9e63394e2b095ee3a63253fcb51c7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 23:16:09 2008 +0300 + + Remove po/fi.po since I'm not keeping it updated for now. + +commit 018ae09df8f2fee5a7374f307df4cb42fad0b81e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 23:13:54 2008 +0300 + + Fix also test_compress.sh. + +commit 3a62a5fb85d2eebd8666e64ed5d364d095062858 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 23:01:15 2008 +0300 + + Fixed compilation of test_filter_flags.c, which was broken by + 1dcecfb09b55157b8653d747963069c8bed74f04. + +commit c6ca26eef7cd07eba449035514e2b8f9ac3111c0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 19:11:02 2008 +0300 + + Updated file format specification. It changes the suffix + of the new format to .xz and removes the recently added + LZMA filter. + +commit 1dcecfb09b55157b8653d747963069c8bed74f04 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 19:09:21 2008 +0300 + + Some API changes, bug fixes, cleanups etc. + +commit 5cc5064cae603b649c64c40125c7dd365de54c9d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 27 11:28:49 2008 +0300 + + Added 7z2lzma.bash. + +commit f147666a5cd15542d4e427da58629f4a71cc38e1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 17 22:11:39 2008 +0300 + + Miscellaneous LZ and LZMA encoder cleanups + +commit 13d68b069849e19c33822cd8996cd6447890abb1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 13 13:54:00 2008 +0300 + + LZ decoder cleanup + +commit 13a74b78e37f16c9096ba5fe1859cc04eaa2f9f7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 13 12:10:43 2008 +0300 + + Renamed constants: + - LZMA_VLI_VALUE_MAX -> LZMA_VLI_MAX + - LZMA_VLI_VALUE_UNKNOWN -> LZMA_VLI_UNKNOWN + - LZMA_HEADER_ERRRO -> LZMA_OPTIONS_ERROR + +commit 320601b2c7b08fc7da9da18d5bf7c3c1a189b080 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Sep 12 22:41:40 2008 +0300 + + Improved the Stream Flags handling API. + +commit ec490da5228263b25bf786bb23d1008468f55b30 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 11 23:10:44 2008 +0300 + + Simplified debug/known_sizes.c to match the relaxed + requirements of Block encoder. + +commit 16e8b98f2659347edfa74afdbbb9e73311153cb9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 11 23:09:24 2008 +0300 + + Remove a check from Block encoder that should have already + been removed in 2ba01bfa755e47ff6af84a978e3c8d63d7d2775e. + +commit 5a710c3805bdf6d7e3c92e954e4e4565b27bcb13 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 11 20:02:38 2008 +0300 + + Remove bogus #includes. + +commit 01892b2ca5f69bed0ea746e04b604030d57806bb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 11 10:49:14 2008 +0300 + + Updated THANKS. + +commit 962f2231d49409fe6852e44ffe8c5dbabb04bc7d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 11 10:48:12 2008 +0300 + + Fix a compiler error on big endian systems that don't + support unaligned memory access. + +commit fa3ab0df8ae7a8a1ad55b52266dc0fd387458671 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 11 10:46:14 2008 +0300 + + Silence a compiler warning. + +commit 9373e81e18822db4972819442ea4c2cb9955470b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 10 19:16:32 2008 +0300 + + Bumped version to 4.999.6alpha. + +commit cb072b7c8442ba68bb0c62c0abbbe939794887a3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 10 17:02:00 2008 +0300 + + 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. + +commit 123ab0acec435c9e9866a99e30482116cfbd9ba5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 10 16:44:32 2008 +0300 + + Filter handling cleanups + +commit 9cfcd0c4f2f865d8fbbb46ea28344a9be0dd8ad1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 10 00:33:00 2008 +0300 + + Comments + +commit 2ba01bfa755e47ff6af84a978e3c8d63d7d2775e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 10 00:27:02 2008 +0300 + + 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. + +commit 07efcb5a6bc5d7018798ebd728586f84183e7d64 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Sep 7 10:23:13 2008 +0300 + + Changed Filter ID of LZMA to 0x20. + +commit 32fe5fa541e82c08e054086279079ae5016bd8d8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 6 23:42:50 2008 +0300 + + Comments + +commit 0a31ed9d5e3cde4feb094b66f3a8b2c074605d84 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Sep 6 15:14:30 2008 +0300 + + Some API cleanups + +commit da98df54400998be2a6c3876f9655a3c51b93c10 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 4 11:53:06 2008 +0300 + + 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. + +commit 2496aee8a7741a8a0d42987db41ff2cf1a4bdabd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Sep 4 10:39:15 2008 +0300 + + 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). + +commit bea301c26d5d52675e11e0236faec0492af98f60 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Sep 3 17:06:25 2008 +0300 + + Minor updates to the file format specification. + +commit 9c75b089b4a9e0edcf4cf7970a4383768707d6c8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 2 19:33:32 2008 +0300 + + Command line tool fixes + +commit bab0590504b5aeff460ab4ca8c964dd7c1bad9e4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 2 19:31:42 2008 +0300 + + Auto decoder cleanup + +commit 689602336d126a46b60d791a67decab65e1e81f5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 2 19:12:12 2008 +0300 + + 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. + +commit 80c4158f19904026433eb6f5d5ca98a0ecd4f66c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 2 14:56:52 2008 +0300 + + Stream decoder cleanups + +commit fc681657450ce57be1fe08f7a15d31dcc705e514 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Sep 2 11:45:39 2008 +0300 + + Some fixes to LZ encoder. + +commit ede675f9ac1ca82a7d7c290324adba672118bc8d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Aug 31 11:47:01 2008 +0300 + + Fix wrong pointer calculation in LZMA encoder. + +commit 3b34851de1eaf358cf9268922fa0eeed8278d680 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Aug 28 22:53:15 2008 +0300 + + 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. + +commit 57b9a145a527f0716822615e5ed536d33aebd3fc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 20 17:16:32 2008 +0300 + + Fix test_filter_flags to match the new restriction of lc+lp. + +commit eaafc4367c77ec1d910e16d11b4da293969d97a3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jun 20 16:19:54 2008 +0300 + + Remove some redundant code from LZMA encoder. + +commit 0809c46534fa5664fe35d9e98d95e87312ed130e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jun 19 16:35:08 2008 +0300 + + 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. + +commit d25ab1b96178f06a0e724f58e3cd68300b2b1275 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jun 18 21:45:19 2008 +0300 + + Comments + +commit 6368a2fa5901c75864be5171dd57a50af7adbb41 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jun 18 19:19:02 2008 +0300 + + Delete old code that was supposed to be already deleted + from test_block_header.c. + +commit 7d17818cec8597f847b0a2537fde991bbc3d9e96 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jun 18 18:02:10 2008 +0300 + + 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. + +commit bf6348d1a3ff09fdc06940468f318f75ffa6af11 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jun 17 15:03:46 2008 +0300 + + 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. + +commit 803194ddd26f01ff60ba4e9924c6087a56b29827 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jun 11 21:42:47 2008 +0300 + + Fix uninitialized variable in LZMA encoder. This was + introduced in 369f72fd656f537a9a8e06f13e6d0d4c242be22f. + +commit 0ea98e52ba87453497b1355c51f13bad55c8924a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jun 11 15:08:44 2008 +0300 + + 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. + +commit 436fa5fae96d4e35759aed33066060f09ee8c6ef +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jun 10 20:36:12 2008 +0300 + + s/decompressed/compressed/ in the command line tool's + error message. + +commit 369f72fd656f537a9a8e06f13e6d0d4c242be22f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jun 1 12:48:17 2008 +0300 + + 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. + +commit e55e0e873ce2511325749d415ae547d62ab5f00d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri May 30 11:53:41 2008 +0300 + + Typo fixes from meyering. + +commit ed6664146fcbe9cc4a3b23b31632182ed812ea93 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun May 11 14:24:42 2008 +0300 + + Remove support for pre-C89 libc versions that lack memcpy, + memmove, and memset. + +commit b09464bf9ae694afc2d1dc26188ac4e2e8af0a63 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun May 11 14:17:21 2008 +0300 + + 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(). + +commit 11de5d5267f7a0a7f0a4d34eec147e65eaf9f9cf +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue May 6 15:15:07 2008 +0300 + + Bunch of grammar fixes from meyering. + +commit dc192b6343ae36276c85fcf7ef6006147816eadc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue May 6 13:41:05 2008 +0300 + + Typo fix + +commit 944b62b93239b27b338d117f2668c0e95849659b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun May 4 22:29:27 2008 +0300 + + Don't print an error message on broken pipe unless --verbose + is used. + +commit 8e074349e47ea6832b8fdf9244e581d453733433 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Apr 30 22:16:17 2008 +0300 + + Fix a crash with --format=alone if other filters than LZMA + are specified on the command line. + +commit 2f361ac19b7fd3abcd362de4d470e6a9eb495b73 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Apr 28 17:08:27 2008 +0300 + + Updated THANKS. + +commit 3be21fb12f4cec2cf07799e8960382f4cb375369 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Apr 28 17:06:34 2008 +0300 + + Fixed wrong spelling "limitter" to "limiter". This affects + liblzma's API. + +commit beeb81060821dfec4e7898e0d44b7900dcb2215e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Apr 25 15:39:50 2008 +0300 + + 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. + +commit c324325f9f13cdeb92153c5d00962341ba070ca2 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Apr 25 13:58:56 2008 +0300 + + 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. + +commit d3ba30243c75c13d094de1793f9c58acdbacc692 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Apr 25 13:41:29 2008 +0300 + + Added memusage.c to debug directory. + +commit 8f804c29aa8471ccd6438ddca254092b8869ca52 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Apr 25 13:32:35 2008 +0300 + + 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. + +commit c99037ea10f121cbacf60c37a36c29768ae53447 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 20:25:39 2008 +0300 + + Fix a memory leak by calling free(extra->data) in + lzma_extra_free(). + +commit 22ba3b0b5043fa481903482ce85015fe775939e5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 20:23:05 2008 +0300 + + Make unlzma and lzcat symlinks. + +commit 17c36422d4cbc2c70d5c83ec389406f92cd9e85e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 20:20:27 2008 +0300 + + Fixed a bug in command line option parsing. + +commit 283f939974c32c47f05d495e8dea455ec646ed64 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 20:19:20 2008 +0300 + + Added two assert()s. + +commit eb348a60b6e19a7c093f892434f23c4756973ffd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 19:22:53 2008 +0300 + + Switch to uint16_t as the type of range coder probabilities. + +commit 6c5306e312bcfd254cf654f88c04e34ba786df3d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 18:39:57 2008 +0300 + + Fix wrong return type (uint32_t -> bool). + +commit 712cfe3ebfd24df24d8896b1315c53c3bc4369c8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 18:38:00 2008 +0300 + + Fix data corruption in LZ encoder with LZMA_SYNC_FLUSH. + +commit bc04486e368d20b3027cde625267762aae063965 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 17:33:01 2008 +0300 + + Fix fastpos problem in Makefile.am when built with --enable-small. + +commit 7ab493924e0ed590a5121a15ee54038d238880d3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Apr 24 17:30:51 2008 +0300 + + 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. + +commit 641998c3e1ecc8b598fe0eb051fab8b9535c291b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Mar 24 16:38:40 2008 +0200 + + 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. + +commit ad999efd279d95f1e7ac555b14170e8e9020488c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Mar 22 14:39:34 2008 +0200 + + Take advantage of arithmetic right shift in range decoder. + +commit 03e0e8a0d7228b6ff1f0af39e2c040a4e425973d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Mar 22 14:18:29 2008 +0200 + + Added autoconf check to detect if we can use arithmetic + right shift for optimizations. + +commit 7521bbdc83acab834594a22bec50c8e1bd836298 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Mar 22 01:26:36 2008 +0200 + + Update a comment to use the variable name rep_len_decoder. + + (And BTW, the previous commit actually did change the + program logic slightly.) + +commit 63b74d000eedaebb8485f623e56864ff5ab71064 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Mar 22 00:57:33 2008 +0200 + + 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. + +commit e6eb0a26757e851cef62b9440319a8e73b015cb9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Mar 14 23:16:11 2008 +0200 + + Fix data corruption in LZMA encoder. Note that this bug was + specific to liblzma and was *not* present in LZMA SDK. + +commit 7d516f5129e4373a6d57249d7f608c634c66bf12 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Mar 14 21:32:37 2008 +0200 + + Fix a comment API header. + +commit 748d6e4274921a350bd0a317380309717441ef9c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Mar 12 23:14:50 2008 +0200 + + Make lzma_stream.next_in const. Let's see if anyone complains. + +commit bfde3b24a5ae25ce53c854762b6148952386b025 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Mar 11 15:35:34 2008 +0200 + + Apply a minor speed optimization to LZMA decoder. + +commit f310c50286d9e4e9c6170bb65348c9bb430a65b4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Mar 11 15:17:16 2008 +0200 + + Initialize the last byte of the dictionary to zero so that + lz_get_byte(lz, 0) returns zero. This was broken by + 1a3b21859818e4d8e89a1da99699233c1bfd197d. + +commit 5ead36cf7f823093672a4e43c3180b38c9abbaff +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Mar 10 15:57:55 2008 +0200 + + Really fix the price count initialization. + +commit d4d7feb83d1a1ded8f662a82e21e053841ca726c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Mar 10 13:47:17 2008 +0200 + + Updated THANKS. + +commit 0541c5ea63ef3c0ff85eeddb0a420e56b0c65258 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Mar 10 13:46:48 2008 +0200 + + 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. + +commit 596fa1fac72823e4ef5bc26bb53f9090445bf748 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Mar 10 13:44:29 2008 +0200 + + 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. + +commit 45e43e169527e7a98a8c8a821d37bf25822b764d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Mar 10 13:41:25 2008 +0200 + + Don't fill allocated memory with 0xFD when debugging is + enabled. It hides errors from Valgrind. + +commit c0e19e0662205f81a86da8903cdc325d50635870 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Feb 28 10:24:31 2008 +0200 + + Remove two redundant validity checks from the LZMA decoder. + These are already checked elsewhere, so omitting these + gives (very) tiny speed up. + +commit de7485806284d1614095ae8cb2ebbb5d74c9ac45 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Feb 6 13:25:32 2008 +0200 + + Tiny clean up to file-format.txt. + +commit 1a3b21859818e4d8e89a1da99699233c1bfd197d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Feb 2 14:51:06 2008 +0200 + + 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. + +commit 7e796e312bf644ea95aea0ff85480f47cfa30fc0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 1 08:39:26 2008 +0200 + + Do uncompressed size validation in raw encoder. This way + it gets done for not only raw encoder, but also Block + and LZMA_Alone encoders. + +commit 7dd48578a3853e0cfab9f1830bc30927173ec4bc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Feb 1 08:32:05 2008 +0200 + + Avoid unneeded function call in raw_common.c. + +commit b596fac963c3ff96f615d4d9b427a213ec341211 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 26 21:42:38 2008 +0200 + + Updated THANKS. + +commit e9f6e9c075ad93141a568d94f7d4eb0f2edbd6c2 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 26 21:40:23 2008 +0200 + + Added note.GNU-stack to x86 assembler files. It is needed + when using non-executable stack. + +commit 4c7ad179c78f97f68ad548cb40a9dfa6871655ae +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 26 19:12:50 2008 +0200 + + Added api/lzma/easy.h. I had forgot to add this to the + git repo. Thanks to Stephan Kulow. + +commit 288b232f54c3692cd36f471d4042f51daf3ea79f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 26 11:09:17 2008 +0200 + + Added more test files. + +commit c467b0defccf233d0c79234407bc38d7d09574d3 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 26 10:47:55 2008 +0200 + + Added more test files. + +commit f9842f712732c482f2def9f24437851e57dd83f8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 26 00:25:34 2008 +0200 + + 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. + +commit e988ea1d1a286dd0f27af0657f9665d5cd8573aa +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 25 23:50:35 2008 +0200 + + Added more Multi-Block test files. Improved some + descriptions in the test files' README. + +commit 4441e004185cd4c61bda184010eca5924c9dec87 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 25 23:12:36 2008 +0200 + + 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. + +commit bf4200c818fcf9102e56328d39cde91bfa13cfb6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 25 19:21:22 2008 +0200 + + Added test_memlimit.c. + +commit 7b8fc7e6b501a32a36636dac79ecb57099269005 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 25 19:20:28 2008 +0200 + + 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. + +commit e0c3d0043da2f670cfdb1abbb3223d5a594ad8db +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 25 13:55:52 2008 +0200 + + Use more parenthesis in succeed() macro in tests/tests.h. + +commit 1fd76d488179580d37f31ee11948f4932aed31fd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 24 14:49:34 2008 +0200 + + Added more Multi-Block Stream test files. + +commit 6e27b1098a28f4ce09bfa6df68ad94182dfc2936 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 24 00:46:05 2008 +0200 + + Added bunch of test files containing Multi-Block Streams. + +commit db9df0a9609c01a00a227329fb96e983971040f5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 23:43:00 2008 +0200 + + 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. + +commit 765f0b05f6e95ed9194fb90819cee189ebbac36b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 23:38:18 2008 +0200 + + Fix a bug related to 99e12af4e2b866c011fe0106cd1e0bfdcc8fe9c6. + lzma_metadata.header_metadata_size was not properly set to + zero if the Metadata had only the Metadata Flags field. + +commit 3a7cc5c3dec7b078941f961b0393b86c418883b6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 23:35:49 2008 +0200 + + Fix decoding of Extra Records that have empty Data. + +commit e5fdec93e273855c1bcc2579b83cfb481a9a1492 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 22:02:38 2008 +0200 + + Add the trailing '\0' to lzma_extra.data as the API header + already documents. + +commit ed40dc5a2c28a8dfccab8c165b3780738eeef93e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 21:21:21 2008 +0200 + + Added debug/full_flush.c. + +commit ae0cd09a666a1682da8fc09487322227679e218d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 21:05:33 2008 +0200 + + 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. + +commit 0e80ded13dfceb98f9494cbb5381a95eb44d03db +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 20:05:01 2008 +0200 + + Added bad-single-none-footer_filter_flags.lzma and + bad-single-none-too_long_vli.lzma. + +commit 8c8eb14055d8dd536b1b1c58fb284d34bb8ed1dd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 13:42:35 2008 +0200 + + Fixed a typo. + +commit 980f65a9a10160c4d105767871e3002b9aaba3e0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 13:40:45 2008 +0200 + + Fix a memory leak in the Subblock encoder. + +commit 99e12af4e2b866c011fe0106cd1e0bfdcc8fe9c6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 13:36:07 2008 +0200 + + 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. + +commit 58b78ab20c1bcced45cf71ae6684868fc90b4b81 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 13:15:55 2008 +0200 + + Fix a memory leak in metadata_decoder.c. + +commit 4d8cdbdab44400fd98f0f18a0f701e27cd1acdae +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 13:13:58 2008 +0200 + + Fix the fix 863028cb7ad6d8d0455fa69348f56b376d7b908f which + just moved to problem. Now it's really fixed. + +commit 67321de963ccf69410b3868b8e31534fe18a90de +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 00:21:04 2008 +0200 + + Take advantage of return_if_error() macro in + lzma_info_metadata_set() in info.c. + +commit 863028cb7ad6d8d0455fa69348f56b376d7b908f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 23 00:18:32 2008 +0200 + + Fixed a dangling pointer that caused invalid free(). + +commit cf49f42a6bd40143f54a6b10d6e605599e958c0b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 22 22:49:24 2008 +0200 + + 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. + +commit 1747b85a43abc1c3f152dbd349be2ef4089ecf6a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 22 21:16:22 2008 +0200 + + Fix Multi-Block Stream encoder's EOPM usage. + +commit 0ed6f1adcea540fb9593ca115d36de537f7f0dc6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 22 00:15:11 2008 +0200 + + Made lzma_extra pointers const in lzma_options_stream. + +commit 305afa38f64c75af8e81c4167e2d8fa8d85b53a4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 20 20:15:21 2008 +0200 + + Updated debug/sync_flush.c. + +commit d53e9b77054cfade6a643e77d085273a348b189c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 20 20:14:26 2008 +0200 + + Added debug/repeat.c. + +commit 107259e306bcfc2336a0fb870fb58034c28faa52 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 20 20:12:58 2008 +0200 + + 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. + +commit e141fe18950400faaa3503ff88ac20eacd73e88c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 19 21:16:33 2008 +0200 + + 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. + +commit 23c227a864a3b69f38c6a74306161d4e6918d1cc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 19 15:19:21 2008 +0200 + + 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. + +commit 61dc82f3e306b25ce3cd3d529df9ec7a0ec04b73 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 18 20:18:08 2008 +0200 + + 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. + +commit 0ae3208db94585eb8294b97ded387de0a3a07646 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 18 20:13:00 2008 +0200 + + Added test files to test usage of flush marker in LZMA. + +commit ab5feaf1fcc146ef9fd39360c53c290bec39524e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 18 20:02:52 2008 +0200 + + 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. + +commit 079c4f7fc26b3d0b33d9ae7536697b45f3b73585 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 18 17:21:24 2008 +0200 + + Don't add -g to CFLAGS when --enable-debug is specified. + It's the job of the user to put that in CFLAGS. + +commit 61d1784d8f1761d979a6da6e223e279ca33815e6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 18 14:17:37 2008 +0200 + + 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. + +commit c9cba976913e55ff9aac8a8133cc94416c7c1c9c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 18 00:50:29 2008 +0200 + + 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. + +commit 33be3c0e24d8f43376ccf71cc77d53671e792f07 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 17 18:56:53 2008 +0200 + + 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. + +commit b254bd97b1cdb68d127523d91ca9e054ed89c4fd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 17 17:39:42 2008 +0200 + + 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. + +commit 8f5794c8f1a30e8e3b524b415bbe81af2e04c64a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 17 17:27:45 2008 +0200 + + Added --delta to the output of "lzma --help". + +commit f88590e0014b38d40465937c19f25f05f16c79ae +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 17 13:14:20 2008 +0200 + + 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. + +commit bc0b945ca376e333077644d2f7fd54c2848aab8a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 16 16:33:37 2008 +0200 + + Tiny non-technical edits to file-format.txt. + +commit 7599bb7064ccf007f054595dedda7927af868252 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 16 14:48:04 2008 +0200 + + Plugged a memory leak in stream_decoder.c. + +commit 0b581539311f3712946e81e747839f8fb5f441a7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 16 14:47:27 2008 +0200 + + Added memory leak detection to lzmadec.c. + +commit 5b5b13c7bb8fde6331064d21f3ebde41072480c4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 16 14:46:50 2008 +0200 + + Added lzma_memlimit_count(). + +commit 19389f2b82ec54fd4c847a18f16482e7be4c9887 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 16 14:31:44 2008 +0200 + + Added ARRAY_SIZE(array) macro. + +commit 9bc33a54cbf83952130adbcb1be32c6882485416 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 16 13:27:03 2008 +0200 + + Make Uncompresed Size validation more strict + in alone_decoder.c. + +commit 01d71d60b79027e1ce3eb9c79ae5191e1407c883 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 17:46:59 2008 +0200 + + Free the allocated memory in lzmadec if debugging is + enabled. This should make it possible to detect possible + memory leaks with Valgrind. + +commit 8235e6e5b2878f76633afcda9a334640db503ef5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 16:25:38 2008 +0200 + + Fix memory leaks from test_block_header.c. + +commit f10fc6a69d40b6d5c9cfbf8d3746f49869c2e2f6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 14:23:35 2008 +0200 + + Use fastpos.h when encoding LZMA dictionary size in + Filter Flags encoder. + +commit e5728142a2048979f5c0c2149ce71ae952a092e1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 14:02:22 2008 +0200 + + 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. + +commit 10437b5b567f6a025ff16c45a572e417a0a9cc26 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 13:32:13 2008 +0200 + + Added bsr.h. + +commit f3c88e8b8d8dd57f4bba5f0921eebf276437c244 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 13:29:14 2008 +0200 + + Fixed assembler detection in configure.ac, and added + detection for x86_64. + +commit 54ec204f58287f50d3976288295da4188a19192b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 12:20:41 2008 +0200 + + Omit invalid space from printf() format string + in price_table_gen.c. + +commit 01b4b19f49f00e17a0f9cb8754c672ac0847b6e1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 09:54:34 2008 +0200 + + Removed a few unused macros from lzma_common.h. + +commit 19bd7f3cf25e4ff8487ef7098ca4a7b58681961d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 08:37:42 2008 +0200 + + Fix a typo in lzma_encoder.c. + +commit 9f9b1983013048f2142e8bc7e240149d2687bedc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 08:36:25 2008 +0200 + + Convert bittree_get_price() and bittree_reverse_get_price() + from macros to inline functions. + +commit 78e85cb1a7667c54853670d2eb09d754bcbda87d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 07:44:59 2008 +0200 + + Fix CRC code in case --enable-small is used. + +commit 949d4346e2d75bcd9dcb66c394d8d851d8db3aa0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 07:41:39 2008 +0200 + + Fix typo in test_index.c. + +commit d13d693155c176fc9e9ad5c50d48ccba27c2d9c6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 15 07:40:21 2008 +0200 + + Added precomputed range coder probability price table. + +commit 362dc3843b373c1007a50a4719f378981f18ae03 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 14 13:42:43 2008 +0200 + + Remove RC_BUFFER_SIZE from lzma_encoder_private.h + and replace it with a sanity check. + +commit e22b37968d153683fec61ad37b6b160cb7ca4ddc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 14 13:39:54 2008 +0200 + + 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. + +commit b59ef3973781f892c0a72b5e5934194567100be5 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 14 13:34:29 2008 +0200 + + Added one assert() to process.c of the command line tool. + +commit 9547e734a00ddb64c851fa3f116e4f9e7d763ea7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 14 12:09:52 2008 +0200 + + Don't use coder->lz.stream_end_was_reached in assertions + in match_c.h. + +commit 3e09e1c05871f3757f759b801890ccccc9286608 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 14 12:08:02 2008 +0200 + + 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. + +commit a670fec8021e5962429689c194148a04c3418872 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 14 11:56:41 2008 +0200 + + Small LZMA_SYNC_FLUSH fixes to Block and Single-Stream encoders. + +commit 3599dba9570a6972a16b6398d6c838e9b420e985 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 14 11:54:56 2008 +0200 + + More fixes to LZMA decoder's flush marker handling. + +commit f73c2ab6079ed5675a42b39d584a567befbd4624 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Jan 10 17:13:42 2008 +0200 + + Eliminate lzma_lz_encoder.must_move_pos. It's needed + only in one place which isn't performance criticial. + +commit 382808514a42b2f4b4a64515e2dfb3fc1bc48ecd +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 9 20:05:57 2008 +0200 + + Define HAVE_ASM_X86 when x86 assembler optimizations are + used. This #define will be useful for inline assembly. + +commit 0e70fbe4032351aab13a1cd8e5deced105c0b276 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Wed Jan 9 12:06:46 2008 +0200 + + Added good-single-none-empty_3.lzma and + bad-single-none-empty.lzma. + +commit 379fbbe84d922c7cc00afa65c6f0c095da596b19 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 23:11:59 2008 +0200 + + Take advantage of return_if_error() in block_decoder.c. + +commit 97d5fa82077e57815dfad995dc393c2809a78539 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 23:10:57 2008 +0200 + + Updated tests/files/README. + +commit 3bb9bb310936cba6a743b4f06739a397dec7c28f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 23:05:40 2008 +0200 + + Added test files with empty Compressed Data. + +commit 7054c5f5888ac6a7178cd43dc9583ce6c7e78c9f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 22:58:42 2008 +0200 + + Fix decoding of Blocks that have only Block Header. + +commit 753e4d95cd1cf29c632dfe1a670af7c67aeffbf4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 22:27:46 2008 +0200 + + Added good-single-subblock_implicit.lzma. + +commit faeac7b7aca75f86afed1e7cc06279d9d497c627 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 18:50:30 2008 +0200 + + Disable CRC32 from Block Headers when --check=none + has been specified. + +commit a751126dbb656767ed4666cf0e5d3e17349d93d1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 13:36:29 2008 +0200 + + Fixed encoding of empty files. Arguments to is_size_valid() + were in wrong order in block_encoder.c. + +commit 9080267603b1006c4867c823307dca9df8be0d20 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 13:35:36 2008 +0200 + + Added a few test files. + +commit b4943ccf73b64fc93a90a23474509c316f55eb2b +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 12:29:58 2008 +0200 + + Avoid using ! in test_files.sh, because that doesn't work + with some ancient /bin/sh versions. + +commit e2417b2b9134f3f65e14b61e23cd3644d8954353 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Jan 8 00:48:30 2008 +0200 + + More pre-C99 inttypes.h compatibility fixes. Now the code + should work even if the system has no inttypes.h. + +commit 5d227e51c23639423f4ade06aabb54e131f8505e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 23:25:32 2008 +0200 + + Updated fi.po although it's currently pretty much crap. + +commit c7189d981a1b27c63da0c1ee80d9b5cd8ce1733d +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 23:14:25 2008 +0200 + + 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. + +commit 3dbbea82b74bb841c995ad332a3aeca613015e10 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 21:49:41 2008 +0200 + + Added test_files.sh to tests/Makefile.am so it gets + included in the tarball with "make dist". + +commit 2fd2d181543feab1b4003f3ac6e85625fbee04f0 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 18:22:24 2008 +0200 + + Cosmetic edit to test_files.sh. + +commit 9a71d573100a990ceb30ce0bec6a9a15d795605f +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 18:09:44 2008 +0200 + + Added tests/files/README. + +commit 47f48fe9936ed72617a60fbd015df7e0e47a1e43 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 14:20:57 2008 +0200 + + Tell in COPYING that everything in tests/files is + public domain. + +commit 3502b3e1d00251d3c8dda96079440705c28d8225 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 14:19:05 2008 +0200 + + Cleaned up the tests/files directory. + +commit 908b2ac604b9940369d7fe8a45e9eb6da5d2a24c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 13:49:19 2008 +0200 + + Added test_files.sh to test decoding of the files in + the tests/files directory. It doesn't test the malicious + files yet. + +commit ecb2a6548f5978022a8fa931719dc575f5fd3bf6 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 11:23:13 2008 +0200 + + Updated README regarding the assembler optimizations. + +commit eacb8050438d3e6146c86eb9732d3fb1ef1825cb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Jan 7 10:58:00 2008 +0200 + + Updated THANKS. + +commit 1239649f96132b18e3b7e2dd152ecf53a195caa8 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 6 21:47:17 2008 +0200 + + Cosmetic changes to configure.ac. + +commit 88ee301ec2e4506a30ec7ac9aaa2288e2dcadd0e +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 6 19:46:38 2008 +0200 + + 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. + +commit c15a7abf66e3a70792f7444115e484c7981c8284 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 6 19:45:27 2008 +0200 + + With printf(), use PRIu64 with a cast to uint64_t instead + of %zu, because some pre-C99 libc versions don't support %zu. + +commit 4e7e54c4c522ab2f6a7abb92cefc4f707e9568fb +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Jan 6 16:27:41 2008 +0200 + + 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. + +commit a71864f77dfb76b5d78a270641539947c312583a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 5 19:57:00 2008 +0200 + + Fix typo in comment (INT64_MAX -> UINT64_MAX). + +commit 072927905a3b66281c6311b4b351caa501d8b73a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 5 19:42:04 2008 +0200 + + Rearranged testing of GCC-specific flags. + +commit d160ee32598c6d1cd9054ef019e8c9331208b188 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sat Jan 5 01:20:24 2008 +0200 + + Another bug fix for flush marker detection. + +commit fc67f79f607cbfa78c6f47a69dec098d8659b162 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 4 21:37:01 2008 +0200 + + Fix stupid bugs in flush marker detection. + +commit 0029cbbabe87d491fc046a55a629a6d556010baa +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 4 21:30:33 2008 +0200 + + 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. + +commit bbfd1f6ab058a7e661545205befcb7f70c5685ab +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Jan 4 20:45:05 2008 +0200 + + 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. + +commit 5db745cd2a74f6ed2e52f5c716c08ed0daf17ebc +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Dec 14 11:15:21 2007 +0200 + + Added a note to README that --disable-assembler + must be used on Darwin. + +commit 44b333d4615b5aabc557a0e1b6bb0096da3fae24 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Dec 14 10:07:10 2007 +0200 + + 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. + +commit ec1c82b2e82f395f6e8e19ac212a639644330cd7 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Dec 14 09:59:05 2007 +0200 + + Fixed wrong symbol name in crc64_x86.s. + +commit 2881570df6803eed2fe550af34574e8e61794804 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Fri Dec 14 09:53:24 2007 +0200 + + Use .globl instead of .global in x86 assembler code for + better portability. Still needs fixing the commenting. + +commit 698470b8f33fc0e5f27dafa93b39b6dd5dde5a66 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Thu Dec 13 20:14:37 2007 +0200 + + 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. + +commit 918bcb0e0728d2d976621e9f35b56f224f11d989 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 11 17:08:04 2007 +0200 + + Removed uncompressed size tracking from Delta encoder too. + +commit 3e16d51dd645667b05ff826665b1fc353aa41cd9 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 11 16:49:19 2007 +0200 + + 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. + +commit 5286723e0d1ac386d5b07f08d78e61becf895a5a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 11 14:10:53 2007 +0200 + + 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. + +commit ce8b036a6c7a43b290356b673d953f6d76b2be64 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 11 14:09:35 2007 +0200 + + Fixed a typo in tests/Makefile.am which prevented + building the tests if gnulib was needed. + +commit 7c1ad41eb611ed89e5bb8792a3beb533b7aa59f4 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Tue Dec 11 11:18:58 2007 +0200 + + Fixed wrong type of flags_size in Subblock encoder. + +commit ce64df716243fdc40359090d1f6541f3a4f5f21a +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 10 20:44:16 2007 +0200 + + Bumped version number to 4.42.3alpha. + +commit b499a0403ea5c41d6a25b40275eb6c57643052ce +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Mon Dec 10 15:02:50 2007 +0200 + + Disabled some unneeded warnings and made "make dist" work. + +commit 2ab8adb5165a0b77114a7eb21f9ff1e6a266f172 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Dec 9 21:43:15 2007 +0200 + + Added LZMA_SYNC_FLUSH support to the Copy filter. + +commit 329c272d501e88793dda5540358d55c12428d194 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Dec 9 17:14:07 2007 +0200 + + Added missing LZMA_API to the C versions of the CRC functions. + The x86 assembler versions were already OK. + +commit c90daf86ce683fa8cf80491d624ffb158dfbd9d7 +Author: Jim Meyering <meyering@redhat.com> +Date: Sun Dec 9 15:34:25 2007 +0100 + + * tests/test_block_header.c (test3): Remove duplicate initializer. + +commit 07ac881779a8477f2c1ab112b91a129e24aa743c +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Dec 9 17:06:45 2007 +0200 + + Take advantage of return_if_error() macro in more places. + Cleaned Subblock filter's initialization code too. + +commit 41338717964f510ee61d70b25bd4c502ec9f77cf +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Dec 9 12:13:01 2007 +0200 + + Added a bunch of .lzma test files. + +commit ff946ceb7975d4f11950afd33f6315b4d20d1a03 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Dec 9 11:24:48 2007 +0200 + + Re-enabled the security checks in Subblock decoder + that were disabled for debugging reasons. + +commit 2bf36d22d2c24ac3f488e63b35564fa2f6dab8d1 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Dec 9 11:03:28 2007 +0200 + + Fixed the tests to build with -Werror. + +commit 5d018dc03549c1ee4958364712fb0c94e1bf2741 +Author: Lasse Collin <lasse.collin@tukaani.org> +Date: Sun Dec 9 00:42:33 2007 +0200 + + Imported to git. diff --git a/README b/README new file mode 100644 index 000000000000..6b695d5ccdb8 --- /dev/null +++ b/README @@ -0,0 +1,218 @@ + +XZ Utils +======== + + 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. Other implementations of the .xz format + 5. Contact information + + +0. Overview +----------- + + 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. + + 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. + + 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. + + +1. Documentation +---------------- + +1.1. Overall documentation + + README This file + + 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 + + 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. + + +1.2. Documentation for command line tools + + 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. + + +1.3. Documentation for liblzma + + 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. + + 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. + + 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. + + http://zlib.net/manual.html + http://zlib.net/zlib_how.html + + +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. 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 + + +5. 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). + tukaani.org uses greylisting to reduce spam, thus when you send your + first email, it may get delayed by a few hours. In addition to that, + 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. + diff --git a/THANKS b/THANKS new file mode 100644 index 000000000000..2ffbb1e0f5f8 --- /dev/null +++ b/THANKS @@ -0,0 +1,67 @@ + +Thanks +====== + +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 + - Trent W. Buck + - David Burklund + - Marek Černocký + - Andrew Dudman + - Markus Duft + - İsmail Dönmez + - Robert Elz + - Gilles Espinasse + - Mike Frysinger + - 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 + - Jim Meyering + - Rafał Mużyło + - Adrien Nader + - Hongbo Ni + - Jonathan Nieder + - Igor Pavlov + - Elbert Pol + - Mikko Pouru + - Robert Readman + - Bernhard Reutner-Fischer + - Christian von Roques + - Jukka Salmi + - Alexandre Sauvé + - 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 in the Tukaani project. + +I have probably forgot to add some names to the above list. Sorry about +that and thanks for your help. + @@ -0,0 +1,60 @@ + +XZ Utils To-Do List +=================== + +Known bugs +---------- + + The test suite is too incomplete. + + 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 code to detect number of CPU cores doesn't count hyperthreading + as multiple cores. In context of xz, it probably should. + Hyperthreading is good at least with p7zip. + + XZ Utils compress some files significantly worse than LZMA Utils. + This is due to faster compression presets used by XZ Utils, and + can be worked around by using "xz --extreme". However, the presets + need some tweaking and maybe this issue can be minimized without + making the typical case too much slower. + + xz doesn't quote unprintable characters when it displays file names + given on the command line. + + tuklib_exit() doesn't block signals => EINTR is possible. + + +Missing features +---------------- + + xz doesn't support copying extended attributes, access control + lists etc. from source to target file. + + Multithreaded compression + + Multithreaded decompression + + Buffer-to-buffer coding could use less RAM (especially when + decompressing LZMA1 or LZMA2). + + I/O library is not implemented. It will possibly be named libzzf. + + lzma_strerror() to convert lzma_ret to human readable form? + This is tricky, because the same error codes are used with + slightly different meanings. + + +Documentation +------------- + + 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. + + Document the LZMA1 and LZMA2 algorithms. + diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 000000000000..841618abade8 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1 @@ +cs diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 000000000000..dc19bc963132 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,46 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# Although you may need slightly wider terminal than 80 chars, it is +# much nicer to edit the output of --help when this is set. +XGETTEXT_OPTIONS += --no-wrap +MSGMERGE += --no-wrap diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 000000000000..ee430c5c3abe --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,10 @@ +# List of source files which contain translatable strings. +src/xz/args.c +src/xz/coder.c +src/xz/file_io.c +src/xz/hardware.c +src/xz/main.c +src/xz/message.c +src/xz/options.c +src/xz/suffix.c +src/xz/util.c diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 000000000000..a953fd382969 --- /dev/null +++ b/po/cs.po @@ -0,0 +1,636 @@ +msgid "" +msgstr "" +"Project-Id-Version: xz-utils\n" +"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" +"POT-Creation-Date: 2009-12-04 16:04+0100\n" +"PO-Revision-Date: 2009-12-05 13:51+0100\n" +"Last-Translator: Marek Černocký <marek@manet.cz>\n" +"Language-Team: Czech <diskuze@lists.l10n.cz>\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:306 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Neznámý typ formátu souboru" + +#: src/xz/args.c:329 src/xz/args.c:337 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Neznámý typ kontroly integrity" + +#: src/xz/args.c:355 +msgid "Only one file can be specified with `--files'or `--files0'." +msgstr "" +"Můžete zadat pouze jeden soubor spolu s přepínači „--files“ nebo „--files0“" + +#: src/xz/args.c:413 +msgid "The environment variable XZ_OPT contains too many arguments" +msgstr "Proměnná prostředí XZ_OPT 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 +#, c-format +msgid "" +"Memory usage limit (%<PRIu64> MiB) is too small for the given filter setup (%" +"<PRIu64> MiB)" +msgstr "" +"Omezení použitelné paměti (%<PRIu64> MiB) je příliš malé pro dané nastavení " +"filtru (%<PRIu64> MiB)" + +#: src/xz/coder.c:128 +msgid "Using a preset in raw mode is discouraged." +msgstr "Použití přednastavení v režimu raw je nevhodné." + +#: src/xz/coder.c:130 +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:158 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Formát .lzma podporuje pouze filtr LZMA1" + +#: src/xz/coder.c:166 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 nelze použít s formátem .xz" + +#: src/xz/coder.c:186 +#, c-format +msgid "%s MiB (%s B) of memory is required per thread, limit is %s MiB (%s B)" +msgstr "" +"Je vyžadováno %s MiB (%s B) paměti pro každé vlákno, limit je %s MiB (%s B)" + +#: src/xz/coder.c:554 +#, c-format +msgid "Limit was %s MiB, but %s MiB would have been needed" +msgstr "Limit byl %s MiB, ale bylo by zapotřebí %s MiB" + +#: src/xz/file_io.c:113 +#, c-format +msgid "%s: File seems to be moved, not removing" +msgstr "%s: Vypadá to, že soubor byl přesunut, neodstraní se" + +#: src/xz/file_io.c:120 src/xz/file_io.c:527 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Nelze odstranit: %s" + +#: src/xz/file_io.c:145 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Nelze nastavit vlastníka souboru: %s" + +#: src/xz/file_io.c:151 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Nelze nastavit skupinu souboru: %s" + +#: src/xz/file_io.c:170 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Nelze nastavit oprávnění souboru: %s" + +#: src/xz/file_io.c:308 src/xz/file_io.c:387 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Jedná se o symbolický odkaz, vynechává se" + +#: src/xz/file_io.c:422 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Jedná se o složku, vynechává se" + +#: src/xz/file_io.c:429 +#, 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:446 +#, 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:453 +#, 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:460 +#, 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:644 +#, 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:655 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Selhalo zavření souboru: %s" + +#: src/xz/file_io.c:732 src/xz/file_io.c:889 +#, 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í záložního souboru: %s" + +#: src/xz/file_io.c:789 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Chyba čtení: %s" + +#: src/xz/file_io.c:847 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Chyba zápisu: %s" + +#: src/xz/main.c:76 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Chyba při čtení názvů souborů: %s" + +#: src/xz/main.c:83 +#, 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:107 +#, 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:160 +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:207 +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:841 src/xz/message.c:885 +msgid "Internal error (bug)" +msgstr "Interní chyba" + +#: src/xz/message.c:848 +msgid "Cannot establish signal handlers" +msgstr "Nelze ustanovit ovladač signálu" + +#: src/xz/message.c:857 +msgid "No integrity check; not verifying file integrity" +msgstr "Žádná kontrola integrity; integrita souboru se nebude ověřovat" + +#: src/xz/message.c:860 +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:867 +msgid "Memory usage limit reached" +msgstr "Dosaženo omezení použitelné paměti" + +#: src/xz/message.c:870 +msgid "File format not recognized" +msgstr "Formát souboru nebyl rozpoznán" + +#: src/xz/message.c:873 +msgid "Unsupported options" +msgstr "Nepodporovaná volba" + +#: src/xz/message.c:876 +msgid "Compressed data is corrupt" +msgstr "Komprimovaná data jsou poškozená" + +#: src/xz/message.c:879 +msgid "Unexpected end of input" +msgstr "Neočekávaný konec vstupu" + +#: src/xz/message.c:898 +#, c-format +msgid "%s: Filter chain:" +msgstr "%s: Omezující filtr:" + +#: src/xz/message.c:1009 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Zkuste „%s --help“ pro více informací" + +#: src/xz/message.c:1021 +#, c-format +msgid "%s MiB (%s bytes)\n" +msgstr "%s MiB (%s bajtů)\n" + +#: src/xz/message.c:1049 +#, 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:1053 +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:1057 +msgid " Operation mode:\n" +msgstr "Operační režim:\n" + +#: src/xz/message.c:1060 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about 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" + +#: src/xz/message.c:1066 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +"Modifikátory operací:\n" + +#: src/xz/message.c:1069 +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:1075 +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 záložní soubory\n" +" -S, --suffix=.SUF použít u komprimovaných souborů příponu „.SUF“\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:1083 +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:1085 +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: `crc32', `crc64' (default),\n" +" `sha256', or `none' (use with caution)" +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: „crc32“, „crc64“ (výchozí),\n" +" „sha256“ nebo „none“ (používejte s rozmyslem)" + +#: src/xz/message.c:1092 +msgid "" +" -0 .. -9 compression preset; 0-2 fast compression, 3-5 good\n" +" compression, 6-9 excellent compression; default is 6" +msgstr "" +" -0 .. -9 přednastavení komprimace; 0-2 rychlá komprimace, 3-5\n" +" dobrá komprimace, 6-9 skvělá komprimace; výchozí je 6" + +#: src/xz/message.c:1096 +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" + +#: src/xz/message.c:1101 +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" + +#: src/xz/message.c:1106 +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:1111 +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=NUM reset options to preset number NUM (0-9)\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=POČ obnovení voleb na přednastavený POČet (0-" +"9)\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=POČ příznivá délka shody (2-273; 64)\n" +" mf=NÁZEV vyhledávač shod (hc3, hc4, bt2, bt3, " +"bt4;\n" +" bt4)\n" +" depth=POČ maximální hloubka prohledávání;\n" +" 0=automaticky (výchozí)" + +#: src/xz/message.c:1126 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA64 (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\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:1138 +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:1146 +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)" + +#: src/xz/message.c:1155 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Ostatní přepínače:\n" + +#: src/xz/message.c:1158 +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:1163 +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:1165 +msgid "" +" --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot použít strojově analyzovatelné zprávy (užitečné pro " +"skripty)" + +#: src/xz/message.c:1168 +msgid " --info-memory display the memory usage limit and exit" +msgstr " --info-memory zobrazit omezení využití paměti a skončit" + +#: src/xz/message.c:1170 +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:1174 +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:1179 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version zobrazit číslo verze a skončit" + +#: src/xz/message.c:1181 +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" + +#: src/xz/message.c:1185 +#, c-format +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 " + +#: src/xz/message.c:1187 +msgid "" +"one thread.\n" +"\n" +msgstr "" +"jedno vlákno.\n" +"\n" + +#: src/xz/message.c:1192 +#, 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:1194 +#, 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:308 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Nepodporované přednastavení LZMA1/LZMA2: %s" + +#: src/xz/options.c:426 +msgid "The sum of lc and lp must be at maximum of 4" +msgstr "Součet lc a lp musí být maximálně 4" + +#: src/xz/options.c:431 +#, 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 --format=raw je vyžadováno --sufix=.SUF, 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:53 +#, 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:95 +#, c-format +msgid "%s: Invalid multiplier suffix. Valid suffixes:" +msgstr "%s: Neplatná přípona. Platné přípony jsou:" + +#: src/xz/util.c:115 +#, 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:212 +msgid "Empty filename, skipping" +msgstr "Prázdný název souboru, vynechává se" + +#: src/xz/util.c:226 +msgid "Compressed data not read from a terminal unless `--force' is used." +msgstr "" +"Komprimovaná data se nečtou z terminálu, vyjma použití volby „--force“." + +#: src/xz/util.c:239 +msgid "Compressed data not written to a terminal unless `--force' is used." +msgstr "" +"Komprimovaná data se nezapisují do terminálu, vyjma použití volby „--force“." diff --git a/src/common/mythread.h b/src/common/mythread.h new file mode 100644 index 000000000000..476c2fc9e103 --- /dev/null +++ b/src/common/mythread.h @@ -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 diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h new file mode 100644 index 000000000000..97a1c045cfb0 --- /dev/null +++ b/src/common/sysdefs.h @@ -0,0 +1,171 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file sysdefs.h +/// \brief Common includes, definitions, system-specific things etc. +/// +/// This file is used also by the lzma command line tool, that's why this +/// file is separate from common.h. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_SYSDEFS_H +#define LZMA_SYSDEFS_H + +////////////// +// Includes // +////////////// + +#ifdef HAVE_CONFIG_H +# include <config.h> +#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 + +#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 +#else +# ifndef UINT64_C +# define UINT64_C(n) n ## UL +# endif +# ifndef PRIu64 +# define PRIu64 "lu" +# 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 sizeof(size_t) is not 32-bit or 64-bit +# endif +#endif +#if SIZE_MAX != UINT32_MAX && SIZE_MAX != UINT64_MAX +# error sizeof(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 +# if ! HAVE__BOOL +typedef unsigned char _Bool; +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +#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 + +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif + +#ifdef HAVE_MEMORY_H +# include <memory.h> +#endif + + +//////////// +// Macros // +//////////// + +#undef memzero +#define memzero(s, n) memset(s, 0, n) + +#ifndef MIN +# define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + +#ifndef MAX +# define MAX(x, y) ((x) > (y) ? (x) : (y)) +#endif + +#ifndef ARRAY_SIZE +# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) +#endif + +#endif diff --git a/src/common/tuklib_common.h b/src/common/tuklib_common.h new file mode 100644 index 000000000000..31fbab58b005 --- /dev/null +++ b/src/common/tuklib_common.h @@ -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 diff --git a/src/common/tuklib_config.h b/src/common/tuklib_config.h new file mode 100644 index 000000000000..549cb24d7738 --- /dev/null +++ b/src/common/tuklib_config.h @@ -0,0 +1,7 @@ +#ifdef HAVE_CONFIG_H +# include "sysdefs.h" +#else +# include <stddef.h> +# include <inttypes.h> +# include <limits.h> +#endif diff --git a/src/common/tuklib_cpucores.c b/src/common/tuklib_cpucores.c new file mode 100644 index 000000000000..e35d9bc74d9a --- /dev/null +++ b/src/common/tuklib_cpucores.c @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \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> +#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 = (uint32_t)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 = (uint32_t)cpus; +#endif + + return ret; +} diff --git a/src/common/tuklib_cpucores.h b/src/common/tuklib_cpucores.h new file mode 100644 index 000000000000..be1ce1c175ae --- /dev/null +++ b/src/common/tuklib_cpucores.h @@ -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 diff --git a/src/common/tuklib_exit.c b/src/common/tuklib_exit.c new file mode 100644 index 000000000000..c393be64d754 --- /dev/null +++ b/src/common/tuklib_exit.c @@ -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); +} diff --git a/src/common/tuklib_exit.h b/src/common/tuklib_exit.h new file mode 100644 index 000000000000..b11776f0e5bf --- /dev/null +++ b/src/common/tuklib_exit.h @@ -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 diff --git a/src/common/tuklib_gettext.h b/src/common/tuklib_gettext.h new file mode 100644 index 000000000000..248521347ab0 --- /dev/null +++ b/src/common/tuklib_gettext.h @@ -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) +# define N_(msgid1, msgid2, n) ngettext(msgid1, msgid2, n) +#else +# define tuklib_gettext_init(package, localedir) \ + setlocale(LC_ALL, "") +# define _(msgid) (msgid) +# define N_(msgid1, msgid2, n) ((n) == 1 ? (msgid1) : (msgid2)) +#endif + +#endif diff --git a/src/common/tuklib_integer.h b/src/common/tuklib_integer.h new file mode 100644 index 000000000000..e6daa772d588 --- /dev/null +++ b/src/common/tuklib_integer.h @@ -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 diff --git a/src/common/tuklib_open_stdxxx.c b/src/common/tuklib_open_stdxxx.c new file mode 100644 index 000000000000..08bc60d8cf87 --- /dev/null +++ b/src/common/tuklib_open_stdxxx.c @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_open_stdxxx.c +/// \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. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_open_stdxxx.h" + +#ifndef TUKLIB_DOSLIKE +# include <stdlib.h> +# include <errno.h> +# include <fcntl.h> +# include <unistd.h> +#endif + + +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) { + // With stdin, we could use /dev/full so that + // writing to stdin would fail. However, /dev/full + // is Linux specific, and if the program tries to + // write to stdin, there's already a problem anyway. + const int fd = open("/dev/null", O_NOCTTY + | (i == 0 ? O_WRONLY : O_RDONLY)); + + if (fd != i) { + // Something went wrong. Exit with the + // exit status we were given. Don't try + // to print an error message, since stderr + // may very well be non-existent. This + // error should be extremely rare. + (void)close(fd); + exit(err_status); + } + } + } +#endif + + return; +} diff --git a/src/common/tuklib_open_stdxxx.h b/src/common/tuklib_open_stdxxx.h new file mode 100644 index 000000000000..b91161609ee6 --- /dev/null +++ b/src/common/tuklib_open_stdxxx.h @@ -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 diff --git a/src/common/tuklib_physmem.c b/src/common/tuklib_physmem.c new file mode 100644 index 000000000000..1536e6e5da1c --- /dev/null +++ b/src/common/tuklib_physmem.c @@ -0,0 +1,165 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \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> + +#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> + +// 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_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_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; +} diff --git a/src/common/tuklib_physmem.h b/src/common/tuklib_physmem.h new file mode 100644 index 000000000000..09e2a51338ae --- /dev/null +++ b/src/common/tuklib_physmem.h @@ -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 diff --git a/src/common/tuklib_progname.c b/src/common/tuklib_progname.c new file mode 100644 index 000000000000..7cb7e203dd9d --- /dev/null +++ b/src/common/tuklib_progname.c @@ -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; +} diff --git a/src/common/tuklib_progname.h b/src/common/tuklib_progname.h new file mode 100644 index 000000000000..791b12517e59 --- /dev/null +++ b/src/common/tuklib_progname.h @@ -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 diff --git a/src/liblzma/api/lzma.h b/src/liblzma/api/lzma.h new file mode 100644 index 000000000000..5be9b4e31558 --- /dev/null +++ b/src/liblzma/api/lzma.h @@ -0,0 +1,326 @@ +/** + * \file api/lzma.h + * \brief The public API of liblzma data compression library + * + * 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. + * + * 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. + * + * Major parts of liblzma are based on Igor Pavlov's public domain LZMA SDK + * <http://7-zip.org/sdk.html>. + * + * 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 + +/***************************** + * Required standard headers * + *****************************/ + +/* + * 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 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++. + */ + +#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> + + /* + * 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 */ + + +/****************** + * LZMA_API macro * + ******************/ + +/* + * 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 __GNUC__ >= 3 +# ifndef lzma_attribute +# define lzma_attribute(attr) __attribute__(attr) +# endif + +# ifndef lzma_restrict +# define lzma_restrict __restrict__ +# endif + + /* 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 +# if __STDC_VERSION__ >= 199901L +# define lzma_restrict restrict +# else +# define lzma_restrict +# endif +# 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 + + +/************** + * Subheaders * + **************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Subheaders check that this is defined. It is to prevent including + * them directly from applications. + */ +#define LZMA_H_INTERNAL 1 + +/* Basic features */ +#include "lzma/version.h" +#include "lzma/base.h" +#include "lzma/vli.h" +#include "lzma/check.h" + +/* Filters */ +#include "lzma/filter.h" +#include "lzma/subblock.h" +#include "lzma/bcj.h" +#include "lzma/delta.h" +#include "lzma/lzma.h" + +/* Container formats */ +#include "lzma/container.h" + +/* Advanced features */ +#include "lzma/stream_flags.h" +#include "lzma/block.h" +#include "lzma/index.h" +#include "lzma/index_hash.h" + +/* Hardware information */ +#include "lzma/hardware.h" + +/* + * All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications + * re-including the subheaders. + */ +#undef LZMA_H_INTERNAL + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef LZMA_H */ diff --git a/src/liblzma/api/lzma/base.h b/src/liblzma/api/lzma/base.h new file mode 100644 index 000000000000..993626a4cdfd --- /dev/null +++ b/src/liblzma/api/lzma/base.h @@ -0,0 +1,596 @@ +/** + * \file lzma/base.h + * \brief Data types and functions used in many places in liblzma API + */ + +/* + * 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 + + +/** + * \brief Boolean + * + * This is here because C89 doesn't have stdbool.h. To set a value for + * variables having type lzma_bool, you can use + * - C99's `true' and `false' from stdbool.h; + * - C++'s internal `true' and `false'; or + * - integers one (true) and zero (false). + */ +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. 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, + /**< + * \brief Operation completed successfully + */ + + LZMA_STREAM_END = 1, + /**< + * \brief End of stream was reached + * + * 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_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 + * + * This indicates that the arguments given to the function are + * invalid or the internal state of the decoder is corrupt. + * - Function arguments are invalid or the structures + * pointed by the argument pointers are invalid + * e.g. if strm->next_out has been set to NULL and + * strm->avail_out > 0 when calling lzma_code(). + * - lzma_* functions have been called in wrong order + * e.g. lzma_code() was called right after lzma_end(). + * - If errors occur randomly, the reason might be flaky + * hardware. + * + * If you think that your code is correct, this error code + * can be a sign of a bug in liblzma. See the documentation + * how to report bugs. + */ +} 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 + * usually be decodeable from the output of the same + * lzma_code() call. + * + * Decoder: Decode as much input as possible and produce as + * much output as possible. + */ + + LZMA_SYNC_FLUSH = 1, + /**< + * \brief Make all the input available at output + * + * 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. + * + * 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. + * + * 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. + * + * Decoders don't support LZMA_SYNC_FLUSH. + */ + + LZMA_FULL_FLUSH = 2, + /**< + * \brief Make all the input available at output + * + * Finish encoding of the current Block. 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 + /**< + * \brief Finish the coding operation + * + * Finishes the coding 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. 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; + + +/** + * \brief Custom functions for memory handling + * + * A pointer to lzma_allocator may be passed via lzma_stream structure + * 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 + * process, but obviously it must be done carefully to make sure that the + * replacement `free' can deallocate memory allocated by the earlier + * `alloc' function(s). + */ +typedef struct { + /** + * \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, 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' 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 *(LZMA_API_CALL *alloc)(void *opaque, size_t nmemb, size_t size); + + /** + * \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 + * by the standard malloc(). + */ + void (LZMA_API_CALL *free)(void *opaque, void *ptr); + + /** + * \brief Pointer passed to .alloc() and .free() + * + * opaque is passed as the first argument to lzma_allocator.alloc() + * and lzma_allocator.free(). This intended to ease implementing + * custom memory allocation functions for use with liblzma. + * + * If you don't need this, you should set this to NULL. + */ + void *opaque; + +} lzma_allocator; + + +/** + * \brief Internal data structure + * + * The contents of this structure is not visible outside the library. + */ +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. + * + * Typical usage: + * + * - After allocating lzma_stream (on stack or with malloc()), it must be + * initialized to LZMA_STREAM_INIT (see LZMA_STREAM_INIT for details). + * + * - 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. + * + * - 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 aren't used for anything else. + */ +typedef struct { + 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. */ + + uint8_t *next_out; /**< Pointer to the next output position. */ + size_t avail_out; /**< Amount of free space in next_out. */ + uint64_t total_out; /**< Total number of bytes written by liblzma. */ + + /** + * \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 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; + uint64_t reserved_int1; + uint64_t reserved_int2; + 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 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, \ + NULL, NULL, 0, 0, LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM } + + +/** + * \brief Encode or decode data + * + * Once the lzma_stream has been successfully initialized (e.g. with + * 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. + * + * See the description of the coder-specific initialization function to find + * out what `action' values are supported by the coder. + */ +extern LZMA_API(lzma_ret) lzma_code(lzma_stream *strm, lzma_action action) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \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 structure. liblzma doesn't do this, and assumes that + * application knows what it is doing. + */ +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 Rough estimate of 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; diff --git a/src/liblzma/api/lzma/bcj.h b/src/liblzma/api/lzma/bcj.h new file mode 100644 index 000000000000..82e4a440b218 --- /dev/null +++ b/src/liblzma/api/lzma/bcj.h @@ -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 IA64 (Itanium) binaries. + */ + +#define LZMA_FILTER_ARM LZMA_VLI_C(0x07) + /**< + * Filter for ARM binaries. + */ + +#define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08) + /**< + * Filter for ARMThumb 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; diff --git a/src/liblzma/api/lzma/block.h b/src/liblzma/api/lzma/block.h new file mode 100644 index 000000000000..8e681ed2811b --- /dev/null +++ b/src/liblzma/api/lzma/block.h @@ -0,0 +1,529 @@ +/** + * \file lzma/block.h + * \brief .xz Block handling + */ + +/* + * 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 + + +/** + * \brief Options for the Block and Block Header encoders and decoders + * + * 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 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 check; + + /** + * \brief Size of the Compressed Data in bytes + * + * 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_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_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 + * + * This is handled very similarly to compressed_size above. + * + * 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_encode() + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + lzma_vli uncompressed_size; + + /** + * \brief Array of filters + * + * 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_encode() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + * + * Written by: + * - 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_filter *filters; + + /** + * \brief Raw value stored in the Check field + * + * After successful coding, the first lzma_check_size(check) bytes + * of this array contain the raw value stored in the Check field. + * + * 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. + * + * Written by: + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + uint8_t raw_check[LZMA_CHECK_SIZE_MAX]; + + /* + * 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 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 + * 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. If you want to validate the + * filter chain, consider using lzma_memlimit_encoder() which as + * a side-effect validates the filter chain. + */ +extern LZMA_API(lzma_ret) lzma_block_header_size(lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Block Header + * + * 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 block->header_size bytes. + * \param block Block options to be encoded. + * + * \return - LZMA_OK: Encoding was successful. block->header_size + * bytes were written to output buffer. + * - 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_API(lzma_ret) lzma_block_header_encode( + const lzma_block *block, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Block Header + * + * 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 size of the Block Header must have already been decoded with + * lzma_block_header_size_decode() macro and stored to block->header_size. + * + * block->filters must have been allocated, but not necessarily 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_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 Validate and set Compressed Size according to Unpadded Size + * + * 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_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 + */ +extern LZMA_API(lzma_ret) lzma_block_encoder( + lzma_stream *strm, lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \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 ID is not supported, thus Check will be + * ignored. + * - LZMA_PROG_ERROR + * - LZMA_MEM_ERROR + */ +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; diff --git a/src/liblzma/api/lzma/check.h b/src/liblzma/api/lzma/check.h new file mode 100644 index 000000000000..6a243db0d794 --- /dev/null +++ b/src/liblzma/api/lzma/check.h @@ -0,0 +1,150 @@ +/** + * \file lzma/check.h + * \brief Integrity checks + */ + +/* + * 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 + + +/** + * \brief Type of the integrity check (Check ID) + * + * 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, + /**< + * No Check is calculated. + * + * Size of the Check field: 0 bytes + */ + + LZMA_CHECK_CRC32 = 1, + /**< + * CRC32 using the polynomial from the IEEE 802.3 standard + * + * Size of the Check field: 4 bytes + */ + + LZMA_CHECK_CRC64 = 4, + /**< + * CRC64 using the polynomial from the ECMA-182 standard + * + * Size of the Check field: 8 bytes + */ + + LZMA_CHECK_SHA256 = 10 + /**< + * SHA-256 + * + * Size of the Check field: 32 bytes + */ +} lzma_check; + + +/** + * \brief Maximum valid Check ID + * + * 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 15 + + +/** + * \brief Test if the given Check ID is supported + * + * 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 LZMA_API(lzma_bool) lzma_check_is_supported(lzma_check check) + lzma_nothrow lzma_attr_const; + + +/** + * \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 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 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 + * + * 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 starting a new calculation. + * + * \return Updated CRC value, which can be passed to this function + * again to continue CRC calculation. + */ +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 + * + * Calculate CRC64 using the polynomial from the ECMA-182 standard. + * + * This function is used similarly to lzma_crc32(). See its documentation. + */ +extern LZMA_API(uint64_t) lzma_crc64( + const uint8_t *buf, size_t size, uint64_t crc) + lzma_nothrow lzma_attr_pure; + + +/* + * 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; diff --git a/src/liblzma/api/lzma/container.h b/src/liblzma/api/lzma/container.h new file mode 100644 index 000000000000..0d907650fc49 --- /dev/null +++ b/src/liblzma/api/lzma/container.h @@ -0,0 +1,404 @@ +/** + * \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-2). + */ +#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31) + + +/** + * \brief Calculate rough 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 rough 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. If you are unsure, use LZMA_CHECK_CRC32. + * + * \return - LZMA_OK: Initialization succeeded. Use lzma_code() to + * encode your data. + * - LZMA_MEM_ERROR: Memory allocation failed. + * - LZMA_OPTIONS_ERROR: The given compression level 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 Rough memory usage limit as bytes + * \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 + */ +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 Rough memory usage limit as bytes + * \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 + */ +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 + */ +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 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_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; diff --git a/src/liblzma/api/lzma/delta.h b/src/liblzma/api/lzma/delta.h new file mode 100644 index 000000000000..592fc4f8496a --- /dev/null +++ b/src/liblzma/api/lzma/delta.h @@ -0,0 +1,77 @@ +/** + * \file lzma/delta.h + * \brief Delta filter + */ + +/* + * 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 + + +/** + * \brief Filter ID + * + * Filter ID of the Delta filter. This is used as lzma_filter.id. + */ +#define LZMA_FILTER_DELTA LZMA_VLI_C(0x03) + + +/** + * \brief Type of the delta calculation + * + * Currently only byte-wise delta is supported. Other possible types could + * be, for example, delta of 16/32/64-bit little/big endian integers, but + * these are not currently planned since byte-wise delta is almost as good. + */ +typedef enum { + LZMA_DELTA_TYPE_BYTE +} lzma_delta_type; + + +/** + * \brief Options for the Delta filter + * + * These options are needed by both encoder and decoder. + */ +typedef struct { + /** For now, this must always be LZMA_DELTA_TYPE_BYTE. */ + lzma_delta_type type; + + /** + * \brief Delta distance + * + * With the only currently supported type, LZMA_DELTA_TYPE_BYTE, + * the distance is as bytes. + * + * Examples: + * - 16-bit stereo audio: distance = 4 bytes + * - 24-bit RGB image data: distance = 3 bytes + */ + uint32_t dist; +# define LZMA_DELTA_DIST_MIN 1 +# define LZMA_DELTA_DIST_MAX 256 + + /* + * 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 + * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these + * uninitialized. + */ + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + void *reserved_ptr1; + void *reserved_ptr2; + +} lzma_options_delta; diff --git a/src/liblzma/api/lzma/filter.h b/src/liblzma/api/lzma/filter.h new file mode 100644 index 000000000000..038a93398c68 --- /dev/null +++ b/src/liblzma/api/lzma/filter.h @@ -0,0 +1,421 @@ +/** + * \file lzma/filter.h + * \brief Common filter related types + */ + +/* + * 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 + + +/** + * \brief Maximum number of filters in a chain + * + * A filter chain can have 1-4 filters, of which three are allowed to change + * the size of the data. Usually only one or two filters are needed. + */ +#define LZMA_FILTERS_MAX 4 + + +/** + * \brief Filter options + * + * This structure is used to pass Filter ID and a pointer filter's + * options to liblzma. A few functions work with a single lzma_filter + * structure, while most functions expect a filter chain. + * + * A filter chain is indicated with an array of lzma_filter structures. + * The array is terminated with .id = LZMA_VLI_UNKNOWN. Thus, the filter + * array must have LZMA_FILTERS_MAX + 1 elements (that is, five) to + * be able to hold any arbitrary filter chain. This is important when + * using lzma_block_header_decode() from block.h, because too small + * array would make liblzma write past the end of the filters array. + */ +typedef struct { + /** + * \brief Filter ID + * + * Use constants whose name begin with `LZMA_FILTER_' to specify + * different filters. In an array of lzma_filter structures, use + * LZMA_VLI_UNKNOWN to indicate end of filters. + * + * \note This is not an enum, because on some systems enums + * cannot be 64-bit. + */ + lzma_vli id; + + /** + * \brief Pointer to filter-specific options structure + * + * If the filter doesn't need options, set this to NULL. If id is + * set to LZMA_VLI_UNKNOWN, options is ignored, and thus + * doesn't need be initialized. + * + * Some filters support changing the options in the middle of + * the encoding process. These filters store the pointer of the + * options structure and communicate with the application via + * modifications of the options structure. + */ + void *options; + +} lzma_filter; + + +/** + * \brief Test if the given Filter ID is supported for encoding + * + * Return true if the give Filter ID is supported for encoding by this + * liblzma build. Otherwise false is returned. + * + * There is no way to list which filters are available in this particular + * liblzma version and build. It would be useless, because the application + * couldn't know what kind of options the filter would need. + */ +extern LZMA_API(lzma_bool) lzma_filter_encoder_is_supported(lzma_vli id) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Test if the given Filter ID is supported for decoding + * + * Return true if the give Filter ID is supported for decoding by this + * liblzma build. Otherwise false is returned. + */ +extern LZMA_API(lzma_bool) lzma_filter_decoder_is_supported(lzma_vli id) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Copy the filters array + * + * Copy the Filter IDs and filter-specific options from src to dest. + * Up to LZMA_FILTERS_MAX filters are copied, plus the terminating + * .id == LZMA_VLI_UNKNOWN. Thus, dest should have at least + * LZMA_FILTERS_MAX + 1 elements space unless the caller knows that + * src is smaller than that. + * + * Unless the filter-specific options is NULL, the Filter ID has to be + * supported by liblzma, because liblzma needs to know the size of every + * filter-specific options structure. The filter-specific options are not + * validated. If options is NULL, any unsupported Filter IDs are copied + * without returning an error. + * + * Old filter-specific options in dest are not freed, so dest doesn't + * need to be initialized by the caller in any way. + * + * If an error occurs, memory possibly already allocated by this function + * is always freed. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR: Unsupported Filter ID and its options + * is not NULL. + * - LZMA_PROG_ERROR: src or dest is NULL. + */ +extern LZMA_API(lzma_ret) lzma_filters_copy(const lzma_filter *src, + lzma_filter *dest, lzma_allocator *allocator) lzma_nothrow; + + +/** + * \brief Calculate rough memory requirements for raw encoder + * + * Because the calculation is rough, this function can be used to calculate + * the memory requirements for Block and Stream encoders too. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Rough number of bytes of memory required for the given + * filter chain when encoding. + */ +extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate rough memory requirements for raw decoder + * + * Because the calculation is rough, this function can be used to calculate + * the memory requirements for Block and Stream decoders too. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Rough number of bytes of memory required for the given + * filter chain when decoding. + */ +extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize raw encoder + * + * This function may be useful when implementing custom file formats. + * + * \param strm Pointer to properly prepared lzma_stream + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * + * The `action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the + * filter chain supports it), or LZMA_FINISH. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_raw_encoder( + lzma_stream *strm, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize raw decoder + * + * The initialization of raw decoder goes similarly to raw encoder. + * + * The `action' with lzma_code() can be LZMA_RUN or LZMA_FINISH. Using + * LZMA_FINISH is not required, it is supported just for convenience. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_raw_decoder( + lzma_stream *strm, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Update the filter chain in the encoder + * + * This function is for advanced users only. This function has two slightly + * different purposes: + * + * - After LZMA_FULL_FLUSH when using Stream encoder: Set a new filter + * chain, which will be used starting from the next Block. + * + * - After LZMA_SYNC_FLUSH using Raw, Block, or Stream encoder: Change + * the filter-specific options in the middle of encoding. The actual + * filters in the chain (Filter IDs) cannot be changed. In the future, + * it might become possible to change the filter options without + * using LZMA_SYNC_FLUSH. + * + * While rarely useful, this function may be called also when no data has + * been compressed yet. In that case, this function will behave as if + * LZMA_FULL_FLUSH (Stream encoder) or LZMA_SYNC_FLUSH (Raw or Block + * encoder) had been used right before calling this function. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_filters_update( + lzma_stream *strm, const lzma_filter *filters) lzma_nothrow; + + +/** + * \brief Single-call raw encoder + * + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * \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 + * + * \note There is no function to calculate how big output buffer + * would surely be big enough. (lzma_stream_buffer_bound() + * works only for lzma_stream_buffer_encode().) + */ +extern LZMA_API(lzma_ret) lzma_raw_buffer_encode( + const lzma_filter *filters, lzma_allocator *allocator, + const uint8_t *in, size_t in_size, uint8_t *out, + size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Single-call raw decoder + * + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * \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]. + */ +extern LZMA_API(lzma_ret) lzma_raw_buffer_decode( + const lzma_filter *filters, 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; + + +/** + * \brief Get the size of the Filter Properties field + * + * This function may be useful when implementing custom file formats + * using the raw encoder and decoder. + * + * \param size Pointer to uint32_t to hold the size of the properties + * \param filter Filter ID and options (the size of the properties may + * vary depending on the options) + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + * + * \note This function validates the Filter ID, but does not + * necessarily validate the options. Thus, it is possible + * that this returns LZMA_OK while the following call to + * lzma_properties_encode() returns LZMA_OPTIONS_ERROR. + */ +extern LZMA_API(lzma_ret) lzma_properties_size( + uint32_t *size, const lzma_filter *filter) lzma_nothrow; + + +/** + * \brief Encode the Filter Properties field + * + * \param filter Filter ID and options + * \param props Buffer to hold the encoded options. The size of + * buffer must have been already determined with + * lzma_properties_size(). + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + * + * \note Even this function won't validate more options than actually + * necessary. Thus, it is possible that encoding the properties + * succeeds but using the same options to initialize the encoder + * will fail. + * + * \note It is OK to skip calling this function if + * lzma_properties_size() indicated that the size + * of the Filter Properties field is zero. + */ +extern LZMA_API(lzma_ret) lzma_properties_encode( + const lzma_filter *filter, uint8_t *props) lzma_nothrow; + + +/** + * \brief Decode the Filter Properties field + * + * \param filter filter->id must have been set to the correct + * Filter ID. filter->options doesn't need to be + * initialized (it's not freed by this function). The + * decoded options will be stored to filter->options. + * filter->options is set to NULL if there are no + * properties or if an error occurs. + * \param allocator Custom memory allocator used to allocate the + * options. Set to NULL to use the default malloc(), + * and in case of an error, also free(). + * \param props Input buffer containing the properties. + * \param props_size Size of the properties. This must be the exact + * size; giving too much or too little input will + * return LZMA_OPTIONS_ERROR. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + */ +extern LZMA_API(lzma_ret) lzma_properties_decode( + lzma_filter *filter, lzma_allocator *allocator, + const uint8_t *props, size_t props_size) lzma_nothrow; + + +/** + * \brief Calculate encoded size of a Filter Flags field + * + * Knowing the size of Filter Flags is useful to know when allocating + * memory to hold the encoded Filter Flags. + * + * \param size Pointer to integer to hold the calculated size + * \param filters Filter ID and associated options whose encoded + * size is to be calculated + * + * \return - LZMA_OK: *size set successfully. Note that this doesn't + * guarantee that filters->options is valid, thus + * lzma_filter_flags_encode() may still fail. + * - LZMA_OPTIONS_ERROR: Unknown Filter ID or unsupported options. + * - LZMA_PROG_ERROR: Invalid options + * + * \note If you need to calculate size of List of Filter Flags, + * you need to loop over every lzma_filter entry. + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_size( + uint32_t *size, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Filter Flags into given buffer + * + * In contrast to some functions, this doesn't allocate the needed buffer. + * This is due to how this function is used internally by liblzma. + * + * \param filters Filter ID and options to be encoded + * \param out Beginning of the output buffer + * \param out_pos out[*out_pos] is the next write position. This + * is updated by the encoder. + * \param out_size out[out_size] is the first byte to not write. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. + * - LZMA_PROG_ERROR: Invalid options or not enough output + * buffer space (you should have checked it with + * lzma_filter_flags_size()). + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filters, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Filter Flags from given buffer + * + * The decoded result is stored into *filters. filters->options is + * initialized but the old value is NOT free()d. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_decode( + lzma_filter *filters, lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow lzma_attr_warn_unused_result; diff --git a/src/liblzma/api/lzma/hardware.h b/src/liblzma/api/lzma/hardware.h new file mode 100644 index 000000000000..f44cb602ff90 --- /dev/null +++ b/src/liblzma/api/lzma/hardware.h @@ -0,0 +1,51 @@ +/** + * \file lzma/hardware.h + * \brief Hardware information + * + * Since liblzma can consume a lot of system resources, it also provides + * ways to limit the resource usage. Applications linking against liblzma + * need to do the actual decisions how much resources to let liblzma to use. + * To ease making these decisions, liblzma provides functions to find out + * the relevant capabilities of the underlaying hardware. Currently there + * is only a function to find out the amount of RAM, but in the future there + * will be also a function to detect how many concurrent threads the system + * can run. + * + * \note On some operating systems, these function may temporarily + * load a shared library or open file descriptor(s) to find out + * the requested hardware information. Unless the application + * assumes that specific file descriptors are not touched by + * other threads, this should have no effect on thread safety. + * Possible operations involving file descriptors will restart + * the syscalls if they return EINTR. + */ + +/* + * 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 + + +/** + * \brief Get the total amount of physical memory (RAM) in bytes + * + * This function may be useful when determining a reasonable memory + * usage limit for decompressing or how much memory it is OK to use + * for compressing. For example, the default limit used by the xz + * command line tool is 40 % of RAM. + * + * \return On success, the total amount of physical memory in bytes + * is returned. If the amount of RAM cannot be determined, + * zero is returned. This can happen if an error occurs + * or if there is no code in liblzma to detect the amount + * of RAM on the specific operating system. + */ +extern LZMA_API(uint64_t) lzma_physmem(void) lzma_nothrow; diff --git a/src/liblzma/api/lzma/index.h b/src/liblzma/api/lzma/index.h new file mode 100644 index 000000000000..8d7a799f4ab5 --- /dev/null +++ b/src/liblzma/api/lzma/index.h @@ -0,0 +1,677 @@ +/** + * \file lzma/index.h + * \brief Handling of .xz Index and related information + */ + +/* + * 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 + + +/** + * \brief Opaque data type to hold the Index(es) and other information + * + * lzma_index often holds just one .xz Index and possibly the Stream Flags + * of the same Stream and size of the Stream Padding field. However, + * multiple lzma_indexes can be concatenated with lzma_index_cat() and then + * there may be information about multiple Streams in the same lzma_index. + * + * Notes about thread safety: Only one thread may modify lzma_index at + * a time. All functions that take non-const pointer to lzma_index + * modify it. As long as no thread is modifying the lzma_index, getting + * information from the same lzma_index can be done from multiple threads + * at the same time with functions that take a const pointer to + * lzma_index or use lzma_index_iter. The same iterator must be used + * only by one thread at a time, of course, but there can be as many + * iterators for the same lzma_index as needed. + */ +typedef struct lzma_index_s lzma_index; + + +/** + * \brief Iterator to get information about Blocks and Streams + */ +typedef struct { + struct { + /** + * \brief Pointer to Stream Flags + * + * This is NULL if Stream Flags have not been set for + * this Stream with lzma_index_stream_flags(). + */ + const lzma_stream_flags *flags; + + const void *reserved_ptr1; + const void *reserved_ptr2; + const void *reserved_ptr3; + + /** + * \brief Stream number in the lzma_index + * + * The first Stream is 1. + */ + lzma_vli number; + + /** + * \brief Number of Blocks in the Stream + * + * If this is zero, the block structure below has + * undefined values. + */ + lzma_vli block_count; + + /** + * \brief Compressed start offset of this Stream + * + * The offset is relative to the beginning of the lzma_index + * (i.e. usually the beginning of the .xz file). + */ + lzma_vli compressed_offset; + + /** + * \brief Uncompressed start offset of this Stream + * + * The offset is relative to the beginning of the lzma_index + * (i.e. usually the beginning of the .xz file). + */ + lzma_vli uncompressed_offset; + + /** + * \brief Compressed size of this Stream + * + * This includes all headers except the possible + * Stream Padding after this Stream. + */ + lzma_vli compressed_size; + + /** + * \brief Uncompressed size of this Stream + */ + lzma_vli uncompressed_size; + + /** + * \brief Size of Stream Padding after this Stream + * + * If it hasn't been set with lzma_index_stream_padding(), + * this defaults to zero. Stream Padding is always + * a multiple of four bytes. + */ + lzma_vli padding; + + lzma_vli reserved_vli1; + lzma_vli reserved_vli2; + lzma_vli reserved_vli3; + lzma_vli reserved_vli4; + } stream; + + struct { + /** + * \brief Block number in the file + * + * The first Block is 1. + */ + lzma_vli number_in_file; + + /** + * \brief Compressed start offset of this Block + * + * This offset is relative to the beginning of the + * lzma_index (i.e. usually the beginning of the .xz file). + * Normally this is where you should seek in the .xz file + * to start decompressing this Block. + */ + lzma_vli compressed_file_offset; + + /** + * \brief Uncompressed start offset of this Block + * + * This offset is relative to the beginning of the lzma_index + * (i.e. usually the beginning of the .xz file). + */ + lzma_vli uncompressed_file_offset; + + /** + * \brief Block number in this Stream + * + * The first Block is 1. + */ + lzma_vli number_in_stream; + + /** + * \brief Compressed start offset of this Block + * + * This offset is relative to the beginning of the Stream + * containing this Block. + */ + lzma_vli compressed_stream_offset; + + /** + * \brief Uncompressed start offset of this Block + * + * This offset is relative to the beginning of the Stream + * containing this Block. + */ + lzma_vli uncompressed_stream_offset; + + /** + * \brief Uncompressed size of this Block + * + * You should pass this to the Block decoder if you will + * decode this Block. + * + * When doing random-access reading, it is possible that + * the target offset is not exactly at Block boundary. One + * will need to compare the target offset against + * uncompressed_file_offset or uncompressed_stream_offset, + * and possibly decode and throw away some amount of data + * before reaching the target offset. + */ + lzma_vli uncompressed_size; + + /** + * \brief Unpadded size of this Block + * + * You should pass this to the Block decoder if you will + * decode this Block. + */ + lzma_vli unpadded_size; + + /** + * \brief Total compressed size + * + * This includes all headers and padding in this Block. + * This is useful if you need to know how many bytes + * the Block decoder will actually read. + */ + lzma_vli total_size; + + lzma_vli reserved_vli1; + lzma_vli reserved_vli2; + lzma_vli reserved_vli3; + lzma_vli reserved_vli4; + + const void *reserved_ptr1; + const void *reserved_ptr2; + const void *reserved_ptr3; + const void *reserved_ptr4; + } block; + + /* + * Internal data which is used to store the state of the iterator. + * The exact format may vary between liblzma versions, so don't + * touch these in any way. + */ + union { + const void *p; + size_t s; + lzma_vli v; + } internal[6]; +} lzma_index_iter; + + +/** + * \brief Operation mode for lzma_index_iter_next() + */ +typedef enum { + LZMA_INDEX_ITER_ANY = 0, + /**< + * \brief Get the next Block or Stream + * + * Go to the next Block if the current Stream has at least + * one Block left. Otherwise go to the next Stream even if + * it has no Blocks. If the Stream has no Blocks + * (lzma_index_iter.stream.block_count == 0), + * lzma_index_iter.block will have undefined values. + */ + + LZMA_INDEX_ITER_STREAM = 1, + /**< + * \brief Get the next Stream + * + * Go to the next Stream even if the current Stream has + * unread Blocks left. If the next Stream has at least one + * Block, the iterator will point to the first Block. + * If there are no Blocks, lzma_index_iter.block will have + * undefined values. + */ + + LZMA_INDEX_ITER_BLOCK = 2, + /**< + * \brief Get the next Block + * + * Go to the next Block if the current Stream has at least + * one Block left. If the current Stream has no Blocks left, + * the next Stream with at least one Block is located and + * the iterator will be made to point to the first Block of + * that Stream. + */ + + LZMA_INDEX_ITER_NONEMPTY_BLOCK = 3 + /**< + * \brief Get the next non-empty Block + * + * This is like LZMA_INDEX_ITER_BLOCK except that it will + * skip Blocks whose Uncompressed Size is zero. + */ + +} lzma_index_iter_mode; + + +/** + * \brief Calculate memory usage of lzma_index + * + * On disk, the size of the Index field depends on both the number of Records + * stored and how big values the Records store (due to variable-length integer + * encoding). When the Index is kept in lzma_index structure, the memory usage + * depends only on the number of Records/Blocks stored in the Index(es), and + * in case of concatenated lzma_indexes, the number of Streams. The size in + * RAM is almost always significantly bigger than in the encoded form on disk. + * + * This function calculates an approximate amount of memory needed hold + * the given number of Streams and Blocks in lzma_index structure. This + * value may vary between CPU architectures and also between liblzma versions + * if the internal implementation is modified. + */ +extern LZMA_API(uint64_t) lzma_index_memusage( + lzma_vli streams, lzma_vli blocks) lzma_nothrow; + + +/** + * \brief Calculate the memory usage of an existing lzma_index + * + * This is a shorthand for lzma_index_memusage(lzma_index_stream_count(i), + * lzma_index_block_count(i)). + */ +extern LZMA_API(uint64_t) lzma_index_memused(const lzma_index *i) + lzma_nothrow; + + +/** + * \brief Allocate and initialize a new lzma_index structure + * + * \return On success, a pointer to an empty initialized lzma_index is + * returned. If allocation fails, NULL is returned. + */ +extern LZMA_API(lzma_index *) lzma_index_init(lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Deallocate lzma_index + * + * If i is NULL, this does nothing. + */ +extern LZMA_API(void) lzma_index_end(lzma_index *i, lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Add a new Block to lzma_index + * + * \param i Pointer to a lzma_index structure + * \param allocator Pointer to lzma_allocator, or NULL to + * use malloc() + * \param unpadded_size Unpadded Size of a Block. This can be + * calculated with lzma_block_unpadded_size() + * after encoding or decoding the Block. + * \param uncompressed_size Uncompressed Size of a Block. This can be + * taken directly from lzma_block structure + * after encoding or decoding the Block. + * + * Appending a new Block does not invalidate iterators. For example, + * if an iterator was pointing to the end of the lzma_index, after + * lzma_index_append() it is possible to read the next Block with + * an existing iterator. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR: Compressed or uncompressed size of the + * Stream or size of the Index field would grow too big. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_append( + lzma_index *i, lzma_allocator *allocator, + lzma_vli unpadded_size, lzma_vli uncompressed_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Set the Stream Flags + * + * Set the Stream Flags of the last (and typically the only) Stream + * in lzma_index. This can be useful when reading information from the + * lzma_index, because to decode Blocks, knowing the integrity check type + * is needed. + * + * The given Stream Flags are copied into internal preallocated structure + * in the lzma_index, thus the caller doesn't need to keep the *stream_flags + * available after calling this function. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR: Unsupported stream_flags->version. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_stream_flags( + lzma_index *i, const lzma_stream_flags *stream_flags) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the types of integrity Checks + * + * If lzma_index_stream_padding() is used to set the Stream Flags for + * every Stream, lzma_index_checks() can be used to get a bitmask to + * indicate which Check types have been used. It can be useful e.g. if + * showing the Check types to the user. + * + * The bitmask is 1 << check_id, e.g. CRC32 is 1 << 1 and SHA-256 is 1 << 10. + */ +extern LZMA_API(uint32_t) lzma_index_checks(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Set the amount of Stream Padding + * + * Set the amount of Stream Padding of the last (and typically the only) + * Stream in the lzma_index. This is needed when planning to do random-access + * reading within multiple concatenated Streams. + * + * By default, the amount of Stream Padding is assumed to be zero bytes. + * + * \return - LZMA_OK + * - LZMA_DATA_ERROR: The file size would grow too big. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_stream_padding( + lzma_index *i, lzma_vli stream_padding) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the number of Streams + */ +extern LZMA_API(lzma_vli) lzma_index_stream_count(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the number of Blocks + * + * This returns the total number of Blocks in lzma_index. To get number + * of Blocks in individual Streams, use lzma_index_iter. + */ +extern LZMA_API(lzma_vli) lzma_index_block_count(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the size of the Index field as bytes + * + * This is needed to verify the Backward Size field in the Stream Footer. + */ +extern LZMA_API(lzma_vli) lzma_index_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the Stream + * + * If multiple lzma_indexes have been combined, this works as if the Blocks + * were in a single Stream. This is useful if you are going to combine + * Blocks from multiple Streams into a single new Stream. + */ +extern LZMA_API(lzma_vli) lzma_index_stream_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the Blocks + * + * This doesn't include the Stream Header, Stream Footer, Stream Padding, + * or Index fields. + */ +extern LZMA_API(lzma_vli) lzma_index_total_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the file + * + * When no lzma_indexes have been combined with lzma_index_cat() and there is + * no Stream Padding, this function is identical to lzma_index_stream_size(). + * If multiple lzma_indexes have been combined, this includes also the headers + * of each separate Stream and the possible Stream Padding fields. + */ +extern LZMA_API(lzma_vli) lzma_index_file_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the uncompressed size of the file + */ +extern LZMA_API(lzma_vli) lzma_index_uncompressed_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize an iterator + * + * \param iter Pointer to a lzma_index_iter structure + * \param i lzma_index to which the iterator will be associated + * + * This function associates the iterator with the given lzma_index, and calls + * lzma_index_iter_rewind() on the iterator. + * + * This function doesn't allocate any memory, thus there is no + * lzma_index_iter_end(). The iterator is valid as long as the + * associated lzma_index is valid, that is, until lzma_index_end() or + * using it as source in lzma_index_cat(). Specifically, lzma_index doesn't + * become invalid if new Blocks are added to it with lzma_index_append() or + * if it is used as the destination in lzma_index_cat(). + * + * It is safe to make copies of an initialized lzma_index_iter, for example, + * to easily restart reading at some particular position. + */ +extern LZMA_API(void) lzma_index_iter_init( + lzma_index_iter *iter, const lzma_index *i) lzma_nothrow; + + +/** + * \brief Rewind the iterator + * + * Rewind the iterator so that next call to lzma_index_iter_next() will + * return the first Block or Stream. + */ +extern LZMA_API(void) lzma_index_iter_rewind(lzma_index_iter *iter) + lzma_nothrow; + + +/** + * \brief Get the next Block or Stream + * + * \param iter Iterator initialized with lzma_index_iter_init() + * \param mode Specify what kind of information the caller wants + * to get. See lzma_index_iter_mode for details. + * + * \return If next Block or Stream matching the mode was found, *iter + * is updated and this function returns false. If no Block or + * Stream matching the mode is found, *iter is not modified + * and this function returns true. If mode is set to an unknown + * value, *iter is not modified and this function returns true. + */ +extern LZMA_API(lzma_bool) lzma_index_iter_next( + lzma_index_iter *iter, lzma_index_iter_mode mode) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Locate a Block + * + * If it is possible to seek in the .xz file, it is possible to parse + * the Index field(s) and use lzma_index_iter_locate() to do random-access + * reading with granularity of Block size. + * + * \param iter Iterator that was earlier initialized with + * lzma_index_iter_init(). + * \param target Uncompressed target offset which the caller would + * like to locate from the Stream + * + * If the target is smaller than the uncompressed size of the Stream (can be + * checked with lzma_index_uncompressed_size()): + * - Information about the Stream and Block containing the requested + * uncompressed offset is stored into *iter. + * - Internal state of the iterator is adjusted so that + * lzma_index_iter_next() can be used to read subsequent Blocks or Streams. + * - This function returns false. + * + * If target is greater than the uncompressed size of the Stream, *iter + * is not modified, and this function returns true. + */ +extern LZMA_API(lzma_bool) lzma_index_iter_locate( + lzma_index_iter *iter, lzma_vli target) lzma_nothrow; + + +/** + * \brief Concatenate lzma_indexes + * + * Concatenating lzma_indexes is useful when doing random-access reading in + * multi-Stream .xz file, or when combining multiple Streams into single + * Stream. + * + * \param dest lzma_index after which src is appended + * \param src lzma_index to be appended after dest. If this + * function succeeds, the memory allocated for src + * is freed or moved to be part of dest, and all + * iterators pointing to src will become invalid. + * \param allocator Custom memory allocator; can be NULL to use + * malloc() and free(). + * + * \return - LZMA_OK: lzma_indexes were concatenated successfully. + * src is now a dangling pointer. + * - LZMA_DATA_ERROR: *dest would grow too big. + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_cat(lzma_index *lzma_restrict dest, + lzma_index *lzma_restrict src, + lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Duplicate lzma_index + * + * \return A copy of the lzma_index, or NULL if memory allocation failed. + */ +extern LZMA_API(lzma_index *) lzma_index_dup( + const lzma_index *i, lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .xz Index encoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param i Pointer to lzma_index which should be encoded. + * + * The only valid action value for lzma_code() is LZMA_RUN. + * + * \return - LZMA_OK: Initialization succeeded, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_encoder( + lzma_stream *strm, const lzma_index *i) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .xz Index decoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param i The decoded Index will be made available via + * this pointer. Initially this function will + * set *i to NULL (the old value is ignored). If + * decoding succeeds (lzma_code() returns + * LZMA_STREAM_END), *i will be set to point + * to a new lzma_index, which the application + * has to later free with lzma_index_end(). + * \param memlimit How much memory the resulting lzma_index is + * allowed to require. + * + * The only valid action value for lzma_code() is LZMA_RUN. + * + * \return - LZMA_OK: Initialization succeeded, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_decoder( + lzma_stream *strm, lzma_index **i, uint64_t memlimit) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Index encoder + * + * \param i lzma_index to be encoded + * \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: Output buffer is too small. Use + * lzma_index_size() to find out how much output + * space is needed. + * - LZMA_PROG_ERROR + * + * \note This function doesn't take allocator argument since all + * the internal data is allocated on stack. + */ +extern LZMA_API(lzma_ret) lzma_index_buffer_encode(const lzma_index *i, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Single-call .xz Index decoder + * + * \param i If decoding succeeds, *i will point to a new + * lzma_index, which the application has to + * later free with lzma_index_end(). If an error + * occurs, *i will be NULL. The old value of *i + * is always ignored and thus doesn't need to be + * initialized by the caller. + * \param memlimit Pointer to how much memory the resulting + * lzma_index is allowed to require. The value + * pointed by this pointer is modified if and only + * if LZMA_MEMLIMIT_ERROR is returned. + * \param allocator Pointer to lzma_allocator, or NULL to use malloc() + * \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]. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. + * The minimum required memlimit value was stored to *memlimit. + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_buffer_decode(lzma_index **i, + uint64_t *memlimit, lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow; diff --git a/src/liblzma/api/lzma/index_hash.h b/src/liblzma/api/lzma/index_hash.h new file mode 100644 index 000000000000..94726e7beeae --- /dev/null +++ b/src/liblzma/api/lzma/index_hash.h @@ -0,0 +1,107 @@ +/** + * \file lzma/index_hash.h + * \brief Validates Index by using a hash function + * + * Hashing makes it possible to use constant amount of memory to validate + * Index of arbitrary size. + */ + +/* + * 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 + +/** + * \brief Opaque data type to hold the Index hash + */ +typedef struct lzma_index_hash_s lzma_index_hash; + + +/** + * \brief Allocate and initialize a new lzma_index_hash structure + * + * If index_hash is NULL, a new lzma_index_hash structure is allocated, + * initialized, and a pointer to it returned. If allocation fails, NULL + * is returned. + * + * If index_hash is non-NULL, it is reinitialized and the same pointer + * returned. In this case, return value cannot be NULL or a different + * pointer than the index_hash that was given as an argument. + */ +extern LZMA_API(lzma_index_hash *) lzma_index_hash_init( + lzma_index_hash *index_hash, lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Deallocate lzma_index_hash structure + */ +extern LZMA_API(void) lzma_index_hash_end( + lzma_index_hash *index_hash, lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Add a new Record to an Index hash + * + * \param index Pointer to a lzma_index_hash structure + * \param unpadded_size Unpadded Size of a Block + * \param uncompressed_size Uncompressed Size of a Block + * + * \return - LZMA_OK + * - LZMA_DATA_ERROR: Compressed or uncompressed size of the + * Stream or size of the Index field would grow too big. + * - LZMA_PROG_ERROR: Invalid arguments or this function is being + * used when lzma_index_hash_decode() has already been used. + */ +extern LZMA_API(lzma_ret) lzma_index_hash_append(lzma_index_hash *index_hash, + lzma_vli unpadded_size, lzma_vli uncompressed_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode and validate the Index field + * + * After telling the sizes of all Blocks with lzma_index_hash_append(), + * the actual Index field is decoded with this function. Specifically, + * once decoding of the Index field has been started, no more Records + * can be added using lzma_index_hash_append(). + * + * This function doesn't use lzma_stream structure to pass the input data. + * Instead, the input buffer is specified using three arguments. This is + * because it matches better the internal APIs of liblzma. + * + * \param index_hash Pointer to a lzma_index_hash structure + * \param in Pointer to the beginning of the input buffer + * \param in_pos in[*in_pos] is the next byte to process + * \param in_size in[in_size] is the first byte not to process + * + * \return - LZMA_OK: So far good, but more input is needed. + * - LZMA_STREAM_END: Index decoded successfully and it matches + * the Records given with lzma_index_hash_append(). + * - LZMA_DATA_ERROR: Index is corrupt or doesn't match the + * information given with lzma_index_hash_append(). + * - LZMA_BUF_ERROR: Cannot progress because *in_pos >= in_size. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_hash_decode(lzma_index_hash *index_hash, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the size of the Index field as bytes + * + * This is needed to verify the Backward Size field in the Stream Footer. + */ +extern LZMA_API(lzma_vli) lzma_index_hash_size( + const lzma_index_hash *index_hash) + lzma_nothrow lzma_attr_pure; diff --git a/src/liblzma/api/lzma/lzma.h b/src/liblzma/api/lzma/lzma.h new file mode 100644 index 000000000000..c17736d7eaac --- /dev/null +++ b/src/liblzma/api/lzma/lzma.h @@ -0,0 +1,397 @@ +/** + * \file lzma/lzma.h + * \brief LZMA1 and LZMA2 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 + + +/** + * \brief LZMA1 Filter ID + * + * LZMA1 is the very same thing as what was called just LZMA in LZMA Utils, + * 7-Zip, and LZMA SDK. It's called LZMA1 here to prevent developers from + * accidentally using LZMA when they actually want LZMA2. + * + * LZMA1 shouldn't be used for new applications unless you _really_ know + * what you are doing. LZMA2 is almost always a better choice. + */ +#define LZMA_FILTER_LZMA1 LZMA_VLI_C(0x4000000000000001) + +/** + * \brief LZMA2 Filter ID + * + * Usually you want this instead of LZMA1. Compared to LZMA1, LZMA2 adds + * support for LZMA_SYNC_FLUSH, uncompressed chunks (smaller expansion + * when trying to compress uncompressible data), possibility to change + * lc/lp/pb in the middle of encoding, and some other internal improvements. + */ +#define LZMA_FILTER_LZMA2 LZMA_VLI_C(0x21) + + +/** + * \brief Match finders + * + * Match finder has major effect on both speed and compression ratio. + * Usually hash chains are faster than binary trees. + * + * The memory usage formulas are only rough estimates, which are closest to + * reality when dict_size is a power of two. The formulas are more complex + * in reality, and can also change a little between liblzma versions. Use + * lzma_memusage_encoder() to get more accurate estimate of memory usage. + */ +typedef enum { + LZMA_MF_HC3 = 0x03, + /**< + * \brief Hash Chain with 2- and 3-byte hashing + * + * Minimum nice_len: 3 + * + * Memory usage: + * - dict_size <= 16 MiB: dict_size * 7.5 + * - dict_size > 16 MiB: dict_size * 5.5 + 64 MiB + */ + + LZMA_MF_HC4 = 0x04, + /**< + * \brief Hash Chain with 2-, 3-, and 4-byte hashing + * + * Minimum nice_len: 4 + * + * Memory usage: dict_size * 7.5 + */ + + LZMA_MF_BT2 = 0x12, + /**< + * \brief Binary Tree with 2-byte hashing + * + * Minimum nice_len: 2 + * + * Memory usage: dict_size * 9.5 + */ + + LZMA_MF_BT3 = 0x13, + /**< + * \brief Binary Tree with 2- and 3-byte hashing + * + * Minimum nice_len: 3 + * + * Memory usage: + * - dict_size <= 16 MiB: dict_size * 11.5 + * - dict_size > 16 MiB: dict_size * 9.5 + 64 MiB + */ + + LZMA_MF_BT4 = 0x14 + /**< + * \brief Binary Tree with 2-, 3-, and 4-byte hashing + * + * Minimum nice_len: 4 + * + * Memory usage: dict_size * 11.5 + */ +} lzma_match_finder; + + +/** + * \brief Test if given match finder is supported + * + * Return true if the given match finder is supported by this liblzma build. + * Otherwise false is returned. It is safe to call this with a value that + * isn't listed in lzma_match_finder enumeration; the return value will be + * false. + * + * There is no way to list which match finders are available in this + * particular liblzma version and build. It would be useless, because + * a new match finder, which the application developer wasn't aware, + * could require giving additional options to the encoder that the older + * match finders don't need. + */ +extern LZMA_API(lzma_bool) lzma_mf_is_supported(lzma_match_finder match_finder) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Compression modes + * + * This selects the function used to analyze the data produced by the match + * finder. + */ +typedef enum { + LZMA_MODE_FAST = 1, + /**< + * \brief Fast compression + * + * Fast mode is usually at its best when combined with + * a hash chain match finder. + */ + + LZMA_MODE_NORMAL = 2 + /**< + * \brief Normal compression + * + * This is usually notably slower than fast mode. Use this + * together with binary tree match finders to expose the + * full potential of the LZMA1 or LZMA2 encoder. + */ +} lzma_mode; + + +/** + * \brief Test if given compression mode is supported + * + * Return true if the given compression mode is supported by this liblzma + * build. Otherwise false is returned. It is safe to call this with a value + * that isn't listed in lzma_mode enumeration; the return value will be false. + * + * There is no way to list which modes are available in this particular + * liblzma version and build. It would be useless, because a new compression + * mode, which the application developer wasn't aware, could require giving + * additional options to the encoder that the older modes don't need. + */ +extern LZMA_API(lzma_bool) lzma_mode_is_supported(lzma_mode mode) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Options specific to the LZMA1 and LZMA2 filters + * + * Since LZMA1 and LZMA2 share most of the code, it's simplest to share + * the options structure too. For encoding, all but the reserved variables + * need to be initialized unless specifically mentioned otherwise. + * + * For raw decoding, both LZMA1 and LZMA2 need dict_size, preset_dict, and + * preset_dict_size (if preset_dict != NULL). LZMA1 needs also lc, lp, and pb. + */ +typedef struct { + /** + * \brief Dictionary size in bytes + * + * Dictionary size indicates how many bytes of the recently processed + * uncompressed data is kept in memory. One method to reduce size of + * the uncompressed data is to store distance-length pairs, which + * indicate what data to repeat from the dictionary buffer. Thus, + * the bigger the dictionary, the better the compression ratio + * usually is. + * + * Maximum size of the dictionary depends on multiple things: + * - Memory usage limit + * - Available address space (not a problem on 64-bit systems) + * - Selected match finder (encoder only) + * + * Currently the maximum dictionary size for encoding is 1.5 GiB + * (i.e. (UINT32_C(1) << 30) + (UINT32_C(1) << 29)) even on 64-bit + * systems for certain match finder implementation reasons. In the + * future, there may be match finders that support bigger + * dictionaries. + * + * Decoder already supports dictionaries up to 4 GiB - 1 B (i.e. + * UINT32_MAX), so increasing the maximum dictionary size of the + * encoder won't cause problems for old decoders. + * + * Because extremely small dictionaries sizes would have unneeded + * overhead in the decoder, the minimum dictionary size is 4096 bytes. + * + * \note When decoding, too big dictionary does no other harm + * than wasting memory. + */ + uint32_t dict_size; +# define LZMA_DICT_SIZE_MIN UINT32_C(4096) +# define LZMA_DICT_SIZE_DEFAULT (UINT32_C(1) << 23) + + /** + * \brief Pointer to an initial dictionary + * + * It is possible to initialize the LZ77 history window using + * a preset dictionary. It is useful when compressing many + * similar, relatively small chunks of data independently from + * each other. The preset dictionary should contain typical + * strings that occur in the files being compressed. The most + * probable strings should be near the end of the preset dictionary. + * + * This feature should be used only in special situations. For + * now, it works correctly only with raw encoding and decoding. + * Currently none of the container formats supported by + * liblzma allow preset dictionary when decoding, thus if + * you create a .xz or .lzma file with preset dictionary, it + * cannot be decoded with the regular decoder functions. In the + * future, the .xz format will likely get support for preset + * dictionary though. + */ + const uint8_t *preset_dict; + + /** + * \brief Size of the preset dictionary + * + * Specifies the size of the preset dictionary. If the size is + * bigger than dict_size, only the last dict_size bytes are + * processed. + * + * This variable is read only when preset_dict is not NULL. + * If preset_dict is not NULL but preset_dict_size is zero, + * no preset dictionary is used (identical to only setting + * preset_dict to NULL). + */ + uint32_t preset_dict_size; + + /** + * \brief Number of literal context bits + * + * How many of the highest bits of the previous uncompressed + * eight-bit byte (also known as `literal') are taken into + * account when predicting the bits of the next literal. + * + * \todo Example + * + * There is a limit that applies to literal context bits and literal + * position bits together: lc + lp <= 4. Without this limit the + * decoding could become very slow, which could have security related + * results in some cases like email servers doing virus scanning. + * This limit also simplifies the internal implementation in liblzma. + * + * There may be LZMA1 streams that have lc + lp > 4 (maximum possible + * lc would be 8). It is not possible to decode such streams with + * liblzma. + */ + uint32_t lc; +# define LZMA_LCLP_MIN 0 +# define LZMA_LCLP_MAX 4 +# define LZMA_LC_DEFAULT 3 + + /** + * \brief Number of literal position bits + * + * How many of the lowest bits of the current position (number + * of bytes from the beginning of the uncompressed data) in the + * uncompressed data is taken into account when predicting the + * bits of the next literal (a single eight-bit byte). + * + * \todo Example + */ + uint32_t lp; +# define LZMA_LP_DEFAULT 0 + + /** + * \brief Number of position bits + * + * How many of the lowest bits of the current position in the + * uncompressed data is taken into account when estimating + * probabilities of matches. A match is a sequence of bytes for + * which a matching sequence is found from the dictionary and + * thus can be stored as distance-length pair. + * + * Example: If most of the matches occur at byte positions of + * 8 * n + 3, that is, 3, 11, 19, ... set pb to 3, because 2**3 == 8. + */ + uint32_t pb; +# define LZMA_PB_MIN 0 +# define LZMA_PB_MAX 4 +# define LZMA_PB_DEFAULT 2 + + /** Compression mode */ + lzma_mode mode; + + /** + * \brief Nice length of a match + * + * This determines how many bytes the encoder compares from the match + * candidates when looking for the best match. Once a match of at + * least nice_len bytes long is found, the encoder stops looking for + * better candidates and encodes the match. (Naturally, if the found + * match is actually longer than nice_len, the actual length is + * encoded; it's not truncated to nice_len.) + * + * Bigger values usually increase the compression ratio and + * compression time. For most files, 32 to 128 is a good value, + * which gives very good compression ratio at good speed. + * + * The exact minimum value depends on the match finder. The maximum + * is 273, which is the maximum length of a match that LZMA1 and + * LZMA2 can encode. + */ + uint32_t nice_len; + + /** Match finder ID */ + lzma_match_finder mf; + + /** + * \brief Maximum search depth in the match finder + * + * For every input byte, match finder searches through the hash chain + * or binary tree in a loop, each iteration going one step deeper in + * the chain or tree. The searching stops if + * - a match of at least nice_len bytes long is found; + * - all match candidates from the hash chain or binary tree have + * been checked; or + * - maximum search depth is reached. + * + * Maximum search depth is needed to prevent the match finder from + * wasting too much time in case there are lots of short match + * candidates. On the other hand, stopping the search before all + * candidates have been checked can reduce compression ratio. + * + * Setting depth to zero tells liblzma to use an automatic default + * value, that depends on the selected match finder and nice_len. + * The default is in the range [10, 200] or so (it may vary between + * liblzma versions). + * + * Using a bigger depth value than the default can increase + * compression ratio in some cases. There is no strict maximum value, + * but high values (thousands or millions) should be used with care: + * the encoder could remain fast enough with typical input, but + * malicious input could cause the match finder to slow down + * dramatically, possibly creating a denial of service attack. + */ + uint32_t depth; + + /* + * 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; + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + uint32_t reserved_int5; + uint32_t reserved_int6; + uint32_t reserved_int7; + uint32_t reserved_int8; + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + +} lzma_options_lzma; + + +/** + * \brief Set a compression preset to lzma_options_lzma structure + * + * 0 is the fastest and 9 is the slowest. These match the switches -0 .. -9 + * of the xz command line tool. In addition, it is possible to bitwise-or + * flags to the preset. Currently only LZMA_PRESET_EXTREME is supported. + * The flags are defined in container.h, because the flags are used also + * with lzma_easy_encoder(). + * + * The preset values are subject to changes between liblzma versions. + * + * This function is available only if LZMA1 or LZMA2 encoder has been enabled + * when building liblzma. + */ +extern LZMA_API(lzma_bool) lzma_lzma_preset( + lzma_options_lzma *options, uint32_t preset) lzma_nothrow; diff --git a/src/liblzma/api/lzma/stream_flags.h b/src/liblzma/api/lzma/stream_flags.h new file mode 100644 index 000000000000..d255bdda15f6 --- /dev/null +++ b/src/liblzma/api/lzma/stream_flags.h @@ -0,0 +1,227 @@ +/** + * \file lzma/stream_flags.h + * \brief .xz Stream Header and Stream Footer encoder and decoder + */ + +/* + * 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 + + +/** + * \brief Size of Stream Header and Stream Footer + * + * Stream Header and Stream Footer have the same size and they are not + * going to change even if a newer version of the .xz file format is + * developed in future. + */ +#define LZMA_STREAM_HEADER_SIZE 12 + + +/** + * \brief Options for encoding/decoding Stream Header and Stream Footer + */ +typedef struct { + /** + * \brief Stream Flags format version + * + * To prevent API and ABI breakages if new features are needed in + * Stream Header or Stream Footer, 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, the + * lzma_stream_header_encode() and lzma_stream_footer_encode() + * will return LZMA_OPTIONS_ERROR. + * + * lzma_stream_header_decode() and lzma_stream_footer_decode() + * will always set this to the lowest value that supports all the + * features indicated by the Stream Flags field. The application + * must check that the version number set by the decoding functions + * is supported by the application. Otherwise it is possible that + * the application will decode the Stream incorrectly. + */ + uint32_t version; + + /** + * \brief Backward Size + * + * Backward Size must be a multiple of four bytes. In this Stream + * format version, Backward Size is the size of the Index field. + * + * Backward Size isn't actually part of the Stream Flags field, but + * it is convenient to include in this structure anyway. Backward + * Size is present only in the Stream Footer. There is no need to + * initialize backward_size when encoding Stream Header. + * + * lzma_stream_header_decode() always sets backward_size to + * LZMA_VLI_UNKNOWN so that it is convenient to use + * lzma_stream_flags_compare() when both Stream Header and Stream + * Footer have been decoded. + */ + lzma_vli backward_size; +# define LZMA_BACKWARD_SIZE_MIN 4 +# define LZMA_BACKWARD_SIZE_MAX (LZMA_VLI_C(1) << 34) + + /** + * \brief Check ID + * + * This indicates the type of the integrity check calculated from + * uncompressed data. + */ + lzma_check check; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the + * names of these variables may change. + * + * (We will never be able to use all of these since Stream Flags + * is just two bytes plus Backward Size of four bytes. But it's + * nice to have the proper types when they are needed.) + */ + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + lzma_reserved_enum reserved_enum5; + lzma_reserved_enum reserved_enum6; + 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; + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + +} lzma_stream_flags; + + +/** + * \brief Encode Stream Header + * + * \param options Stream Header options to be encoded. + * options->backward_size is ignored and doesn't + * need to be initialized. + * \param out Beginning of the output buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: options->version is not supported by + * this liblzma version. + * - LZMA_PROG_ERROR: Invalid options. + */ +extern LZMA_API(lzma_ret) lzma_stream_header_encode( + const lzma_stream_flags *options, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Stream Footer + * + * \param options Stream Footer options to be encoded. + * \param out Beginning of the output buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: options->version is not supported by + * this liblzma version. + * - LZMA_PROG_ERROR: Invalid options. + */ +extern LZMA_API(lzma_ret) lzma_stream_footer_encode( + const lzma_stream_flags *options, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Stream Header + * + * \param options Stream Header options to be encoded. + * \param in Beginning of the input buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * options->backward_size is always set to LZMA_VLI_UNKNOWN. This is to + * help comparing Stream Flags from Stream Header and Stream Footer with + * lzma_stream_flags_compare(). + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given + * buffer cannot be Stream Header. + * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the header + * is corrupt. + * - LZMA_OPTIONS_ERROR: Unsupported options are present + * in the header. + * + * \note When decoding .xz files that contain multiple Streams, it may + * make sense to print "file format not recognized" only if + * decoding of the Stream Header of the _first_ Stream gives + * LZMA_FORMAT_ERROR. If non-first Stream Header gives + * LZMA_FORMAT_ERROR, the message used for LZMA_DATA_ERROR is + * probably more appropriate. + * + * For example, Stream decoder in liblzma uses LZMA_DATA_ERROR if + * LZMA_FORMAT_ERROR is returned by lzma_stream_header_decode() + * when decoding non-first Stream. + */ +extern LZMA_API(lzma_ret) lzma_stream_header_decode( + lzma_stream_flags *options, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Stream Footer + * + * \param options Stream Header options to be encoded. + * \param in Beginning of the input buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given + * buffer cannot be Stream Footer. + * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the Stream Footer + * is corrupt. + * - LZMA_OPTIONS_ERROR: Unsupported options are present + * in Stream Footer. + * + * \note If Stream Header was already decoded successfully, but + * decoding Stream Footer returns LZMA_FORMAT_ERROR, the + * application should probably report some other error message + * than "file format not recognized", since the file more likely + * is corrupt (possibly truncated). Stream decoder in liblzma + * uses LZMA_DATA_ERROR in this situation. + */ +extern LZMA_API(lzma_ret) lzma_stream_footer_decode( + lzma_stream_flags *options, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Compare two lzma_stream_flags structures + * + * backward_size values are compared only if both are not + * LZMA_VLI_UNKNOWN. + * + * \return - LZMA_OK: Both are equal. If either had backward_size set + * to LZMA_VLI_UNKNOWN, backward_size values were not + * compared or validated. + * - LZMA_DATA_ERROR: The structures differ. + * - LZMA_OPTIONS_ERROR: version in either structure is greater + * than the maximum supported version (currently zero). + * - LZMA_PROG_ERROR: Invalid value, e.g. invalid check or + * backward_size. + */ +extern LZMA_API(lzma_ret) lzma_stream_flags_compare( + const lzma_stream_flags *a, const lzma_stream_flags *b) + lzma_nothrow lzma_attr_pure; diff --git a/src/liblzma/api/lzma/subblock.h b/src/liblzma/api/lzma/subblock.h new file mode 100644 index 000000000000..4ffb049824b7 --- /dev/null +++ b/src/liblzma/api/lzma/subblock.h @@ -0,0 +1,200 @@ +/** + * \file lzma/subblock.h + * \brief Subblock filter + */ + +/* + * 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 + + +/** + * \brief Filter ID + * + * Filter ID of the Subblock filter. This is used as lzma_filter.id. + */ +#define LZMA_FILTER_SUBBLOCK LZMA_VLI_C(0x01) + + +/** + * \brief Subfilter mode + * + * See lzma_options_subblock.subfilter_mode for details. + */ +typedef enum { + LZMA_SUBFILTER_NONE, + /**< + * No Subfilter is in use. + */ + + LZMA_SUBFILTER_SET, + /**< + * New Subfilter has been requested to be initialized. + */ + + LZMA_SUBFILTER_RUN, + /**< + * Subfilter is active. + */ + + LZMA_SUBFILTER_FINISH + /**< + * Subfilter has been requested to be finished. + */ +} lzma_subfilter_mode; + + +/** + * \brief Options for the Subblock filter + * + * Specifying options for the Subblock filter is optional: if the pointer + * options is NULL, no subfilters are allowed and the default value is used + * for subblock_data_size. + */ +typedef struct { + /* Options for encoder and decoder */ + + /** + * \brief Allowing subfilters + * + * If this true, subfilters are allowed. + * + * In the encoder, if this is set to false, subfilter_mode and + * subfilter_options are completely ignored. + */ + lzma_bool allow_subfilters; + + /* Options for encoder only */ + + /** + * \brief Alignment + * + * The Subblock filter encapsulates the input data into Subblocks. + * Each Subblock has a header which takes a few bytes of space. + * When the output of the Subblock encoder is fed to another filter + * that takes advantage of the alignment of the input data (e.g. LZMA), + * the Subblock filter can add padding to keep the actual data parts + * in the Subblocks aligned correctly. + * + * The alignment should be a positive integer. Subblock filter will + * add enough padding between Subblocks so that this is true for + * every payload byte: + * input_offset % alignment == output_offset % alignment + * + * The Subblock filter assumes that the first output byte will be + * written to a position in the output stream that is properly + * aligned. This requirement is automatically met when the start + * offset of the Stream or Block is correctly told to Block or + * Stream encoder. + */ + uint32_t alignment; +# define LZMA_SUBBLOCK_ALIGNMENT_MIN 1 +# define LZMA_SUBBLOCK_ALIGNMENT_MAX 32 +# define LZMA_SUBBLOCK_ALIGNMENT_DEFAULT 4 + + /** + * \brief Size of the Subblock Data part of each Subblock + * + * This value is re-read every time a new Subblock is started. + * + * Bigger values + * - save a few bytes of space; + * - increase latency in the encoder (but no effect for decoding); + * - decrease memory locality (increased cache pollution) in the + * encoder (no effect in decoding). + */ + uint32_t subblock_data_size; +# define LZMA_SUBBLOCK_DATA_SIZE_MIN 1 +# define LZMA_SUBBLOCK_DATA_SIZE_MAX (UINT32_C(1) << 28) +# define LZMA_SUBBLOCK_DATA_SIZE_DEFAULT 4096 + + /** + * \brief Run-length encoder remote control + * + * The Subblock filter has an internal run-length encoder (RLE). It + * can be useful when the data includes byte sequences that repeat + * very many times. The RLE can be used also when a Subfilter is + * in use; the RLE will be applied to the output of the Subfilter. + * + * Note that in contrast to traditional RLE, this RLE is intended to + * be used only when there's a lot of data to be repeated. If the + * input data has e.g. 500 bytes of NULs now and then, this RLE + * is probably useless, because plain LZMA should provide better + * results. + * + * Due to above reasons, it was decided to keep the implementation + * of the RLE very simple. When the rle variable is non-zero, it + * subblock_data_size must be a multiple of rle. Once the Subblock + * encoder has got subblock_data_size bytes of input, it will check + * if the whole buffer of the last subblock_data_size can be + * represented with repeats of chunks having size of rle bytes. + * + * If there are consecutive identical buffers of subblock_data_size + * bytes, they will be encoded using a single repeat entry if + * possible. + * + * If need arises, more advanced RLE can be implemented later + * without breaking API or ABI. + */ + uint32_t rle; +# define LZMA_SUBBLOCK_RLE_OFF 0 +# define LZMA_SUBBLOCK_RLE_MIN 1 +# define LZMA_SUBBLOCK_RLE_MAX 256 + + /** + * \brief Subfilter remote control + * + * When the Subblock filter is initialized, this variable must be + * LZMA_SUBFILTER_NONE or LZMA_SUBFILTER_SET. + * + * When subfilter_mode is LZMA_SUBFILTER_NONE, the application may + * put Subfilter options to subfilter_options structure, and then + * set subfilter_mode to LZMA_SUBFILTER_SET. No new input data will + * be read until the Subfilter has been enabled. Once the Subfilter + * has been enabled, liblzma will set subfilter_mode to + * LZMA_SUBFILTER_RUN. + * + * When subfilter_mode is LZMA_SUBFILTER_RUN, the application may + * set subfilter_mode to LZMA_SUBFILTER_FINISH. All the input + * currently available will be encoded before unsetting the + * Subfilter. Application must not change the amount of available + * input until the Subfilter has finished. Once the Subfilter has + * finished, liblzma will set subfilter_mode to LZMA_SUBFILTER_NONE. + * + * If the intent is to have Subfilter enabled to the very end of + * the data, it is not needed to separately disable Subfilter with + * LZMA_SUBFILTER_FINISH. Using LZMA_FINISH as the second argument + * of lzma_code() will make the Subblock encoder to disable the + * Subfilter once all the data has been ran through the Subfilter. + * + * After the first call with LZMA_SYNC_FLUSH or LZMA_FINISH, the + * application must not change subfilter_mode until LZMA_STREAM_END. + * Setting LZMA_SUBFILTER_SET/LZMA_SUBFILTER_FINISH and + * LZMA_SYNC_FLUSH/LZMA_FINISH _at the same time_ is fine. + * + * \note This variable is ignored if allow_subfilters is false. + */ + lzma_subfilter_mode subfilter_mode; + + /** + * \brief Subfilter and its options + * + * When no Subfilter is used, the data is copied as is into Subblocks. + * Setting a Subfilter allows encoding some parts of the data with + * an additional filter. It is possible to many different Subfilters + * in the same Block, although only one can be used at once. + * + * \note This variable is ignored if allow_subfilters is false. + */ + lzma_filter subfilter_options; + +} lzma_options_subblock; diff --git a/src/liblzma/api/lzma/version.h b/src/liblzma/api/lzma/version.h new file mode 100644 index 000000000000..0f7c2d3737db --- /dev/null +++ b/src/liblzma/api/lzma/version.h @@ -0,0 +1,121 @@ +/** + * \file lzma/version.h + * \brief Version number + */ + +/* + * 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 + + +/* + * Version number split into components + */ +#define LZMA_VERSION_MAJOR 4 +#define LZMA_VERSION_MINOR 999 +#define LZMA_VERSION_PATCH 9 +#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_BETA + +#ifndef LZMA_VERSION_COMMIT +# define LZMA_VERSION_COMMIT "" +#endif + + +/* + * Map symbolic stability levels to integers. + */ +#define LZMA_VERSION_STABILITY_ALPHA 0 +#define LZMA_VERSION_STABILITY_BETA 1 +#define LZMA_VERSION_STABILITY_STABLE 2 + + +/** + * \brief Compile-time version number + * + * The version number is of format xyyyzzzs where + * - x = major + * - yyy = minor + * - zzz = revision + * - s indicates stability: 0 = alpha, 1 = beta, 2 = stable + * + * The same xyyyzzz triplet is never reused with different stability levels. + * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta + * or 5.1.0 stable. + * + * \note The version number of liblzma has nothing to with + * the version number of Igor Pavlov's LZMA SDK. + */ +#define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \ + + LZMA_VERSION_MINOR * UINT32_C(10000) \ + + LZMA_VERSION_PATCH * UINT32_C(10) \ + + LZMA_VERSION_STABILITY) + + +/* + * Macros to construct the compile-time version string + */ +#if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA +# define LZMA_VERSION_STABILITY_STRING "alpha" +#elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA +# define LZMA_VERSION_STABILITY_STRING "beta" +#elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE +# define LZMA_VERSION_STABILITY_STRING "" +#else +# error Incorrect LZMA_VERSION_STABILITY +#endif + +#define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \ + #major "." #minor "." #patch stability commit + +#define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \ + LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) + + +/** + * \brief Compile-time version as a string + * + * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable + * versions don't have any "stable" suffix). In future, a snapshot built + * from source code repository may include an additional suffix, for example + * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form + * in LZMA_VERSION macro. + */ +#define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \ + LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \ + LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \ + LZMA_VERSION_COMMIT) + + +/* #ifndef is needed for use with windres (MinGW or Cygwin). */ +#ifndef LZMA_H_INTERNAL_RC + +/** + * \brief Run-time version number as an integer + * + * Return the value of LZMA_VERSION macro at the compile time of liblzma. + * This allows the application to compare if it was built against the same, + * older, or newer version of liblzma that is currently running. + */ +extern LZMA_API(uint32_t) lzma_version_number(void) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Run-time version as a string + * + * This function may be useful if you want to display which version of + * liblzma your application is currently using. + */ +extern LZMA_API(const char *) lzma_version_string(void) + lzma_nothrow lzma_attr_const; + +#endif diff --git a/src/liblzma/api/lzma/vli.h b/src/liblzma/api/lzma/vli.h new file mode 100644 index 000000000000..8d4277f71227 --- /dev/null +++ b/src/liblzma/api/lzma/vli.h @@ -0,0 +1,168 @@ +/** + * \file lzma/vli.h + * \brief Variable-length integer handling + * + * In the .xz format, most integers are encoded in a variable-length + * representation, which is sometimes called little endian base-128 encoding. + * This saves space when smaller values are more likely than bigger values. + * + * The encoding scheme encodes seven bits to every byte, using minimum + * number of bytes required to represent the given value. Encodings that use + * non-minimum number of bytes are invalid, thus every integer has exactly + * one encoded representation. The maximum number of bits in a VLI is 63, + * thus the vli argument must be less than or equal to UINT64_MAX / 2. You + * should use LZMA_VLI_MAX for clarity. + */ + +/* + * 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 + + +/** + * \brief Maximum supported value of variable-length integer + */ +#define LZMA_VLI_MAX (UINT64_MAX / 2) + +/** + * \brief VLI value to denote that the value is unknown + */ +#define LZMA_VLI_UNKNOWN UINT64_MAX + +/** + * \brief Maximum supported length of variable length integers + */ +#define LZMA_VLI_BYTES_MAX 9 + + +/** + * \brief VLI constant suffix + */ +#define LZMA_VLI_C(n) UINT64_C(n) + + +/** + * \brief Variable-length integer type + * + * This will always be unsigned integer. Valid VLI values are in the range + * [0, LZMA_VLI_MAX]. Unknown value is indicated with LZMA_VLI_UNKNOWN, + * which is the maximum value of the underlaying integer type. + * + * In future, even if lzma_vli is defined to be something other than uint64_t, + * it is guaranteed that 2 * LZMA_VLI_MAX will not overflow lzma_vli. + * This simplifies integer overflow detection. + */ +typedef uint64_t lzma_vli; + + +/** + * \brief Simple macro to validate variable-length integer + * + * This is useful to test that application has given acceptable values + * for example in the uncompressed_size and compressed_size variables. + * + * \return True if the integer is representable as VLI or if it + * indicates unknown value. + */ +#define lzma_vli_is_valid(vli) \ + ((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN) + + +/** + * \brief Encode a variable-length integer + * + * This function has two modes: single-call and multi-call. Single-call mode + * encodes the whole integer at once; it is an error if the output buffer is + * too small. Multi-call mode saves the position in *vli_pos, and thus it is + * possible to continue encoding if the buffer becomes full before the whole + * integer has been encoded. + * + * \param vli Integer to be encoded + * \param vli_pos How many VLI-encoded bytes have already been written + * out. When starting to encode a new integer, *vli_pos + * must be set to zero. To use single-call encoding, + * set vli_pos to NULL. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return Slightly different return values are used in multi-call and + * single-call modes. + * + * Single-call (vli_pos == NULL): + * - LZMA_OK: Integer successfully encoded. + * - LZMA_PROG_ERROR: Arguments are not sane. This can be due + * to too little output space; single-call mode doesn't use + * LZMA_BUF_ERROR, since the application should have checked + * the encoded size with lzma_vli_size(). + * + * Multi-call (vli_pos != NULL): + * - LZMA_OK: So far all OK, but the integer is not + * completely written out yet. + * - LZMA_STREAM_END: Integer successfully encoded. + * - LZMA_BUF_ERROR: No output space was provided. + * - LZMA_PROG_ERROR: Arguments are not sane. + */ +extern LZMA_API(lzma_ret) lzma_vli_encode(lzma_vli vli, + size_t *vli_pos, uint8_t *lzma_restrict out, + size_t *lzma_restrict out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Decode a variable-length integer + * + * Like lzma_vli_encode(), this function has single-call and multi-call modes. + * + * \param vli Pointer to decoded integer. The decoder will + * initialize it to zero when *vli_pos == 0, so + * application isn't required to initialize *vli. + * \param vli_pos How many bytes have already been decoded. When + * starting to decode a new integer, *vli_pos must + * be initialized to zero. To use single-call decoding, + * set this to NULL. + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * + * \return Slightly different return values are used in multi-call and + * single-call modes. + * + * Single-call (vli_pos == NULL): + * - LZMA_OK: Integer successfully decoded. + * - LZMA_DATA_ERROR: Integer is corrupt. This includes hitting + * the end of the input buffer before the whole integer was + * decoded; providing no input at all will use LZMA_DATA_ERROR. + * - LZMA_PROG_ERROR: Arguments are not sane. + * + * Multi-call (vli_pos != NULL): + * - LZMA_OK: So far all OK, but the integer is not + * completely decoded yet. + * - LZMA_STREAM_END: Integer successfully decoded. + * - LZMA_DATA_ERROR: Integer is corrupt. + * - LZMA_BUF_ERROR: No input was provided. + * - LZMA_PROG_ERROR: Arguments are not sane. + */ +extern LZMA_API(lzma_ret) lzma_vli_decode(lzma_vli *lzma_restrict vli, + size_t *vli_pos, const uint8_t *lzma_restrict in, + size_t *lzma_restrict in_pos, size_t in_size) lzma_nothrow; + + +/** + * \brief Get the number of bytes required to encode a VLI + * + * \return Number of bytes on success (1-9). If vli isn't valid, + * zero is returned. + */ +extern LZMA_API(uint32_t) lzma_vli_size(lzma_vli vli) + lzma_nothrow lzma_attr_pure; diff --git a/src/liblzma/check/check.c b/src/liblzma/check/check.c new file mode 100644 index 000000000000..428ddaeb7798 --- /dev/null +++ b/src/liblzma/check/check.c @@ -0,0 +1,174 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file check.c +/// \brief Single API to access different integrity checks +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + + +extern LZMA_API(lzma_bool) +lzma_check_is_supported(lzma_check type) +{ + if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) + return false; + + static const lzma_bool available_checks[LZMA_CHECK_ID_MAX + 1] = { + true, // LZMA_CHECK_NONE + +#ifdef HAVE_CHECK_CRC32 + true, +#else + false, +#endif + + false, // Reserved + false, // Reserved + +#ifdef HAVE_CHECK_CRC64 + true, +#else + false, +#endif + + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + +#ifdef HAVE_CHECK_SHA256 + true, +#else + false, +#endif + + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + }; + + return available_checks[(unsigned int)(type)]; +} + + +extern LZMA_API(uint32_t) +lzma_check_size(lzma_check type) +{ + if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) + return UINT32_MAX; + + // See file-format.txt section 2.1.1.2. + static const uint8_t check_sizes[LZMA_CHECK_ID_MAX + 1] = { + 0, + 4, 4, 4, + 8, 8, 8, + 16, 16, 16, + 32, 32, 32, + 64, 64, 64 + }; + + return check_sizes[(unsigned int)(type)]; +} + + +extern void +lzma_check_init(lzma_check_state *check, lzma_check type) +{ + switch (type) { + case LZMA_CHECK_NONE: + break; + +#ifdef HAVE_CHECK_CRC32 + case LZMA_CHECK_CRC32: + check->state.crc32 = 0; + break; +#endif + +#ifdef HAVE_CHECK_CRC64 + case LZMA_CHECK_CRC64: + check->state.crc64 = 0; + break; +#endif + +#ifdef HAVE_CHECK_SHA256 + case LZMA_CHECK_SHA256: + lzma_sha256_init(check); + break; +#endif + + default: + break; + } + + return; +} + + +extern void +lzma_check_update(lzma_check_state *check, lzma_check type, + const uint8_t *buf, size_t size) +{ + switch (type) { +#ifdef HAVE_CHECK_CRC32 + case LZMA_CHECK_CRC32: + check->state.crc32 = lzma_crc32(buf, size, check->state.crc32); + break; +#endif + +#ifdef HAVE_CHECK_CRC64 + case LZMA_CHECK_CRC64: + check->state.crc64 = lzma_crc64(buf, size, check->state.crc64); + break; +#endif + +#ifdef HAVE_CHECK_SHA256 + case LZMA_CHECK_SHA256: + lzma_sha256_update(buf, size, check); + break; +#endif + + default: + break; + } + + return; +} + + +extern void +lzma_check_finish(lzma_check_state *check, lzma_check type) +{ + switch (type) { +#ifdef HAVE_CHECK_CRC32 + case LZMA_CHECK_CRC32: + check->buffer.u32[0] = conv32le(check->state.crc32); + break; +#endif + +#ifdef HAVE_CHECK_CRC64 + case LZMA_CHECK_CRC64: + check->buffer.u64[0] = conv64le(check->state.crc64); + break; +#endif + +#ifdef HAVE_CHECK_SHA256 + case LZMA_CHECK_SHA256: + lzma_sha256_finish(check); + break; +#endif + + default: + break; + } + + return; +} diff --git a/src/liblzma/check/check.h b/src/liblzma/check/check.h new file mode 100644 index 000000000000..e100d2b85303 --- /dev/null +++ b/src/liblzma/check/check.h @@ -0,0 +1,95 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file check.h +/// \brief Internal API to different integrity check functions +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_CHECK_H +#define LZMA_CHECK_H + +#include "common.h" + + +// Index hashing needs the best possible hash function (preferably +// a cryptographic hash) for maximum reliability. +#if defined(HAVE_CHECK_SHA256) +# define LZMA_CHECK_BEST LZMA_CHECK_SHA256 +#elif defined(HAVE_CHECK_CRC64) +# define LZMA_CHECK_BEST LZMA_CHECK_CRC64 +#else +# define LZMA_CHECK_BEST LZMA_CHECK_CRC32 +#endif + + +/// \brief Structure to hold internal state of the check being calculated +/// +/// \note This is not in the public API because this structure may +/// change in future if new integrity check algorithms are added. +typedef struct { + /// Buffer to hold the final result and a temporary buffer for SHA256. + union { + uint8_t u8[64]; + uint32_t u32[16]; + uint64_t u64[8]; + } buffer; + + /// Check-specific data + union { + uint32_t crc32; + uint64_t crc64; + + struct { + /// Internal state + uint32_t state[8]; + + /// Size of the message excluding padding + uint64_t size; + } sha256; + } state; + +} lzma_check_state; + + +/// lzma_crc32_table[0] is needed by LZ encoder so we need to keep +/// the array two-dimensional. +#ifdef HAVE_SMALL +extern uint32_t lzma_crc32_table[1][256]; +extern void lzma_crc32_init(void); +#else +extern const uint32_t lzma_crc32_table[8][256]; +extern const uint64_t lzma_crc64_table[4][256]; +#endif + + +/// \brief Initialize *check depending on type +/// +/// \return LZMA_OK on success. LZMA_UNSUPPORTED_CHECK if the type is not +/// supported by the current version or build of liblzma. +/// LZMA_PROG_ERROR if type > LZMA_CHECK_ID_MAX. +extern void lzma_check_init(lzma_check_state *check, lzma_check type); + +/// Update the check state +extern void lzma_check_update(lzma_check_state *check, lzma_check type, + const uint8_t *buf, size_t size); + +/// Finish the check calculation and store the result to check->buffer.u8. +extern void lzma_check_finish(lzma_check_state *check, lzma_check type); + + +/// Prepare SHA-256 state for new input. +extern void lzma_sha256_init(lzma_check_state *check); + +/// Update the SHA-256 hash state +extern void lzma_sha256_update( + const uint8_t *buf, size_t size, lzma_check_state *check); + +/// Finish the SHA-256 calculation and store the result to check->buffer.u8. +extern void lzma_sha256_finish(lzma_check_state *check); + +#endif diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c new file mode 100644 index 000000000000..94da85592d8a --- /dev/null +++ b/src/liblzma/check/crc32_fast.c @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32.c +/// \brief CRC32 calculation +/// +/// Calculate the CRC32 using the slice-by-eight algorithm. +/// It is explained in this document: +/// http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf +/// The code in this file is not the same as in Intel's paper, but +/// the basic principle is identical. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" +#include "crc_macros.h" + + +// If you make any changes, do some bench marking! Seemingly unrelated +// changes can very easily ruin the performance (and very probably is +// very compiler dependent). +extern LZMA_API(uint32_t) +lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) +{ + crc = ~crc; + +#ifdef WORDS_BIGENDIAN + crc = bswap32(crc); +#endif + + if (size > 8) { + // Fix the alignment, if needed. The if statement above + // ensures that this won't read past the end of buf[]. + while ((uintptr_t)(buf) & 7) { + crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc); + --size; + } + + // Calculate the position where to stop. + const uint8_t *const limit = buf + (size & ~(size_t)(7)); + + // Calculate how many bytes must be calculated separately + // before returning the result. + size &= (size_t)(7); + + // Calculate the CRC32 using the slice-by-eight algorithm. + while (buf < limit) { + crc ^= *(const uint32_t *)(buf); + buf += 4; + + crc = lzma_crc32_table[7][A(crc)] + ^ lzma_crc32_table[6][B(crc)] + ^ lzma_crc32_table[5][C(crc)] + ^ lzma_crc32_table[4][D(crc)]; + + const uint32_t tmp = *(const uint32_t *)(buf); + buf += 4; + + // At least with some compilers, it is critical for + // performance, that the crc variable is XORed + // between the two table-lookup pairs. + crc = lzma_crc32_table[3][A(tmp)] + ^ lzma_crc32_table[2][B(tmp)] + ^ crc + ^ lzma_crc32_table[1][C(tmp)] + ^ lzma_crc32_table[0][D(tmp)]; + } + } + + while (size-- != 0) + crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc); + +#ifdef WORDS_BIGENDIAN + crc = bswap32(crc); +#endif + + return ~crc; +} diff --git a/src/liblzma/check/crc32_small.c b/src/liblzma/check/crc32_small.c new file mode 100644 index 000000000000..5f8a32868782 --- /dev/null +++ b/src/liblzma/check/crc32_small.c @@ -0,0 +1,61 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32_small.c +/// \brief CRC32 calculation (size-optimized) +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + + +uint32_t lzma_crc32_table[1][256]; + + +static void +crc32_init(void) +{ + static const uint32_t poly32 = UINT32_C(0xEDB88320); + + for (size_t b = 0; b < 256; ++b) { + uint32_t r = b; + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly32; + else + r >>= 1; + } + + lzma_crc32_table[0][b] = r; + } + + return; +} + + +extern void +lzma_crc32_init(void) +{ + mythread_once(crc32_init); + return; +} + + +extern LZMA_API(uint32_t) +lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) +{ + lzma_crc32_init(); + + crc = ~crc; + + while (size != 0) { + crc = lzma_crc32_table[0][*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); + --size; + } + + return ~crc; +} diff --git a/src/liblzma/check/crc32_table.c b/src/liblzma/check/crc32_table.c new file mode 100644 index 000000000000..368874eb79d4 --- /dev/null +++ b/src/liblzma/check/crc32_table.c @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32_table.c +/// \brief Precalculated CRC32 table with correct endianness +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + +#ifdef WORDS_BIGENDIAN +# include "crc32_table_be.h" +#else +# include "crc32_table_le.h" +#endif diff --git a/src/liblzma/check/crc32_table_be.h b/src/liblzma/check/crc32_table_be.h new file mode 100644 index 000000000000..c483cb670dcb --- /dev/null +++ b/src/liblzma/check/crc32_table_be.h @@ -0,0 +1,525 @@ +/* This file has been automatically generated by crc32_tablegen.c. */ + +const uint32_t lzma_crc32_table[8][256] = { + { + 0x00000000, 0x96300777, 0x2C610EEE, 0xBA510999, + 0x19C46D07, 0x8FF46A70, 0x35A563E9, 0xA395649E, + 0x3288DB0E, 0xA4B8DC79, 0x1EE9D5E0, 0x88D9D297, + 0x2B4CB609, 0xBD7CB17E, 0x072DB8E7, 0x911DBF90, + 0x6410B71D, 0xF220B06A, 0x4871B9F3, 0xDE41BE84, + 0x7DD4DA1A, 0xEBE4DD6D, 0x51B5D4F4, 0xC785D383, + 0x56986C13, 0xC0A86B64, 0x7AF962FD, 0xECC9658A, + 0x4F5C0114, 0xD96C0663, 0x633D0FFA, 0xF50D088D, + 0xC8206E3B, 0x5E10694C, 0xE44160D5, 0x727167A2, + 0xD1E4033C, 0x47D4044B, 0xFD850DD2, 0x6BB50AA5, + 0xFAA8B535, 0x6C98B242, 0xD6C9BBDB, 0x40F9BCAC, + 0xE36CD832, 0x755CDF45, 0xCF0DD6DC, 0x593DD1AB, + 0xAC30D926, 0x3A00DE51, 0x8051D7C8, 0x1661D0BF, + 0xB5F4B421, 0x23C4B356, 0x9995BACF, 0x0FA5BDB8, + 0x9EB80228, 0x0888055F, 0xB2D90CC6, 0x24E90BB1, + 0x877C6F2F, 0x114C6858, 0xAB1D61C1, 0x3D2D66B6, + 0x9041DC76, 0x0671DB01, 0xBC20D298, 0x2A10D5EF, + 0x8985B171, 0x1FB5B606, 0xA5E4BF9F, 0x33D4B8E8, + 0xA2C90778, 0x34F9000F, 0x8EA80996, 0x18980EE1, + 0xBB0D6A7F, 0x2D3D6D08, 0x976C6491, 0x015C63E6, + 0xF4516B6B, 0x62616C1C, 0xD8306585, 0x4E0062F2, + 0xED95066C, 0x7BA5011B, 0xC1F40882, 0x57C40FF5, + 0xC6D9B065, 0x50E9B712, 0xEAB8BE8B, 0x7C88B9FC, + 0xDF1DDD62, 0x492DDA15, 0xF37CD38C, 0x654CD4FB, + 0x5861B24D, 0xCE51B53A, 0x7400BCA3, 0xE230BBD4, + 0x41A5DF4A, 0xD795D83D, 0x6DC4D1A4, 0xFBF4D6D3, + 0x6AE96943, 0xFCD96E34, 0x468867AD, 0xD0B860DA, + 0x732D0444, 0xE51D0333, 0x5F4C0AAA, 0xC97C0DDD, + 0x3C710550, 0xAA410227, 0x10100BBE, 0x86200CC9, + 0x25B56857, 0xB3856F20, 0x09D466B9, 0x9FE461CE, + 0x0EF9DE5E, 0x98C9D929, 0x2298D0B0, 0xB4A8D7C7, + 0x173DB359, 0x810DB42E, 0x3B5CBDB7, 0xAD6CBAC0, + 0x2083B8ED, 0xB6B3BF9A, 0x0CE2B603, 0x9AD2B174, + 0x3947D5EA, 0xAF77D29D, 0x1526DB04, 0x8316DC73, + 0x120B63E3, 0x843B6494, 0x3E6A6D0D, 0xA85A6A7A, + 0x0BCF0EE4, 0x9DFF0993, 0x27AE000A, 0xB19E077D, + 0x44930FF0, 0xD2A30887, 0x68F2011E, 0xFEC20669, + 0x5D5762F7, 0xCB676580, 0x71366C19, 0xE7066B6E, + 0x761BD4FE, 0xE02BD389, 0x5A7ADA10, 0xCC4ADD67, + 0x6FDFB9F9, 0xF9EFBE8E, 0x43BEB717, 0xD58EB060, + 0xE8A3D6D6, 0x7E93D1A1, 0xC4C2D838, 0x52F2DF4F, + 0xF167BBD1, 0x6757BCA6, 0xDD06B53F, 0x4B36B248, + 0xDA2B0DD8, 0x4C1B0AAF, 0xF64A0336, 0x607A0441, + 0xC3EF60DF, 0x55DF67A8, 0xEF8E6E31, 0x79BE6946, + 0x8CB361CB, 0x1A8366BC, 0xA0D26F25, 0x36E26852, + 0x95770CCC, 0x03470BBB, 0xB9160222, 0x2F260555, + 0xBE3BBAC5, 0x280BBDB2, 0x925AB42B, 0x046AB35C, + 0xA7FFD7C2, 0x31CFD0B5, 0x8B9ED92C, 0x1DAEDE5B, + 0xB0C2649B, 0x26F263EC, 0x9CA36A75, 0x0A936D02, + 0xA906099C, 0x3F360EEB, 0x85670772, 0x13570005, + 0x824ABF95, 0x147AB8E2, 0xAE2BB17B, 0x381BB60C, + 0x9B8ED292, 0x0DBED5E5, 0xB7EFDC7C, 0x21DFDB0B, + 0xD4D2D386, 0x42E2D4F1, 0xF8B3DD68, 0x6E83DA1F, + 0xCD16BE81, 0x5B26B9F6, 0xE177B06F, 0x7747B718, + 0xE65A0888, 0x706A0FFF, 0xCA3B0666, 0x5C0B0111, + 0xFF9E658F, 0x69AE62F8, 0xD3FF6B61, 0x45CF6C16, + 0x78E20AA0, 0xEED20DD7, 0x5483044E, 0xC2B30339, + 0x612667A7, 0xF71660D0, 0x4D476949, 0xDB776E3E, + 0x4A6AD1AE, 0xDC5AD6D9, 0x660BDF40, 0xF03BD837, + 0x53AEBCA9, 0xC59EBBDE, 0x7FCFB247, 0xE9FFB530, + 0x1CF2BDBD, 0x8AC2BACA, 0x3093B353, 0xA6A3B424, + 0x0536D0BA, 0x9306D7CD, 0x2957DE54, 0xBF67D923, + 0x2E7A66B3, 0xB84A61C4, 0x021B685D, 0x942B6F2A, + 0x37BE0BB4, 0xA18E0CC3, 0x1BDF055A, 0x8DEF022D + }, { + 0x00000000, 0x41311B19, 0x82623632, 0xC3532D2B, + 0x04C56C64, 0x45F4777D, 0x86A75A56, 0xC796414F, + 0x088AD9C8, 0x49BBC2D1, 0x8AE8EFFA, 0xCBD9F4E3, + 0x0C4FB5AC, 0x4D7EAEB5, 0x8E2D839E, 0xCF1C9887, + 0x5112C24A, 0x1023D953, 0xD370F478, 0x9241EF61, + 0x55D7AE2E, 0x14E6B537, 0xD7B5981C, 0x96848305, + 0x59981B82, 0x18A9009B, 0xDBFA2DB0, 0x9ACB36A9, + 0x5D5D77E6, 0x1C6C6CFF, 0xDF3F41D4, 0x9E0E5ACD, + 0xA2248495, 0xE3159F8C, 0x2046B2A7, 0x6177A9BE, + 0xA6E1E8F1, 0xE7D0F3E8, 0x2483DEC3, 0x65B2C5DA, + 0xAAAE5D5D, 0xEB9F4644, 0x28CC6B6F, 0x69FD7076, + 0xAE6B3139, 0xEF5A2A20, 0x2C09070B, 0x6D381C12, + 0xF33646DF, 0xB2075DC6, 0x715470ED, 0x30656BF4, + 0xF7F32ABB, 0xB6C231A2, 0x75911C89, 0x34A00790, + 0xFBBC9F17, 0xBA8D840E, 0x79DEA925, 0x38EFB23C, + 0xFF79F373, 0xBE48E86A, 0x7D1BC541, 0x3C2ADE58, + 0x054F79F0, 0x447E62E9, 0x872D4FC2, 0xC61C54DB, + 0x018A1594, 0x40BB0E8D, 0x83E823A6, 0xC2D938BF, + 0x0DC5A038, 0x4CF4BB21, 0x8FA7960A, 0xCE968D13, + 0x0900CC5C, 0x4831D745, 0x8B62FA6E, 0xCA53E177, + 0x545DBBBA, 0x156CA0A3, 0xD63F8D88, 0x970E9691, + 0x5098D7DE, 0x11A9CCC7, 0xD2FAE1EC, 0x93CBFAF5, + 0x5CD76272, 0x1DE6796B, 0xDEB55440, 0x9F844F59, + 0x58120E16, 0x1923150F, 0xDA703824, 0x9B41233D, + 0xA76BFD65, 0xE65AE67C, 0x2509CB57, 0x6438D04E, + 0xA3AE9101, 0xE29F8A18, 0x21CCA733, 0x60FDBC2A, + 0xAFE124AD, 0xEED03FB4, 0x2D83129F, 0x6CB20986, + 0xAB2448C9, 0xEA1553D0, 0x29467EFB, 0x687765E2, + 0xF6793F2F, 0xB7482436, 0x741B091D, 0x352A1204, + 0xF2BC534B, 0xB38D4852, 0x70DE6579, 0x31EF7E60, + 0xFEF3E6E7, 0xBFC2FDFE, 0x7C91D0D5, 0x3DA0CBCC, + 0xFA368A83, 0xBB07919A, 0x7854BCB1, 0x3965A7A8, + 0x4B98833B, 0x0AA99822, 0xC9FAB509, 0x88CBAE10, + 0x4F5DEF5F, 0x0E6CF446, 0xCD3FD96D, 0x8C0EC274, + 0x43125AF3, 0x022341EA, 0xC1706CC1, 0x804177D8, + 0x47D73697, 0x06E62D8E, 0xC5B500A5, 0x84841BBC, + 0x1A8A4171, 0x5BBB5A68, 0x98E87743, 0xD9D96C5A, + 0x1E4F2D15, 0x5F7E360C, 0x9C2D1B27, 0xDD1C003E, + 0x120098B9, 0x533183A0, 0x9062AE8B, 0xD153B592, + 0x16C5F4DD, 0x57F4EFC4, 0x94A7C2EF, 0xD596D9F6, + 0xE9BC07AE, 0xA88D1CB7, 0x6BDE319C, 0x2AEF2A85, + 0xED796BCA, 0xAC4870D3, 0x6F1B5DF8, 0x2E2A46E1, + 0xE136DE66, 0xA007C57F, 0x6354E854, 0x2265F34D, + 0xE5F3B202, 0xA4C2A91B, 0x67918430, 0x26A09F29, + 0xB8AEC5E4, 0xF99FDEFD, 0x3ACCF3D6, 0x7BFDE8CF, + 0xBC6BA980, 0xFD5AB299, 0x3E099FB2, 0x7F3884AB, + 0xB0241C2C, 0xF1150735, 0x32462A1E, 0x73773107, + 0xB4E17048, 0xF5D06B51, 0x3683467A, 0x77B25D63, + 0x4ED7FACB, 0x0FE6E1D2, 0xCCB5CCF9, 0x8D84D7E0, + 0x4A1296AF, 0x0B238DB6, 0xC870A09D, 0x8941BB84, + 0x465D2303, 0x076C381A, 0xC43F1531, 0x850E0E28, + 0x42984F67, 0x03A9547E, 0xC0FA7955, 0x81CB624C, + 0x1FC53881, 0x5EF42398, 0x9DA70EB3, 0xDC9615AA, + 0x1B0054E5, 0x5A314FFC, 0x996262D7, 0xD85379CE, + 0x174FE149, 0x567EFA50, 0x952DD77B, 0xD41CCC62, + 0x138A8D2D, 0x52BB9634, 0x91E8BB1F, 0xD0D9A006, + 0xECF37E5E, 0xADC26547, 0x6E91486C, 0x2FA05375, + 0xE836123A, 0xA9070923, 0x6A542408, 0x2B653F11, + 0xE479A796, 0xA548BC8F, 0x661B91A4, 0x272A8ABD, + 0xE0BCCBF2, 0xA18DD0EB, 0x62DEFDC0, 0x23EFE6D9, + 0xBDE1BC14, 0xFCD0A70D, 0x3F838A26, 0x7EB2913F, + 0xB924D070, 0xF815CB69, 0x3B46E642, 0x7A77FD5B, + 0xB56B65DC, 0xF45A7EC5, 0x370953EE, 0x763848F7, + 0xB1AE09B8, 0xF09F12A1, 0x33CC3F8A, 0x72FD2493 + }, { + 0x00000000, 0x376AC201, 0x6ED48403, 0x59BE4602, + 0xDCA80907, 0xEBC2CB06, 0xB27C8D04, 0x85164F05, + 0xB851130E, 0x8F3BD10F, 0xD685970D, 0xE1EF550C, + 0x64F91A09, 0x5393D808, 0x0A2D9E0A, 0x3D475C0B, + 0x70A3261C, 0x47C9E41D, 0x1E77A21F, 0x291D601E, + 0xAC0B2F1B, 0x9B61ED1A, 0xC2DFAB18, 0xF5B56919, + 0xC8F23512, 0xFF98F713, 0xA626B111, 0x914C7310, + 0x145A3C15, 0x2330FE14, 0x7A8EB816, 0x4DE47A17, + 0xE0464D38, 0xD72C8F39, 0x8E92C93B, 0xB9F80B3A, + 0x3CEE443F, 0x0B84863E, 0x523AC03C, 0x6550023D, + 0x58175E36, 0x6F7D9C37, 0x36C3DA35, 0x01A91834, + 0x84BF5731, 0xB3D59530, 0xEA6BD332, 0xDD011133, + 0x90E56B24, 0xA78FA925, 0xFE31EF27, 0xC95B2D26, + 0x4C4D6223, 0x7B27A022, 0x2299E620, 0x15F32421, + 0x28B4782A, 0x1FDEBA2B, 0x4660FC29, 0x710A3E28, + 0xF41C712D, 0xC376B32C, 0x9AC8F52E, 0xADA2372F, + 0xC08D9A70, 0xF7E75871, 0xAE591E73, 0x9933DC72, + 0x1C259377, 0x2B4F5176, 0x72F11774, 0x459BD575, + 0x78DC897E, 0x4FB64B7F, 0x16080D7D, 0x2162CF7C, + 0xA4748079, 0x931E4278, 0xCAA0047A, 0xFDCAC67B, + 0xB02EBC6C, 0x87447E6D, 0xDEFA386F, 0xE990FA6E, + 0x6C86B56B, 0x5BEC776A, 0x02523168, 0x3538F369, + 0x087FAF62, 0x3F156D63, 0x66AB2B61, 0x51C1E960, + 0xD4D7A665, 0xE3BD6464, 0xBA032266, 0x8D69E067, + 0x20CBD748, 0x17A11549, 0x4E1F534B, 0x7975914A, + 0xFC63DE4F, 0xCB091C4E, 0x92B75A4C, 0xA5DD984D, + 0x989AC446, 0xAFF00647, 0xF64E4045, 0xC1248244, + 0x4432CD41, 0x73580F40, 0x2AE64942, 0x1D8C8B43, + 0x5068F154, 0x67023355, 0x3EBC7557, 0x09D6B756, + 0x8CC0F853, 0xBBAA3A52, 0xE2147C50, 0xD57EBE51, + 0xE839E25A, 0xDF53205B, 0x86ED6659, 0xB187A458, + 0x3491EB5D, 0x03FB295C, 0x5A456F5E, 0x6D2FAD5F, + 0x801B35E1, 0xB771F7E0, 0xEECFB1E2, 0xD9A573E3, + 0x5CB33CE6, 0x6BD9FEE7, 0x3267B8E5, 0x050D7AE4, + 0x384A26EF, 0x0F20E4EE, 0x569EA2EC, 0x61F460ED, + 0xE4E22FE8, 0xD388EDE9, 0x8A36ABEB, 0xBD5C69EA, + 0xF0B813FD, 0xC7D2D1FC, 0x9E6C97FE, 0xA90655FF, + 0x2C101AFA, 0x1B7AD8FB, 0x42C49EF9, 0x75AE5CF8, + 0x48E900F3, 0x7F83C2F2, 0x263D84F0, 0x115746F1, + 0x944109F4, 0xA32BCBF5, 0xFA958DF7, 0xCDFF4FF6, + 0x605D78D9, 0x5737BAD8, 0x0E89FCDA, 0x39E33EDB, + 0xBCF571DE, 0x8B9FB3DF, 0xD221F5DD, 0xE54B37DC, + 0xD80C6BD7, 0xEF66A9D6, 0xB6D8EFD4, 0x81B22DD5, + 0x04A462D0, 0x33CEA0D1, 0x6A70E6D3, 0x5D1A24D2, + 0x10FE5EC5, 0x27949CC4, 0x7E2ADAC6, 0x494018C7, + 0xCC5657C2, 0xFB3C95C3, 0xA282D3C1, 0x95E811C0, + 0xA8AF4DCB, 0x9FC58FCA, 0xC67BC9C8, 0xF1110BC9, + 0x740744CC, 0x436D86CD, 0x1AD3C0CF, 0x2DB902CE, + 0x4096AF91, 0x77FC6D90, 0x2E422B92, 0x1928E993, + 0x9C3EA696, 0xAB546497, 0xF2EA2295, 0xC580E094, + 0xF8C7BC9F, 0xCFAD7E9E, 0x9613389C, 0xA179FA9D, + 0x246FB598, 0x13057799, 0x4ABB319B, 0x7DD1F39A, + 0x3035898D, 0x075F4B8C, 0x5EE10D8E, 0x698BCF8F, + 0xEC9D808A, 0xDBF7428B, 0x82490489, 0xB523C688, + 0x88649A83, 0xBF0E5882, 0xE6B01E80, 0xD1DADC81, + 0x54CC9384, 0x63A65185, 0x3A181787, 0x0D72D586, + 0xA0D0E2A9, 0x97BA20A8, 0xCE0466AA, 0xF96EA4AB, + 0x7C78EBAE, 0x4B1229AF, 0x12AC6FAD, 0x25C6ADAC, + 0x1881F1A7, 0x2FEB33A6, 0x765575A4, 0x413FB7A5, + 0xC429F8A0, 0xF3433AA1, 0xAAFD7CA3, 0x9D97BEA2, + 0xD073C4B5, 0xE71906B4, 0xBEA740B6, 0x89CD82B7, + 0x0CDBCDB2, 0x3BB10FB3, 0x620F49B1, 0x55658BB0, + 0x6822D7BB, 0x5F4815BA, 0x06F653B8, 0x319C91B9, + 0xB48ADEBC, 0x83E01CBD, 0xDA5E5ABF, 0xED3498BE + }, { + 0x00000000, 0x6567BCB8, 0x8BC809AA, 0xEEAFB512, + 0x5797628F, 0x32F0DE37, 0xDC5F6B25, 0xB938D79D, + 0xEF28B4C5, 0x8A4F087D, 0x64E0BD6F, 0x018701D7, + 0xB8BFD64A, 0xDDD86AF2, 0x3377DFE0, 0x56106358, + 0x9F571950, 0xFA30A5E8, 0x149F10FA, 0x71F8AC42, + 0xC8C07BDF, 0xADA7C767, 0x43087275, 0x266FCECD, + 0x707FAD95, 0x1518112D, 0xFBB7A43F, 0x9ED01887, + 0x27E8CF1A, 0x428F73A2, 0xAC20C6B0, 0xC9477A08, + 0x3EAF32A0, 0x5BC88E18, 0xB5673B0A, 0xD00087B2, + 0x6938502F, 0x0C5FEC97, 0xE2F05985, 0x8797E53D, + 0xD1878665, 0xB4E03ADD, 0x5A4F8FCF, 0x3F283377, + 0x8610E4EA, 0xE3775852, 0x0DD8ED40, 0x68BF51F8, + 0xA1F82BF0, 0xC49F9748, 0x2A30225A, 0x4F579EE2, + 0xF66F497F, 0x9308F5C7, 0x7DA740D5, 0x18C0FC6D, + 0x4ED09F35, 0x2BB7238D, 0xC518969F, 0xA07F2A27, + 0x1947FDBA, 0x7C204102, 0x928FF410, 0xF7E848A8, + 0x3D58149B, 0x583FA823, 0xB6901D31, 0xD3F7A189, + 0x6ACF7614, 0x0FA8CAAC, 0xE1077FBE, 0x8460C306, + 0xD270A05E, 0xB7171CE6, 0x59B8A9F4, 0x3CDF154C, + 0x85E7C2D1, 0xE0807E69, 0x0E2FCB7B, 0x6B4877C3, + 0xA20F0DCB, 0xC768B173, 0x29C70461, 0x4CA0B8D9, + 0xF5986F44, 0x90FFD3FC, 0x7E5066EE, 0x1B37DA56, + 0x4D27B90E, 0x284005B6, 0xC6EFB0A4, 0xA3880C1C, + 0x1AB0DB81, 0x7FD76739, 0x9178D22B, 0xF41F6E93, + 0x03F7263B, 0x66909A83, 0x883F2F91, 0xED589329, + 0x546044B4, 0x3107F80C, 0xDFA84D1E, 0xBACFF1A6, + 0xECDF92FE, 0x89B82E46, 0x67179B54, 0x027027EC, + 0xBB48F071, 0xDE2F4CC9, 0x3080F9DB, 0x55E74563, + 0x9CA03F6B, 0xF9C783D3, 0x176836C1, 0x720F8A79, + 0xCB375DE4, 0xAE50E15C, 0x40FF544E, 0x2598E8F6, + 0x73888BAE, 0x16EF3716, 0xF8408204, 0x9D273EBC, + 0x241FE921, 0x41785599, 0xAFD7E08B, 0xCAB05C33, + 0x3BB659ED, 0x5ED1E555, 0xB07E5047, 0xD519ECFF, + 0x6C213B62, 0x094687DA, 0xE7E932C8, 0x828E8E70, + 0xD49EED28, 0xB1F95190, 0x5F56E482, 0x3A31583A, + 0x83098FA7, 0xE66E331F, 0x08C1860D, 0x6DA63AB5, + 0xA4E140BD, 0xC186FC05, 0x2F294917, 0x4A4EF5AF, + 0xF3762232, 0x96119E8A, 0x78BE2B98, 0x1DD99720, + 0x4BC9F478, 0x2EAE48C0, 0xC001FDD2, 0xA566416A, + 0x1C5E96F7, 0x79392A4F, 0x97969F5D, 0xF2F123E5, + 0x05196B4D, 0x607ED7F5, 0x8ED162E7, 0xEBB6DE5F, + 0x528E09C2, 0x37E9B57A, 0xD9460068, 0xBC21BCD0, + 0xEA31DF88, 0x8F566330, 0x61F9D622, 0x049E6A9A, + 0xBDA6BD07, 0xD8C101BF, 0x366EB4AD, 0x53090815, + 0x9A4E721D, 0xFF29CEA5, 0x11867BB7, 0x74E1C70F, + 0xCDD91092, 0xA8BEAC2A, 0x46111938, 0x2376A580, + 0x7566C6D8, 0x10017A60, 0xFEAECF72, 0x9BC973CA, + 0x22F1A457, 0x479618EF, 0xA939ADFD, 0xCC5E1145, + 0x06EE4D76, 0x6389F1CE, 0x8D2644DC, 0xE841F864, + 0x51792FF9, 0x341E9341, 0xDAB12653, 0xBFD69AEB, + 0xE9C6F9B3, 0x8CA1450B, 0x620EF019, 0x07694CA1, + 0xBE519B3C, 0xDB362784, 0x35999296, 0x50FE2E2E, + 0x99B95426, 0xFCDEE89E, 0x12715D8C, 0x7716E134, + 0xCE2E36A9, 0xAB498A11, 0x45E63F03, 0x208183BB, + 0x7691E0E3, 0x13F65C5B, 0xFD59E949, 0x983E55F1, + 0x2106826C, 0x44613ED4, 0xAACE8BC6, 0xCFA9377E, + 0x38417FD6, 0x5D26C36E, 0xB389767C, 0xD6EECAC4, + 0x6FD61D59, 0x0AB1A1E1, 0xE41E14F3, 0x8179A84B, + 0xD769CB13, 0xB20E77AB, 0x5CA1C2B9, 0x39C67E01, + 0x80FEA99C, 0xE5991524, 0x0B36A036, 0x6E511C8E, + 0xA7166686, 0xC271DA3E, 0x2CDE6F2C, 0x49B9D394, + 0xF0810409, 0x95E6B8B1, 0x7B490DA3, 0x1E2EB11B, + 0x483ED243, 0x2D596EFB, 0xC3F6DBE9, 0xA6916751, + 0x1FA9B0CC, 0x7ACE0C74, 0x9461B966, 0xF10605DE + }, { + 0x00000000, 0xB029603D, 0x6053C07A, 0xD07AA047, + 0xC0A680F5, 0x708FE0C8, 0xA0F5408F, 0x10DC20B2, + 0xC14B7030, 0x7162100D, 0xA118B04A, 0x1131D077, + 0x01EDF0C5, 0xB1C490F8, 0x61BE30BF, 0xD1975082, + 0x8297E060, 0x32BE805D, 0xE2C4201A, 0x52ED4027, + 0x42316095, 0xF21800A8, 0x2262A0EF, 0x924BC0D2, + 0x43DC9050, 0xF3F5F06D, 0x238F502A, 0x93A63017, + 0x837A10A5, 0x33537098, 0xE329D0DF, 0x5300B0E2, + 0x042FC1C1, 0xB406A1FC, 0x647C01BB, 0xD4556186, + 0xC4894134, 0x74A02109, 0xA4DA814E, 0x14F3E173, + 0xC564B1F1, 0x754DD1CC, 0xA537718B, 0x151E11B6, + 0x05C23104, 0xB5EB5139, 0x6591F17E, 0xD5B89143, + 0x86B821A1, 0x3691419C, 0xE6EBE1DB, 0x56C281E6, + 0x461EA154, 0xF637C169, 0x264D612E, 0x96640113, + 0x47F35191, 0xF7DA31AC, 0x27A091EB, 0x9789F1D6, + 0x8755D164, 0x377CB159, 0xE706111E, 0x572F7123, + 0x4958F358, 0xF9719365, 0x290B3322, 0x9922531F, + 0x89FE73AD, 0x39D71390, 0xE9ADB3D7, 0x5984D3EA, + 0x88138368, 0x383AE355, 0xE8404312, 0x5869232F, + 0x48B5039D, 0xF89C63A0, 0x28E6C3E7, 0x98CFA3DA, + 0xCBCF1338, 0x7BE67305, 0xAB9CD342, 0x1BB5B37F, + 0x0B6993CD, 0xBB40F3F0, 0x6B3A53B7, 0xDB13338A, + 0x0A846308, 0xBAAD0335, 0x6AD7A372, 0xDAFEC34F, + 0xCA22E3FD, 0x7A0B83C0, 0xAA712387, 0x1A5843BA, + 0x4D773299, 0xFD5E52A4, 0x2D24F2E3, 0x9D0D92DE, + 0x8DD1B26C, 0x3DF8D251, 0xED827216, 0x5DAB122B, + 0x8C3C42A9, 0x3C152294, 0xEC6F82D3, 0x5C46E2EE, + 0x4C9AC25C, 0xFCB3A261, 0x2CC90226, 0x9CE0621B, + 0xCFE0D2F9, 0x7FC9B2C4, 0xAFB31283, 0x1F9A72BE, + 0x0F46520C, 0xBF6F3231, 0x6F159276, 0xDF3CF24B, + 0x0EABA2C9, 0xBE82C2F4, 0x6EF862B3, 0xDED1028E, + 0xCE0D223C, 0x7E244201, 0xAE5EE246, 0x1E77827B, + 0x92B0E6B1, 0x2299868C, 0xF2E326CB, 0x42CA46F6, + 0x52166644, 0xE23F0679, 0x3245A63E, 0x826CC603, + 0x53FB9681, 0xE3D2F6BC, 0x33A856FB, 0x838136C6, + 0x935D1674, 0x23747649, 0xF30ED60E, 0x4327B633, + 0x102706D1, 0xA00E66EC, 0x7074C6AB, 0xC05DA696, + 0xD0818624, 0x60A8E619, 0xB0D2465E, 0x00FB2663, + 0xD16C76E1, 0x614516DC, 0xB13FB69B, 0x0116D6A6, + 0x11CAF614, 0xA1E39629, 0x7199366E, 0xC1B05653, + 0x969F2770, 0x26B6474D, 0xF6CCE70A, 0x46E58737, + 0x5639A785, 0xE610C7B8, 0x366A67FF, 0x864307C2, + 0x57D45740, 0xE7FD377D, 0x3787973A, 0x87AEF707, + 0x9772D7B5, 0x275BB788, 0xF72117CF, 0x470877F2, + 0x1408C710, 0xA421A72D, 0x745B076A, 0xC4726757, + 0xD4AE47E5, 0x648727D8, 0xB4FD879F, 0x04D4E7A2, + 0xD543B720, 0x656AD71D, 0xB510775A, 0x05391767, + 0x15E537D5, 0xA5CC57E8, 0x75B6F7AF, 0xC59F9792, + 0xDBE815E9, 0x6BC175D4, 0xBBBBD593, 0x0B92B5AE, + 0x1B4E951C, 0xAB67F521, 0x7B1D5566, 0xCB34355B, + 0x1AA365D9, 0xAA8A05E4, 0x7AF0A5A3, 0xCAD9C59E, + 0xDA05E52C, 0x6A2C8511, 0xBA562556, 0x0A7F456B, + 0x597FF589, 0xE95695B4, 0x392C35F3, 0x890555CE, + 0x99D9757C, 0x29F01541, 0xF98AB506, 0x49A3D53B, + 0x983485B9, 0x281DE584, 0xF86745C3, 0x484E25FE, + 0x5892054C, 0xE8BB6571, 0x38C1C536, 0x88E8A50B, + 0xDFC7D428, 0x6FEEB415, 0xBF941452, 0x0FBD746F, + 0x1F6154DD, 0xAF4834E0, 0x7F3294A7, 0xCF1BF49A, + 0x1E8CA418, 0xAEA5C425, 0x7EDF6462, 0xCEF6045F, + 0xDE2A24ED, 0x6E0344D0, 0xBE79E497, 0x0E5084AA, + 0x5D503448, 0xED795475, 0x3D03F432, 0x8D2A940F, + 0x9DF6B4BD, 0x2DDFD480, 0xFDA574C7, 0x4D8C14FA, + 0x9C1B4478, 0x2C322445, 0xFC488402, 0x4C61E43F, + 0x5CBDC48D, 0xEC94A4B0, 0x3CEE04F7, 0x8CC764CA + }, { + 0x00000000, 0xA5D35CCB, 0x0BA1C84D, 0xAE729486, + 0x1642919B, 0xB391CD50, 0x1DE359D6, 0xB830051D, + 0x6D8253EC, 0xC8510F27, 0x66239BA1, 0xC3F0C76A, + 0x7BC0C277, 0xDE139EBC, 0x70610A3A, 0xD5B256F1, + 0x9B02D603, 0x3ED18AC8, 0x90A31E4E, 0x35704285, + 0x8D404798, 0x28931B53, 0x86E18FD5, 0x2332D31E, + 0xF68085EF, 0x5353D924, 0xFD214DA2, 0x58F21169, + 0xE0C21474, 0x451148BF, 0xEB63DC39, 0x4EB080F2, + 0x3605AC07, 0x93D6F0CC, 0x3DA4644A, 0x98773881, + 0x20473D9C, 0x85946157, 0x2BE6F5D1, 0x8E35A91A, + 0x5B87FFEB, 0xFE54A320, 0x502637A6, 0xF5F56B6D, + 0x4DC56E70, 0xE81632BB, 0x4664A63D, 0xE3B7FAF6, + 0xAD077A04, 0x08D426CF, 0xA6A6B249, 0x0375EE82, + 0xBB45EB9F, 0x1E96B754, 0xB0E423D2, 0x15377F19, + 0xC08529E8, 0x65567523, 0xCB24E1A5, 0x6EF7BD6E, + 0xD6C7B873, 0x7314E4B8, 0xDD66703E, 0x78B52CF5, + 0x6C0A580F, 0xC9D904C4, 0x67AB9042, 0xC278CC89, + 0x7A48C994, 0xDF9B955F, 0x71E901D9, 0xD43A5D12, + 0x01880BE3, 0xA45B5728, 0x0A29C3AE, 0xAFFA9F65, + 0x17CA9A78, 0xB219C6B3, 0x1C6B5235, 0xB9B80EFE, + 0xF7088E0C, 0x52DBD2C7, 0xFCA94641, 0x597A1A8A, + 0xE14A1F97, 0x4499435C, 0xEAEBD7DA, 0x4F388B11, + 0x9A8ADDE0, 0x3F59812B, 0x912B15AD, 0x34F84966, + 0x8CC84C7B, 0x291B10B0, 0x87698436, 0x22BAD8FD, + 0x5A0FF408, 0xFFDCA8C3, 0x51AE3C45, 0xF47D608E, + 0x4C4D6593, 0xE99E3958, 0x47ECADDE, 0xE23FF115, + 0x378DA7E4, 0x925EFB2F, 0x3C2C6FA9, 0x99FF3362, + 0x21CF367F, 0x841C6AB4, 0x2A6EFE32, 0x8FBDA2F9, + 0xC10D220B, 0x64DE7EC0, 0xCAACEA46, 0x6F7FB68D, + 0xD74FB390, 0x729CEF5B, 0xDCEE7BDD, 0x793D2716, + 0xAC8F71E7, 0x095C2D2C, 0xA72EB9AA, 0x02FDE561, + 0xBACDE07C, 0x1F1EBCB7, 0xB16C2831, 0x14BF74FA, + 0xD814B01E, 0x7DC7ECD5, 0xD3B57853, 0x76662498, + 0xCE562185, 0x6B857D4E, 0xC5F7E9C8, 0x6024B503, + 0xB596E3F2, 0x1045BF39, 0xBE372BBF, 0x1BE47774, + 0xA3D47269, 0x06072EA2, 0xA875BA24, 0x0DA6E6EF, + 0x4316661D, 0xE6C53AD6, 0x48B7AE50, 0xED64F29B, + 0x5554F786, 0xF087AB4D, 0x5EF53FCB, 0xFB266300, + 0x2E9435F1, 0x8B47693A, 0x2535FDBC, 0x80E6A177, + 0x38D6A46A, 0x9D05F8A1, 0x33776C27, 0x96A430EC, + 0xEE111C19, 0x4BC240D2, 0xE5B0D454, 0x4063889F, + 0xF8538D82, 0x5D80D149, 0xF3F245CF, 0x56211904, + 0x83934FF5, 0x2640133E, 0x883287B8, 0x2DE1DB73, + 0x95D1DE6E, 0x300282A5, 0x9E701623, 0x3BA34AE8, + 0x7513CA1A, 0xD0C096D1, 0x7EB20257, 0xDB615E9C, + 0x63515B81, 0xC682074A, 0x68F093CC, 0xCD23CF07, + 0x189199F6, 0xBD42C53D, 0x133051BB, 0xB6E30D70, + 0x0ED3086D, 0xAB0054A6, 0x0572C020, 0xA0A19CEB, + 0xB41EE811, 0x11CDB4DA, 0xBFBF205C, 0x1A6C7C97, + 0xA25C798A, 0x078F2541, 0xA9FDB1C7, 0x0C2EED0C, + 0xD99CBBFD, 0x7C4FE736, 0xD23D73B0, 0x77EE2F7B, + 0xCFDE2A66, 0x6A0D76AD, 0xC47FE22B, 0x61ACBEE0, + 0x2F1C3E12, 0x8ACF62D9, 0x24BDF65F, 0x816EAA94, + 0x395EAF89, 0x9C8DF342, 0x32FF67C4, 0x972C3B0F, + 0x429E6DFE, 0xE74D3135, 0x493FA5B3, 0xECECF978, + 0x54DCFC65, 0xF10FA0AE, 0x5F7D3428, 0xFAAE68E3, + 0x821B4416, 0x27C818DD, 0x89BA8C5B, 0x2C69D090, + 0x9459D58D, 0x318A8946, 0x9FF81DC0, 0x3A2B410B, + 0xEF9917FA, 0x4A4A4B31, 0xE438DFB7, 0x41EB837C, + 0xF9DB8661, 0x5C08DAAA, 0xF27A4E2C, 0x57A912E7, + 0x19199215, 0xBCCACEDE, 0x12B85A58, 0xB76B0693, + 0x0F5B038E, 0xAA885F45, 0x04FACBC3, 0xA1299708, + 0x749BC1F9, 0xD1489D32, 0x7F3A09B4, 0xDAE9557F, + 0x62D95062, 0xC70A0CA9, 0x6978982F, 0xCCABC4E4 + }, { + 0x00000000, 0xB40B77A6, 0x29119F97, 0x9D1AE831, + 0x13244FF4, 0xA72F3852, 0x3A35D063, 0x8E3EA7C5, + 0x674EEF33, 0xD3459895, 0x4E5F70A4, 0xFA540702, + 0x746AA0C7, 0xC061D761, 0x5D7B3F50, 0xE97048F6, + 0xCE9CDE67, 0x7A97A9C1, 0xE78D41F0, 0x53863656, + 0xDDB89193, 0x69B3E635, 0xF4A90E04, 0x40A279A2, + 0xA9D23154, 0x1DD946F2, 0x80C3AEC3, 0x34C8D965, + 0xBAF67EA0, 0x0EFD0906, 0x93E7E137, 0x27EC9691, + 0x9C39BDCF, 0x2832CA69, 0xB5282258, 0x012355FE, + 0x8F1DF23B, 0x3B16859D, 0xA60C6DAC, 0x12071A0A, + 0xFB7752FC, 0x4F7C255A, 0xD266CD6B, 0x666DBACD, + 0xE8531D08, 0x5C586AAE, 0xC142829F, 0x7549F539, + 0x52A563A8, 0xE6AE140E, 0x7BB4FC3F, 0xCFBF8B99, + 0x41812C5C, 0xF58A5BFA, 0x6890B3CB, 0xDC9BC46D, + 0x35EB8C9B, 0x81E0FB3D, 0x1CFA130C, 0xA8F164AA, + 0x26CFC36F, 0x92C4B4C9, 0x0FDE5CF8, 0xBBD52B5E, + 0x79750B44, 0xCD7E7CE2, 0x506494D3, 0xE46FE375, + 0x6A5144B0, 0xDE5A3316, 0x4340DB27, 0xF74BAC81, + 0x1E3BE477, 0xAA3093D1, 0x372A7BE0, 0x83210C46, + 0x0D1FAB83, 0xB914DC25, 0x240E3414, 0x900543B2, + 0xB7E9D523, 0x03E2A285, 0x9EF84AB4, 0x2AF33D12, + 0xA4CD9AD7, 0x10C6ED71, 0x8DDC0540, 0x39D772E6, + 0xD0A73A10, 0x64AC4DB6, 0xF9B6A587, 0x4DBDD221, + 0xC38375E4, 0x77880242, 0xEA92EA73, 0x5E999DD5, + 0xE54CB68B, 0x5147C12D, 0xCC5D291C, 0x78565EBA, + 0xF668F97F, 0x42638ED9, 0xDF7966E8, 0x6B72114E, + 0x820259B8, 0x36092E1E, 0xAB13C62F, 0x1F18B189, + 0x9126164C, 0x252D61EA, 0xB83789DB, 0x0C3CFE7D, + 0x2BD068EC, 0x9FDB1F4A, 0x02C1F77B, 0xB6CA80DD, + 0x38F42718, 0x8CFF50BE, 0x11E5B88F, 0xA5EECF29, + 0x4C9E87DF, 0xF895F079, 0x658F1848, 0xD1846FEE, + 0x5FBAC82B, 0xEBB1BF8D, 0x76AB57BC, 0xC2A0201A, + 0xF2EA1688, 0x46E1612E, 0xDBFB891F, 0x6FF0FEB9, + 0xE1CE597C, 0x55C52EDA, 0xC8DFC6EB, 0x7CD4B14D, + 0x95A4F9BB, 0x21AF8E1D, 0xBCB5662C, 0x08BE118A, + 0x8680B64F, 0x328BC1E9, 0xAF9129D8, 0x1B9A5E7E, + 0x3C76C8EF, 0x887DBF49, 0x15675778, 0xA16C20DE, + 0x2F52871B, 0x9B59F0BD, 0x0643188C, 0xB2486F2A, + 0x5B3827DC, 0xEF33507A, 0x7229B84B, 0xC622CFED, + 0x481C6828, 0xFC171F8E, 0x610DF7BF, 0xD5068019, + 0x6ED3AB47, 0xDAD8DCE1, 0x47C234D0, 0xF3C94376, + 0x7DF7E4B3, 0xC9FC9315, 0x54E67B24, 0xE0ED0C82, + 0x099D4474, 0xBD9633D2, 0x208CDBE3, 0x9487AC45, + 0x1AB90B80, 0xAEB27C26, 0x33A89417, 0x87A3E3B1, + 0xA04F7520, 0x14440286, 0x895EEAB7, 0x3D559D11, + 0xB36B3AD4, 0x07604D72, 0x9A7AA543, 0x2E71D2E5, + 0xC7019A13, 0x730AEDB5, 0xEE100584, 0x5A1B7222, + 0xD425D5E7, 0x602EA241, 0xFD344A70, 0x493F3DD6, + 0x8B9F1DCC, 0x3F946A6A, 0xA28E825B, 0x1685F5FD, + 0x98BB5238, 0x2CB0259E, 0xB1AACDAF, 0x05A1BA09, + 0xECD1F2FF, 0x58DA8559, 0xC5C06D68, 0x71CB1ACE, + 0xFFF5BD0B, 0x4BFECAAD, 0xD6E4229C, 0x62EF553A, + 0x4503C3AB, 0xF108B40D, 0x6C125C3C, 0xD8192B9A, + 0x56278C5F, 0xE22CFBF9, 0x7F3613C8, 0xCB3D646E, + 0x224D2C98, 0x96465B3E, 0x0B5CB30F, 0xBF57C4A9, + 0x3169636C, 0x856214CA, 0x1878FCFB, 0xAC738B5D, + 0x17A6A003, 0xA3ADD7A5, 0x3EB73F94, 0x8ABC4832, + 0x0482EFF7, 0xB0899851, 0x2D937060, 0x999807C6, + 0x70E84F30, 0xC4E33896, 0x59F9D0A7, 0xEDF2A701, + 0x63CC00C4, 0xD7C77762, 0x4ADD9F53, 0xFED6E8F5, + 0xD93A7E64, 0x6D3109C2, 0xF02BE1F3, 0x44209655, + 0xCA1E3190, 0x7E154636, 0xE30FAE07, 0x5704D9A1, + 0xBE749157, 0x0A7FE6F1, 0x97650EC0, 0x236E7966, + 0xAD50DEA3, 0x195BA905, 0x84414134, 0x304A3692 + }, { + 0x00000000, 0x9E00AACC, 0x7D072542, 0xE3078F8E, + 0xFA0E4A84, 0x640EE048, 0x87096FC6, 0x1909C50A, + 0xB51BE5D3, 0x2B1B4F1F, 0xC81CC091, 0x561C6A5D, + 0x4F15AF57, 0xD115059B, 0x32128A15, 0xAC1220D9, + 0x2B31BB7C, 0xB53111B0, 0x56369E3E, 0xC83634F2, + 0xD13FF1F8, 0x4F3F5B34, 0xAC38D4BA, 0x32387E76, + 0x9E2A5EAF, 0x002AF463, 0xE32D7BED, 0x7D2DD121, + 0x6424142B, 0xFA24BEE7, 0x19233169, 0x87239BA5, + 0x566276F9, 0xC862DC35, 0x2B6553BB, 0xB565F977, + 0xAC6C3C7D, 0x326C96B1, 0xD16B193F, 0x4F6BB3F3, + 0xE379932A, 0x7D7939E6, 0x9E7EB668, 0x007E1CA4, + 0x1977D9AE, 0x87777362, 0x6470FCEC, 0xFA705620, + 0x7D53CD85, 0xE3536749, 0x0054E8C7, 0x9E54420B, + 0x875D8701, 0x195D2DCD, 0xFA5AA243, 0x645A088F, + 0xC8482856, 0x5648829A, 0xB54F0D14, 0x2B4FA7D8, + 0x324662D2, 0xAC46C81E, 0x4F414790, 0xD141ED5C, + 0xEDC29D29, 0x73C237E5, 0x90C5B86B, 0x0EC512A7, + 0x17CCD7AD, 0x89CC7D61, 0x6ACBF2EF, 0xF4CB5823, + 0x58D978FA, 0xC6D9D236, 0x25DE5DB8, 0xBBDEF774, + 0xA2D7327E, 0x3CD798B2, 0xDFD0173C, 0x41D0BDF0, + 0xC6F32655, 0x58F38C99, 0xBBF40317, 0x25F4A9DB, + 0x3CFD6CD1, 0xA2FDC61D, 0x41FA4993, 0xDFFAE35F, + 0x73E8C386, 0xEDE8694A, 0x0EEFE6C4, 0x90EF4C08, + 0x89E68902, 0x17E623CE, 0xF4E1AC40, 0x6AE1068C, + 0xBBA0EBD0, 0x25A0411C, 0xC6A7CE92, 0x58A7645E, + 0x41AEA154, 0xDFAE0B98, 0x3CA98416, 0xA2A92EDA, + 0x0EBB0E03, 0x90BBA4CF, 0x73BC2B41, 0xEDBC818D, + 0xF4B54487, 0x6AB5EE4B, 0x89B261C5, 0x17B2CB09, + 0x909150AC, 0x0E91FA60, 0xED9675EE, 0x7396DF22, + 0x6A9F1A28, 0xF49FB0E4, 0x17983F6A, 0x899895A6, + 0x258AB57F, 0xBB8A1FB3, 0x588D903D, 0xC68D3AF1, + 0xDF84FFFB, 0x41845537, 0xA283DAB9, 0x3C837075, + 0xDA853B53, 0x4485919F, 0xA7821E11, 0x3982B4DD, + 0x208B71D7, 0xBE8BDB1B, 0x5D8C5495, 0xC38CFE59, + 0x6F9EDE80, 0xF19E744C, 0x1299FBC2, 0x8C99510E, + 0x95909404, 0x0B903EC8, 0xE897B146, 0x76971B8A, + 0xF1B4802F, 0x6FB42AE3, 0x8CB3A56D, 0x12B30FA1, + 0x0BBACAAB, 0x95BA6067, 0x76BDEFE9, 0xE8BD4525, + 0x44AF65FC, 0xDAAFCF30, 0x39A840BE, 0xA7A8EA72, + 0xBEA12F78, 0x20A185B4, 0xC3A60A3A, 0x5DA6A0F6, + 0x8CE74DAA, 0x12E7E766, 0xF1E068E8, 0x6FE0C224, + 0x76E9072E, 0xE8E9ADE2, 0x0BEE226C, 0x95EE88A0, + 0x39FCA879, 0xA7FC02B5, 0x44FB8D3B, 0xDAFB27F7, + 0xC3F2E2FD, 0x5DF24831, 0xBEF5C7BF, 0x20F56D73, + 0xA7D6F6D6, 0x39D65C1A, 0xDAD1D394, 0x44D17958, + 0x5DD8BC52, 0xC3D8169E, 0x20DF9910, 0xBEDF33DC, + 0x12CD1305, 0x8CCDB9C9, 0x6FCA3647, 0xF1CA9C8B, + 0xE8C35981, 0x76C3F34D, 0x95C47CC3, 0x0BC4D60F, + 0x3747A67A, 0xA9470CB6, 0x4A408338, 0xD44029F4, + 0xCD49ECFE, 0x53494632, 0xB04EC9BC, 0x2E4E6370, + 0x825C43A9, 0x1C5CE965, 0xFF5B66EB, 0x615BCC27, + 0x7852092D, 0xE652A3E1, 0x05552C6F, 0x9B5586A3, + 0x1C761D06, 0x8276B7CA, 0x61713844, 0xFF719288, + 0xE6785782, 0x7878FD4E, 0x9B7F72C0, 0x057FD80C, + 0xA96DF8D5, 0x376D5219, 0xD46ADD97, 0x4A6A775B, + 0x5363B251, 0xCD63189D, 0x2E649713, 0xB0643DDF, + 0x6125D083, 0xFF257A4F, 0x1C22F5C1, 0x82225F0D, + 0x9B2B9A07, 0x052B30CB, 0xE62CBF45, 0x782C1589, + 0xD43E3550, 0x4A3E9F9C, 0xA9391012, 0x3739BADE, + 0x2E307FD4, 0xB030D518, 0x53375A96, 0xCD37F05A, + 0x4A146BFF, 0xD414C133, 0x37134EBD, 0xA913E471, + 0xB01A217B, 0x2E1A8BB7, 0xCD1D0439, 0x531DAEF5, + 0xFF0F8E2C, 0x610F24E0, 0x8208AB6E, 0x1C0801A2, + 0x0501C4A8, 0x9B016E64, 0x7806E1EA, 0xE6064B26 + } +}; diff --git a/src/liblzma/check/crc32_table_le.h b/src/liblzma/check/crc32_table_le.h new file mode 100644 index 000000000000..25f4fc443537 --- /dev/null +++ b/src/liblzma/check/crc32_table_le.h @@ -0,0 +1,525 @@ +/* This file has been automatically generated by crc32_tablegen.c. */ + +const uint32_t lzma_crc32_table[8][256] = { + { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D + }, { + 0x00000000, 0x191B3141, 0x32366282, 0x2B2D53C3, + 0x646CC504, 0x7D77F445, 0x565AA786, 0x4F4196C7, + 0xC8D98A08, 0xD1C2BB49, 0xFAEFE88A, 0xE3F4D9CB, + 0xACB54F0C, 0xB5AE7E4D, 0x9E832D8E, 0x87981CCF, + 0x4AC21251, 0x53D92310, 0x78F470D3, 0x61EF4192, + 0x2EAED755, 0x37B5E614, 0x1C98B5D7, 0x05838496, + 0x821B9859, 0x9B00A918, 0xB02DFADB, 0xA936CB9A, + 0xE6775D5D, 0xFF6C6C1C, 0xD4413FDF, 0xCD5A0E9E, + 0x958424A2, 0x8C9F15E3, 0xA7B24620, 0xBEA97761, + 0xF1E8E1A6, 0xE8F3D0E7, 0xC3DE8324, 0xDAC5B265, + 0x5D5DAEAA, 0x44469FEB, 0x6F6BCC28, 0x7670FD69, + 0x39316BAE, 0x202A5AEF, 0x0B07092C, 0x121C386D, + 0xDF4636F3, 0xC65D07B2, 0xED705471, 0xF46B6530, + 0xBB2AF3F7, 0xA231C2B6, 0x891C9175, 0x9007A034, + 0x179FBCFB, 0x0E848DBA, 0x25A9DE79, 0x3CB2EF38, + 0x73F379FF, 0x6AE848BE, 0x41C51B7D, 0x58DE2A3C, + 0xF0794F05, 0xE9627E44, 0xC24F2D87, 0xDB541CC6, + 0x94158A01, 0x8D0EBB40, 0xA623E883, 0xBF38D9C2, + 0x38A0C50D, 0x21BBF44C, 0x0A96A78F, 0x138D96CE, + 0x5CCC0009, 0x45D73148, 0x6EFA628B, 0x77E153CA, + 0xBABB5D54, 0xA3A06C15, 0x888D3FD6, 0x91960E97, + 0xDED79850, 0xC7CCA911, 0xECE1FAD2, 0xF5FACB93, + 0x7262D75C, 0x6B79E61D, 0x4054B5DE, 0x594F849F, + 0x160E1258, 0x0F152319, 0x243870DA, 0x3D23419B, + 0x65FD6BA7, 0x7CE65AE6, 0x57CB0925, 0x4ED03864, + 0x0191AEA3, 0x188A9FE2, 0x33A7CC21, 0x2ABCFD60, + 0xAD24E1AF, 0xB43FD0EE, 0x9F12832D, 0x8609B26C, + 0xC94824AB, 0xD05315EA, 0xFB7E4629, 0xE2657768, + 0x2F3F79F6, 0x362448B7, 0x1D091B74, 0x04122A35, + 0x4B53BCF2, 0x52488DB3, 0x7965DE70, 0x607EEF31, + 0xE7E6F3FE, 0xFEFDC2BF, 0xD5D0917C, 0xCCCBA03D, + 0x838A36FA, 0x9A9107BB, 0xB1BC5478, 0xA8A76539, + 0x3B83984B, 0x2298A90A, 0x09B5FAC9, 0x10AECB88, + 0x5FEF5D4F, 0x46F46C0E, 0x6DD93FCD, 0x74C20E8C, + 0xF35A1243, 0xEA412302, 0xC16C70C1, 0xD8774180, + 0x9736D747, 0x8E2DE606, 0xA500B5C5, 0xBC1B8484, + 0x71418A1A, 0x685ABB5B, 0x4377E898, 0x5A6CD9D9, + 0x152D4F1E, 0x0C367E5F, 0x271B2D9C, 0x3E001CDD, + 0xB9980012, 0xA0833153, 0x8BAE6290, 0x92B553D1, + 0xDDF4C516, 0xC4EFF457, 0xEFC2A794, 0xF6D996D5, + 0xAE07BCE9, 0xB71C8DA8, 0x9C31DE6B, 0x852AEF2A, + 0xCA6B79ED, 0xD37048AC, 0xF85D1B6F, 0xE1462A2E, + 0x66DE36E1, 0x7FC507A0, 0x54E85463, 0x4DF36522, + 0x02B2F3E5, 0x1BA9C2A4, 0x30849167, 0x299FA026, + 0xE4C5AEB8, 0xFDDE9FF9, 0xD6F3CC3A, 0xCFE8FD7B, + 0x80A96BBC, 0x99B25AFD, 0xB29F093E, 0xAB84387F, + 0x2C1C24B0, 0x350715F1, 0x1E2A4632, 0x07317773, + 0x4870E1B4, 0x516BD0F5, 0x7A468336, 0x635DB277, + 0xCBFAD74E, 0xD2E1E60F, 0xF9CCB5CC, 0xE0D7848D, + 0xAF96124A, 0xB68D230B, 0x9DA070C8, 0x84BB4189, + 0x03235D46, 0x1A386C07, 0x31153FC4, 0x280E0E85, + 0x674F9842, 0x7E54A903, 0x5579FAC0, 0x4C62CB81, + 0x8138C51F, 0x9823F45E, 0xB30EA79D, 0xAA1596DC, + 0xE554001B, 0xFC4F315A, 0xD7626299, 0xCE7953D8, + 0x49E14F17, 0x50FA7E56, 0x7BD72D95, 0x62CC1CD4, + 0x2D8D8A13, 0x3496BB52, 0x1FBBE891, 0x06A0D9D0, + 0x5E7EF3EC, 0x4765C2AD, 0x6C48916E, 0x7553A02F, + 0x3A1236E8, 0x230907A9, 0x0824546A, 0x113F652B, + 0x96A779E4, 0x8FBC48A5, 0xA4911B66, 0xBD8A2A27, + 0xF2CBBCE0, 0xEBD08DA1, 0xC0FDDE62, 0xD9E6EF23, + 0x14BCE1BD, 0x0DA7D0FC, 0x268A833F, 0x3F91B27E, + 0x70D024B9, 0x69CB15F8, 0x42E6463B, 0x5BFD777A, + 0xDC656BB5, 0xC57E5AF4, 0xEE530937, 0xF7483876, + 0xB809AEB1, 0xA1129FF0, 0x8A3FCC33, 0x9324FD72 + }, { + 0x00000000, 0x01C26A37, 0x0384D46E, 0x0246BE59, + 0x0709A8DC, 0x06CBC2EB, 0x048D7CB2, 0x054F1685, + 0x0E1351B8, 0x0FD13B8F, 0x0D9785D6, 0x0C55EFE1, + 0x091AF964, 0x08D89353, 0x0A9E2D0A, 0x0B5C473D, + 0x1C26A370, 0x1DE4C947, 0x1FA2771E, 0x1E601D29, + 0x1B2F0BAC, 0x1AED619B, 0x18ABDFC2, 0x1969B5F5, + 0x1235F2C8, 0x13F798FF, 0x11B126A6, 0x10734C91, + 0x153C5A14, 0x14FE3023, 0x16B88E7A, 0x177AE44D, + 0x384D46E0, 0x398F2CD7, 0x3BC9928E, 0x3A0BF8B9, + 0x3F44EE3C, 0x3E86840B, 0x3CC03A52, 0x3D025065, + 0x365E1758, 0x379C7D6F, 0x35DAC336, 0x3418A901, + 0x3157BF84, 0x3095D5B3, 0x32D36BEA, 0x331101DD, + 0x246BE590, 0x25A98FA7, 0x27EF31FE, 0x262D5BC9, + 0x23624D4C, 0x22A0277B, 0x20E69922, 0x2124F315, + 0x2A78B428, 0x2BBADE1F, 0x29FC6046, 0x283E0A71, + 0x2D711CF4, 0x2CB376C3, 0x2EF5C89A, 0x2F37A2AD, + 0x709A8DC0, 0x7158E7F7, 0x731E59AE, 0x72DC3399, + 0x7793251C, 0x76514F2B, 0x7417F172, 0x75D59B45, + 0x7E89DC78, 0x7F4BB64F, 0x7D0D0816, 0x7CCF6221, + 0x798074A4, 0x78421E93, 0x7A04A0CA, 0x7BC6CAFD, + 0x6CBC2EB0, 0x6D7E4487, 0x6F38FADE, 0x6EFA90E9, + 0x6BB5866C, 0x6A77EC5B, 0x68315202, 0x69F33835, + 0x62AF7F08, 0x636D153F, 0x612BAB66, 0x60E9C151, + 0x65A6D7D4, 0x6464BDE3, 0x662203BA, 0x67E0698D, + 0x48D7CB20, 0x4915A117, 0x4B531F4E, 0x4A917579, + 0x4FDE63FC, 0x4E1C09CB, 0x4C5AB792, 0x4D98DDA5, + 0x46C49A98, 0x4706F0AF, 0x45404EF6, 0x448224C1, + 0x41CD3244, 0x400F5873, 0x4249E62A, 0x438B8C1D, + 0x54F16850, 0x55330267, 0x5775BC3E, 0x56B7D609, + 0x53F8C08C, 0x523AAABB, 0x507C14E2, 0x51BE7ED5, + 0x5AE239E8, 0x5B2053DF, 0x5966ED86, 0x58A487B1, + 0x5DEB9134, 0x5C29FB03, 0x5E6F455A, 0x5FAD2F6D, + 0xE1351B80, 0xE0F771B7, 0xE2B1CFEE, 0xE373A5D9, + 0xE63CB35C, 0xE7FED96B, 0xE5B86732, 0xE47A0D05, + 0xEF264A38, 0xEEE4200F, 0xECA29E56, 0xED60F461, + 0xE82FE2E4, 0xE9ED88D3, 0xEBAB368A, 0xEA695CBD, + 0xFD13B8F0, 0xFCD1D2C7, 0xFE976C9E, 0xFF5506A9, + 0xFA1A102C, 0xFBD87A1B, 0xF99EC442, 0xF85CAE75, + 0xF300E948, 0xF2C2837F, 0xF0843D26, 0xF1465711, + 0xF4094194, 0xF5CB2BA3, 0xF78D95FA, 0xF64FFFCD, + 0xD9785D60, 0xD8BA3757, 0xDAFC890E, 0xDB3EE339, + 0xDE71F5BC, 0xDFB39F8B, 0xDDF521D2, 0xDC374BE5, + 0xD76B0CD8, 0xD6A966EF, 0xD4EFD8B6, 0xD52DB281, + 0xD062A404, 0xD1A0CE33, 0xD3E6706A, 0xD2241A5D, + 0xC55EFE10, 0xC49C9427, 0xC6DA2A7E, 0xC7184049, + 0xC25756CC, 0xC3953CFB, 0xC1D382A2, 0xC011E895, + 0xCB4DAFA8, 0xCA8FC59F, 0xC8C97BC6, 0xC90B11F1, + 0xCC440774, 0xCD866D43, 0xCFC0D31A, 0xCE02B92D, + 0x91AF9640, 0x906DFC77, 0x922B422E, 0x93E92819, + 0x96A63E9C, 0x976454AB, 0x9522EAF2, 0x94E080C5, + 0x9FBCC7F8, 0x9E7EADCF, 0x9C381396, 0x9DFA79A1, + 0x98B56F24, 0x99770513, 0x9B31BB4A, 0x9AF3D17D, + 0x8D893530, 0x8C4B5F07, 0x8E0DE15E, 0x8FCF8B69, + 0x8A809DEC, 0x8B42F7DB, 0x89044982, 0x88C623B5, + 0x839A6488, 0x82580EBF, 0x801EB0E6, 0x81DCDAD1, + 0x8493CC54, 0x8551A663, 0x8717183A, 0x86D5720D, + 0xA9E2D0A0, 0xA820BA97, 0xAA6604CE, 0xABA46EF9, + 0xAEEB787C, 0xAF29124B, 0xAD6FAC12, 0xACADC625, + 0xA7F18118, 0xA633EB2F, 0xA4755576, 0xA5B73F41, + 0xA0F829C4, 0xA13A43F3, 0xA37CFDAA, 0xA2BE979D, + 0xB5C473D0, 0xB40619E7, 0xB640A7BE, 0xB782CD89, + 0xB2CDDB0C, 0xB30FB13B, 0xB1490F62, 0xB08B6555, + 0xBBD72268, 0xBA15485F, 0xB853F606, 0xB9919C31, + 0xBCDE8AB4, 0xBD1CE083, 0xBF5A5EDA, 0xBE9834ED + }, { + 0x00000000, 0xB8BC6765, 0xAA09C88B, 0x12B5AFEE, + 0x8F629757, 0x37DEF032, 0x256B5FDC, 0x9DD738B9, + 0xC5B428EF, 0x7D084F8A, 0x6FBDE064, 0xD7018701, + 0x4AD6BFB8, 0xF26AD8DD, 0xE0DF7733, 0x58631056, + 0x5019579F, 0xE8A530FA, 0xFA109F14, 0x42ACF871, + 0xDF7BC0C8, 0x67C7A7AD, 0x75720843, 0xCDCE6F26, + 0x95AD7F70, 0x2D111815, 0x3FA4B7FB, 0x8718D09E, + 0x1ACFE827, 0xA2738F42, 0xB0C620AC, 0x087A47C9, + 0xA032AF3E, 0x188EC85B, 0x0A3B67B5, 0xB28700D0, + 0x2F503869, 0x97EC5F0C, 0x8559F0E2, 0x3DE59787, + 0x658687D1, 0xDD3AE0B4, 0xCF8F4F5A, 0x7733283F, + 0xEAE41086, 0x525877E3, 0x40EDD80D, 0xF851BF68, + 0xF02BF8A1, 0x48979FC4, 0x5A22302A, 0xE29E574F, + 0x7F496FF6, 0xC7F50893, 0xD540A77D, 0x6DFCC018, + 0x359FD04E, 0x8D23B72B, 0x9F9618C5, 0x272A7FA0, + 0xBAFD4719, 0x0241207C, 0x10F48F92, 0xA848E8F7, + 0x9B14583D, 0x23A83F58, 0x311D90B6, 0x89A1F7D3, + 0x1476CF6A, 0xACCAA80F, 0xBE7F07E1, 0x06C36084, + 0x5EA070D2, 0xE61C17B7, 0xF4A9B859, 0x4C15DF3C, + 0xD1C2E785, 0x697E80E0, 0x7BCB2F0E, 0xC377486B, + 0xCB0D0FA2, 0x73B168C7, 0x6104C729, 0xD9B8A04C, + 0x446F98F5, 0xFCD3FF90, 0xEE66507E, 0x56DA371B, + 0x0EB9274D, 0xB6054028, 0xA4B0EFC6, 0x1C0C88A3, + 0x81DBB01A, 0x3967D77F, 0x2BD27891, 0x936E1FF4, + 0x3B26F703, 0x839A9066, 0x912F3F88, 0x299358ED, + 0xB4446054, 0x0CF80731, 0x1E4DA8DF, 0xA6F1CFBA, + 0xFE92DFEC, 0x462EB889, 0x549B1767, 0xEC277002, + 0x71F048BB, 0xC94C2FDE, 0xDBF98030, 0x6345E755, + 0x6B3FA09C, 0xD383C7F9, 0xC1366817, 0x798A0F72, + 0xE45D37CB, 0x5CE150AE, 0x4E54FF40, 0xF6E89825, + 0xAE8B8873, 0x1637EF16, 0x048240F8, 0xBC3E279D, + 0x21E91F24, 0x99557841, 0x8BE0D7AF, 0x335CB0CA, + 0xED59B63B, 0x55E5D15E, 0x47507EB0, 0xFFEC19D5, + 0x623B216C, 0xDA874609, 0xC832E9E7, 0x708E8E82, + 0x28ED9ED4, 0x9051F9B1, 0x82E4565F, 0x3A58313A, + 0xA78F0983, 0x1F336EE6, 0x0D86C108, 0xB53AA66D, + 0xBD40E1A4, 0x05FC86C1, 0x1749292F, 0xAFF54E4A, + 0x322276F3, 0x8A9E1196, 0x982BBE78, 0x2097D91D, + 0x78F4C94B, 0xC048AE2E, 0xD2FD01C0, 0x6A4166A5, + 0xF7965E1C, 0x4F2A3979, 0x5D9F9697, 0xE523F1F2, + 0x4D6B1905, 0xF5D77E60, 0xE762D18E, 0x5FDEB6EB, + 0xC2098E52, 0x7AB5E937, 0x680046D9, 0xD0BC21BC, + 0x88DF31EA, 0x3063568F, 0x22D6F961, 0x9A6A9E04, + 0x07BDA6BD, 0xBF01C1D8, 0xADB46E36, 0x15080953, + 0x1D724E9A, 0xA5CE29FF, 0xB77B8611, 0x0FC7E174, + 0x9210D9CD, 0x2AACBEA8, 0x38191146, 0x80A57623, + 0xD8C66675, 0x607A0110, 0x72CFAEFE, 0xCA73C99B, + 0x57A4F122, 0xEF189647, 0xFDAD39A9, 0x45115ECC, + 0x764DEE06, 0xCEF18963, 0xDC44268D, 0x64F841E8, + 0xF92F7951, 0x41931E34, 0x5326B1DA, 0xEB9AD6BF, + 0xB3F9C6E9, 0x0B45A18C, 0x19F00E62, 0xA14C6907, + 0x3C9B51BE, 0x842736DB, 0x96929935, 0x2E2EFE50, + 0x2654B999, 0x9EE8DEFC, 0x8C5D7112, 0x34E11677, + 0xA9362ECE, 0x118A49AB, 0x033FE645, 0xBB838120, + 0xE3E09176, 0x5B5CF613, 0x49E959FD, 0xF1553E98, + 0x6C820621, 0xD43E6144, 0xC68BCEAA, 0x7E37A9CF, + 0xD67F4138, 0x6EC3265D, 0x7C7689B3, 0xC4CAEED6, + 0x591DD66F, 0xE1A1B10A, 0xF3141EE4, 0x4BA87981, + 0x13CB69D7, 0xAB770EB2, 0xB9C2A15C, 0x017EC639, + 0x9CA9FE80, 0x241599E5, 0x36A0360B, 0x8E1C516E, + 0x866616A7, 0x3EDA71C2, 0x2C6FDE2C, 0x94D3B949, + 0x090481F0, 0xB1B8E695, 0xA30D497B, 0x1BB12E1E, + 0x43D23E48, 0xFB6E592D, 0xE9DBF6C3, 0x516791A6, + 0xCCB0A91F, 0x740CCE7A, 0x66B96194, 0xDE0506F1 + }, { + 0x00000000, 0x3D6029B0, 0x7AC05360, 0x47A07AD0, + 0xF580A6C0, 0xC8E08F70, 0x8F40F5A0, 0xB220DC10, + 0x30704BC1, 0x0D106271, 0x4AB018A1, 0x77D03111, + 0xC5F0ED01, 0xF890C4B1, 0xBF30BE61, 0x825097D1, + 0x60E09782, 0x5D80BE32, 0x1A20C4E2, 0x2740ED52, + 0x95603142, 0xA80018F2, 0xEFA06222, 0xD2C04B92, + 0x5090DC43, 0x6DF0F5F3, 0x2A508F23, 0x1730A693, + 0xA5107A83, 0x98705333, 0xDFD029E3, 0xE2B00053, + 0xC1C12F04, 0xFCA106B4, 0xBB017C64, 0x866155D4, + 0x344189C4, 0x0921A074, 0x4E81DAA4, 0x73E1F314, + 0xF1B164C5, 0xCCD14D75, 0x8B7137A5, 0xB6111E15, + 0x0431C205, 0x3951EBB5, 0x7EF19165, 0x4391B8D5, + 0xA121B886, 0x9C419136, 0xDBE1EBE6, 0xE681C256, + 0x54A11E46, 0x69C137F6, 0x2E614D26, 0x13016496, + 0x9151F347, 0xAC31DAF7, 0xEB91A027, 0xD6F18997, + 0x64D15587, 0x59B17C37, 0x1E1106E7, 0x23712F57, + 0x58F35849, 0x659371F9, 0x22330B29, 0x1F532299, + 0xAD73FE89, 0x9013D739, 0xD7B3ADE9, 0xEAD38459, + 0x68831388, 0x55E33A38, 0x124340E8, 0x2F236958, + 0x9D03B548, 0xA0639CF8, 0xE7C3E628, 0xDAA3CF98, + 0x3813CFCB, 0x0573E67B, 0x42D39CAB, 0x7FB3B51B, + 0xCD93690B, 0xF0F340BB, 0xB7533A6B, 0x8A3313DB, + 0x0863840A, 0x3503ADBA, 0x72A3D76A, 0x4FC3FEDA, + 0xFDE322CA, 0xC0830B7A, 0x872371AA, 0xBA43581A, + 0x9932774D, 0xA4525EFD, 0xE3F2242D, 0xDE920D9D, + 0x6CB2D18D, 0x51D2F83D, 0x167282ED, 0x2B12AB5D, + 0xA9423C8C, 0x9422153C, 0xD3826FEC, 0xEEE2465C, + 0x5CC29A4C, 0x61A2B3FC, 0x2602C92C, 0x1B62E09C, + 0xF9D2E0CF, 0xC4B2C97F, 0x8312B3AF, 0xBE729A1F, + 0x0C52460F, 0x31326FBF, 0x7692156F, 0x4BF23CDF, + 0xC9A2AB0E, 0xF4C282BE, 0xB362F86E, 0x8E02D1DE, + 0x3C220DCE, 0x0142247E, 0x46E25EAE, 0x7B82771E, + 0xB1E6B092, 0x8C869922, 0xCB26E3F2, 0xF646CA42, + 0x44661652, 0x79063FE2, 0x3EA64532, 0x03C66C82, + 0x8196FB53, 0xBCF6D2E3, 0xFB56A833, 0xC6368183, + 0x74165D93, 0x49767423, 0x0ED60EF3, 0x33B62743, + 0xD1062710, 0xEC660EA0, 0xABC67470, 0x96A65DC0, + 0x248681D0, 0x19E6A860, 0x5E46D2B0, 0x6326FB00, + 0xE1766CD1, 0xDC164561, 0x9BB63FB1, 0xA6D61601, + 0x14F6CA11, 0x2996E3A1, 0x6E369971, 0x5356B0C1, + 0x70279F96, 0x4D47B626, 0x0AE7CCF6, 0x3787E546, + 0x85A73956, 0xB8C710E6, 0xFF676A36, 0xC2074386, + 0x4057D457, 0x7D37FDE7, 0x3A978737, 0x07F7AE87, + 0xB5D77297, 0x88B75B27, 0xCF1721F7, 0xF2770847, + 0x10C70814, 0x2DA721A4, 0x6A075B74, 0x576772C4, + 0xE547AED4, 0xD8278764, 0x9F87FDB4, 0xA2E7D404, + 0x20B743D5, 0x1DD76A65, 0x5A7710B5, 0x67173905, + 0xD537E515, 0xE857CCA5, 0xAFF7B675, 0x92979FC5, + 0xE915E8DB, 0xD475C16B, 0x93D5BBBB, 0xAEB5920B, + 0x1C954E1B, 0x21F567AB, 0x66551D7B, 0x5B3534CB, + 0xD965A31A, 0xE4058AAA, 0xA3A5F07A, 0x9EC5D9CA, + 0x2CE505DA, 0x11852C6A, 0x562556BA, 0x6B457F0A, + 0x89F57F59, 0xB49556E9, 0xF3352C39, 0xCE550589, + 0x7C75D999, 0x4115F029, 0x06B58AF9, 0x3BD5A349, + 0xB9853498, 0x84E51D28, 0xC34567F8, 0xFE254E48, + 0x4C059258, 0x7165BBE8, 0x36C5C138, 0x0BA5E888, + 0x28D4C7DF, 0x15B4EE6F, 0x521494BF, 0x6F74BD0F, + 0xDD54611F, 0xE03448AF, 0xA794327F, 0x9AF41BCF, + 0x18A48C1E, 0x25C4A5AE, 0x6264DF7E, 0x5F04F6CE, + 0xED242ADE, 0xD044036E, 0x97E479BE, 0xAA84500E, + 0x4834505D, 0x755479ED, 0x32F4033D, 0x0F942A8D, + 0xBDB4F69D, 0x80D4DF2D, 0xC774A5FD, 0xFA148C4D, + 0x78441B9C, 0x4524322C, 0x028448FC, 0x3FE4614C, + 0x8DC4BD5C, 0xB0A494EC, 0xF704EE3C, 0xCA64C78C + }, { + 0x00000000, 0xCB5CD3A5, 0x4DC8A10B, 0x869472AE, + 0x9B914216, 0x50CD91B3, 0xD659E31D, 0x1D0530B8, + 0xEC53826D, 0x270F51C8, 0xA19B2366, 0x6AC7F0C3, + 0x77C2C07B, 0xBC9E13DE, 0x3A0A6170, 0xF156B2D5, + 0x03D6029B, 0xC88AD13E, 0x4E1EA390, 0x85427035, + 0x9847408D, 0x531B9328, 0xD58FE186, 0x1ED33223, + 0xEF8580F6, 0x24D95353, 0xA24D21FD, 0x6911F258, + 0x7414C2E0, 0xBF481145, 0x39DC63EB, 0xF280B04E, + 0x07AC0536, 0xCCF0D693, 0x4A64A43D, 0x81387798, + 0x9C3D4720, 0x57619485, 0xD1F5E62B, 0x1AA9358E, + 0xEBFF875B, 0x20A354FE, 0xA6372650, 0x6D6BF5F5, + 0x706EC54D, 0xBB3216E8, 0x3DA66446, 0xF6FAB7E3, + 0x047A07AD, 0xCF26D408, 0x49B2A6A6, 0x82EE7503, + 0x9FEB45BB, 0x54B7961E, 0xD223E4B0, 0x197F3715, + 0xE82985C0, 0x23755665, 0xA5E124CB, 0x6EBDF76E, + 0x73B8C7D6, 0xB8E41473, 0x3E7066DD, 0xF52CB578, + 0x0F580A6C, 0xC404D9C9, 0x4290AB67, 0x89CC78C2, + 0x94C9487A, 0x5F959BDF, 0xD901E971, 0x125D3AD4, + 0xE30B8801, 0x28575BA4, 0xAEC3290A, 0x659FFAAF, + 0x789ACA17, 0xB3C619B2, 0x35526B1C, 0xFE0EB8B9, + 0x0C8E08F7, 0xC7D2DB52, 0x4146A9FC, 0x8A1A7A59, + 0x971F4AE1, 0x5C439944, 0xDAD7EBEA, 0x118B384F, + 0xE0DD8A9A, 0x2B81593F, 0xAD152B91, 0x6649F834, + 0x7B4CC88C, 0xB0101B29, 0x36846987, 0xFDD8BA22, + 0x08F40F5A, 0xC3A8DCFF, 0x453CAE51, 0x8E607DF4, + 0x93654D4C, 0x58399EE9, 0xDEADEC47, 0x15F13FE2, + 0xE4A78D37, 0x2FFB5E92, 0xA96F2C3C, 0x6233FF99, + 0x7F36CF21, 0xB46A1C84, 0x32FE6E2A, 0xF9A2BD8F, + 0x0B220DC1, 0xC07EDE64, 0x46EAACCA, 0x8DB67F6F, + 0x90B34FD7, 0x5BEF9C72, 0xDD7BEEDC, 0x16273D79, + 0xE7718FAC, 0x2C2D5C09, 0xAAB92EA7, 0x61E5FD02, + 0x7CE0CDBA, 0xB7BC1E1F, 0x31286CB1, 0xFA74BF14, + 0x1EB014D8, 0xD5ECC77D, 0x5378B5D3, 0x98246676, + 0x852156CE, 0x4E7D856B, 0xC8E9F7C5, 0x03B52460, + 0xF2E396B5, 0x39BF4510, 0xBF2B37BE, 0x7477E41B, + 0x6972D4A3, 0xA22E0706, 0x24BA75A8, 0xEFE6A60D, + 0x1D661643, 0xD63AC5E6, 0x50AEB748, 0x9BF264ED, + 0x86F75455, 0x4DAB87F0, 0xCB3FF55E, 0x006326FB, + 0xF135942E, 0x3A69478B, 0xBCFD3525, 0x77A1E680, + 0x6AA4D638, 0xA1F8059D, 0x276C7733, 0xEC30A496, + 0x191C11EE, 0xD240C24B, 0x54D4B0E5, 0x9F886340, + 0x828D53F8, 0x49D1805D, 0xCF45F2F3, 0x04192156, + 0xF54F9383, 0x3E134026, 0xB8873288, 0x73DBE12D, + 0x6EDED195, 0xA5820230, 0x2316709E, 0xE84AA33B, + 0x1ACA1375, 0xD196C0D0, 0x5702B27E, 0x9C5E61DB, + 0x815B5163, 0x4A0782C6, 0xCC93F068, 0x07CF23CD, + 0xF6999118, 0x3DC542BD, 0xBB513013, 0x700DE3B6, + 0x6D08D30E, 0xA65400AB, 0x20C07205, 0xEB9CA1A0, + 0x11E81EB4, 0xDAB4CD11, 0x5C20BFBF, 0x977C6C1A, + 0x8A795CA2, 0x41258F07, 0xC7B1FDA9, 0x0CED2E0C, + 0xFDBB9CD9, 0x36E74F7C, 0xB0733DD2, 0x7B2FEE77, + 0x662ADECF, 0xAD760D6A, 0x2BE27FC4, 0xE0BEAC61, + 0x123E1C2F, 0xD962CF8A, 0x5FF6BD24, 0x94AA6E81, + 0x89AF5E39, 0x42F38D9C, 0xC467FF32, 0x0F3B2C97, + 0xFE6D9E42, 0x35314DE7, 0xB3A53F49, 0x78F9ECEC, + 0x65FCDC54, 0xAEA00FF1, 0x28347D5F, 0xE368AEFA, + 0x16441B82, 0xDD18C827, 0x5B8CBA89, 0x90D0692C, + 0x8DD55994, 0x46898A31, 0xC01DF89F, 0x0B412B3A, + 0xFA1799EF, 0x314B4A4A, 0xB7DF38E4, 0x7C83EB41, + 0x6186DBF9, 0xAADA085C, 0x2C4E7AF2, 0xE712A957, + 0x15921919, 0xDECECABC, 0x585AB812, 0x93066BB7, + 0x8E035B0F, 0x455F88AA, 0xC3CBFA04, 0x089729A1, + 0xF9C19B74, 0x329D48D1, 0xB4093A7F, 0x7F55E9DA, + 0x6250D962, 0xA90C0AC7, 0x2F987869, 0xE4C4ABCC + }, { + 0x00000000, 0xA6770BB4, 0x979F1129, 0x31E81A9D, + 0xF44F2413, 0x52382FA7, 0x63D0353A, 0xC5A73E8E, + 0x33EF4E67, 0x959845D3, 0xA4705F4E, 0x020754FA, + 0xC7A06A74, 0x61D761C0, 0x503F7B5D, 0xF64870E9, + 0x67DE9CCE, 0xC1A9977A, 0xF0418DE7, 0x56368653, + 0x9391B8DD, 0x35E6B369, 0x040EA9F4, 0xA279A240, + 0x5431D2A9, 0xF246D91D, 0xC3AEC380, 0x65D9C834, + 0xA07EF6BA, 0x0609FD0E, 0x37E1E793, 0x9196EC27, + 0xCFBD399C, 0x69CA3228, 0x582228B5, 0xFE552301, + 0x3BF21D8F, 0x9D85163B, 0xAC6D0CA6, 0x0A1A0712, + 0xFC5277FB, 0x5A257C4F, 0x6BCD66D2, 0xCDBA6D66, + 0x081D53E8, 0xAE6A585C, 0x9F8242C1, 0x39F54975, + 0xA863A552, 0x0E14AEE6, 0x3FFCB47B, 0x998BBFCF, + 0x5C2C8141, 0xFA5B8AF5, 0xCBB39068, 0x6DC49BDC, + 0x9B8CEB35, 0x3DFBE081, 0x0C13FA1C, 0xAA64F1A8, + 0x6FC3CF26, 0xC9B4C492, 0xF85CDE0F, 0x5E2BD5BB, + 0x440B7579, 0xE27C7ECD, 0xD3946450, 0x75E36FE4, + 0xB044516A, 0x16335ADE, 0x27DB4043, 0x81AC4BF7, + 0x77E43B1E, 0xD19330AA, 0xE07B2A37, 0x460C2183, + 0x83AB1F0D, 0x25DC14B9, 0x14340E24, 0xB2430590, + 0x23D5E9B7, 0x85A2E203, 0xB44AF89E, 0x123DF32A, + 0xD79ACDA4, 0x71EDC610, 0x4005DC8D, 0xE672D739, + 0x103AA7D0, 0xB64DAC64, 0x87A5B6F9, 0x21D2BD4D, + 0xE47583C3, 0x42028877, 0x73EA92EA, 0xD59D995E, + 0x8BB64CE5, 0x2DC14751, 0x1C295DCC, 0xBA5E5678, + 0x7FF968F6, 0xD98E6342, 0xE86679DF, 0x4E11726B, + 0xB8590282, 0x1E2E0936, 0x2FC613AB, 0x89B1181F, + 0x4C162691, 0xEA612D25, 0xDB8937B8, 0x7DFE3C0C, + 0xEC68D02B, 0x4A1FDB9F, 0x7BF7C102, 0xDD80CAB6, + 0x1827F438, 0xBE50FF8C, 0x8FB8E511, 0x29CFEEA5, + 0xDF879E4C, 0x79F095F8, 0x48188F65, 0xEE6F84D1, + 0x2BC8BA5F, 0x8DBFB1EB, 0xBC57AB76, 0x1A20A0C2, + 0x8816EAF2, 0x2E61E146, 0x1F89FBDB, 0xB9FEF06F, + 0x7C59CEE1, 0xDA2EC555, 0xEBC6DFC8, 0x4DB1D47C, + 0xBBF9A495, 0x1D8EAF21, 0x2C66B5BC, 0x8A11BE08, + 0x4FB68086, 0xE9C18B32, 0xD82991AF, 0x7E5E9A1B, + 0xEFC8763C, 0x49BF7D88, 0x78576715, 0xDE206CA1, + 0x1B87522F, 0xBDF0599B, 0x8C184306, 0x2A6F48B2, + 0xDC27385B, 0x7A5033EF, 0x4BB82972, 0xEDCF22C6, + 0x28681C48, 0x8E1F17FC, 0xBFF70D61, 0x198006D5, + 0x47ABD36E, 0xE1DCD8DA, 0xD034C247, 0x7643C9F3, + 0xB3E4F77D, 0x1593FCC9, 0x247BE654, 0x820CEDE0, + 0x74449D09, 0xD23396BD, 0xE3DB8C20, 0x45AC8794, + 0x800BB91A, 0x267CB2AE, 0x1794A833, 0xB1E3A387, + 0x20754FA0, 0x86024414, 0xB7EA5E89, 0x119D553D, + 0xD43A6BB3, 0x724D6007, 0x43A57A9A, 0xE5D2712E, + 0x139A01C7, 0xB5ED0A73, 0x840510EE, 0x22721B5A, + 0xE7D525D4, 0x41A22E60, 0x704A34FD, 0xD63D3F49, + 0xCC1D9F8B, 0x6A6A943F, 0x5B828EA2, 0xFDF58516, + 0x3852BB98, 0x9E25B02C, 0xAFCDAAB1, 0x09BAA105, + 0xFFF2D1EC, 0x5985DA58, 0x686DC0C5, 0xCE1ACB71, + 0x0BBDF5FF, 0xADCAFE4B, 0x9C22E4D6, 0x3A55EF62, + 0xABC30345, 0x0DB408F1, 0x3C5C126C, 0x9A2B19D8, + 0x5F8C2756, 0xF9FB2CE2, 0xC813367F, 0x6E643DCB, + 0x982C4D22, 0x3E5B4696, 0x0FB35C0B, 0xA9C457BF, + 0x6C636931, 0xCA146285, 0xFBFC7818, 0x5D8B73AC, + 0x03A0A617, 0xA5D7ADA3, 0x943FB73E, 0x3248BC8A, + 0xF7EF8204, 0x519889B0, 0x6070932D, 0xC6079899, + 0x304FE870, 0x9638E3C4, 0xA7D0F959, 0x01A7F2ED, + 0xC400CC63, 0x6277C7D7, 0x539FDD4A, 0xF5E8D6FE, + 0x647E3AD9, 0xC209316D, 0xF3E12BF0, 0x55962044, + 0x90311ECA, 0x3646157E, 0x07AE0FE3, 0xA1D90457, + 0x579174BE, 0xF1E67F0A, 0xC00E6597, 0x66796E23, + 0xA3DE50AD, 0x05A95B19, 0x34414184, 0x92364A30 + }, { + 0x00000000, 0xCCAA009E, 0x4225077D, 0x8E8F07E3, + 0x844A0EFA, 0x48E00E64, 0xC66F0987, 0x0AC50919, + 0xD3E51BB5, 0x1F4F1B2B, 0x91C01CC8, 0x5D6A1C56, + 0x57AF154F, 0x9B0515D1, 0x158A1232, 0xD92012AC, + 0x7CBB312B, 0xB01131B5, 0x3E9E3656, 0xF23436C8, + 0xF8F13FD1, 0x345B3F4F, 0xBAD438AC, 0x767E3832, + 0xAF5E2A9E, 0x63F42A00, 0xED7B2DE3, 0x21D12D7D, + 0x2B142464, 0xE7BE24FA, 0x69312319, 0xA59B2387, + 0xF9766256, 0x35DC62C8, 0xBB53652B, 0x77F965B5, + 0x7D3C6CAC, 0xB1966C32, 0x3F196BD1, 0xF3B36B4F, + 0x2A9379E3, 0xE639797D, 0x68B67E9E, 0xA41C7E00, + 0xAED97719, 0x62737787, 0xECFC7064, 0x205670FA, + 0x85CD537D, 0x496753E3, 0xC7E85400, 0x0B42549E, + 0x01875D87, 0xCD2D5D19, 0x43A25AFA, 0x8F085A64, + 0x562848C8, 0x9A824856, 0x140D4FB5, 0xD8A74F2B, + 0xD2624632, 0x1EC846AC, 0x9047414F, 0x5CED41D1, + 0x299DC2ED, 0xE537C273, 0x6BB8C590, 0xA712C50E, + 0xADD7CC17, 0x617DCC89, 0xEFF2CB6A, 0x2358CBF4, + 0xFA78D958, 0x36D2D9C6, 0xB85DDE25, 0x74F7DEBB, + 0x7E32D7A2, 0xB298D73C, 0x3C17D0DF, 0xF0BDD041, + 0x5526F3C6, 0x998CF358, 0x1703F4BB, 0xDBA9F425, + 0xD16CFD3C, 0x1DC6FDA2, 0x9349FA41, 0x5FE3FADF, + 0x86C3E873, 0x4A69E8ED, 0xC4E6EF0E, 0x084CEF90, + 0x0289E689, 0xCE23E617, 0x40ACE1F4, 0x8C06E16A, + 0xD0EBA0BB, 0x1C41A025, 0x92CEA7C6, 0x5E64A758, + 0x54A1AE41, 0x980BAEDF, 0x1684A93C, 0xDA2EA9A2, + 0x030EBB0E, 0xCFA4BB90, 0x412BBC73, 0x8D81BCED, + 0x8744B5F4, 0x4BEEB56A, 0xC561B289, 0x09CBB217, + 0xAC509190, 0x60FA910E, 0xEE7596ED, 0x22DF9673, + 0x281A9F6A, 0xE4B09FF4, 0x6A3F9817, 0xA6959889, + 0x7FB58A25, 0xB31F8ABB, 0x3D908D58, 0xF13A8DC6, + 0xFBFF84DF, 0x37558441, 0xB9DA83A2, 0x7570833C, + 0x533B85DA, 0x9F918544, 0x111E82A7, 0xDDB48239, + 0xD7718B20, 0x1BDB8BBE, 0x95548C5D, 0x59FE8CC3, + 0x80DE9E6F, 0x4C749EF1, 0xC2FB9912, 0x0E51998C, + 0x04949095, 0xC83E900B, 0x46B197E8, 0x8A1B9776, + 0x2F80B4F1, 0xE32AB46F, 0x6DA5B38C, 0xA10FB312, + 0xABCABA0B, 0x6760BA95, 0xE9EFBD76, 0x2545BDE8, + 0xFC65AF44, 0x30CFAFDA, 0xBE40A839, 0x72EAA8A7, + 0x782FA1BE, 0xB485A120, 0x3A0AA6C3, 0xF6A0A65D, + 0xAA4DE78C, 0x66E7E712, 0xE868E0F1, 0x24C2E06F, + 0x2E07E976, 0xE2ADE9E8, 0x6C22EE0B, 0xA088EE95, + 0x79A8FC39, 0xB502FCA7, 0x3B8DFB44, 0xF727FBDA, + 0xFDE2F2C3, 0x3148F25D, 0xBFC7F5BE, 0x736DF520, + 0xD6F6D6A7, 0x1A5CD639, 0x94D3D1DA, 0x5879D144, + 0x52BCD85D, 0x9E16D8C3, 0x1099DF20, 0xDC33DFBE, + 0x0513CD12, 0xC9B9CD8C, 0x4736CA6F, 0x8B9CCAF1, + 0x8159C3E8, 0x4DF3C376, 0xC37CC495, 0x0FD6C40B, + 0x7AA64737, 0xB60C47A9, 0x3883404A, 0xF42940D4, + 0xFEEC49CD, 0x32464953, 0xBCC94EB0, 0x70634E2E, + 0xA9435C82, 0x65E95C1C, 0xEB665BFF, 0x27CC5B61, + 0x2D095278, 0xE1A352E6, 0x6F2C5505, 0xA386559B, + 0x061D761C, 0xCAB77682, 0x44387161, 0x889271FF, + 0x825778E6, 0x4EFD7878, 0xC0727F9B, 0x0CD87F05, + 0xD5F86DA9, 0x19526D37, 0x97DD6AD4, 0x5B776A4A, + 0x51B26353, 0x9D1863CD, 0x1397642E, 0xDF3D64B0, + 0x83D02561, 0x4F7A25FF, 0xC1F5221C, 0x0D5F2282, + 0x079A2B9B, 0xCB302B05, 0x45BF2CE6, 0x89152C78, + 0x50353ED4, 0x9C9F3E4A, 0x121039A9, 0xDEBA3937, + 0xD47F302E, 0x18D530B0, 0x965A3753, 0x5AF037CD, + 0xFF6B144A, 0x33C114D4, 0xBD4E1337, 0x71E413A9, + 0x7B211AB0, 0xB78B1A2E, 0x39041DCD, 0xF5AE1D53, + 0x2C8E0FFF, 0xE0240F61, 0x6EAB0882, 0xA201081C, + 0xA8C40105, 0x646E019B, 0xEAE10678, 0x264B06E6 + } +}; diff --git a/src/liblzma/check/crc32_tablegen.c b/src/liblzma/check/crc32_tablegen.c new file mode 100644 index 000000000000..31a4d2751db2 --- /dev/null +++ b/src/liblzma/check/crc32_tablegen.c @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32_tablegen.c +/// \brief Generate crc32_table_le.h and crc32_table_be.h +/// +/// Compiling: gcc -std=c99 -o crc32_tablegen crc32_tablegen.c +/// Add -DWORDS_BIGENDIAN to generate big endian table. +/// Add -DLZ_HASH_TABLE to generate lz_encoder_hash_table.h (little endian). +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include <stdio.h> +#include "../../common/tuklib_integer.h" + + +static uint32_t crc32_table[8][256]; + + +static void +init_crc32_table(void) +{ + static const uint32_t poly32 = UINT32_C(0xEDB88320); + + for (size_t s = 0; s < 8; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint32_t r = s == 0 ? b : crc32_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly32; + else + r >>= 1; + } + + crc32_table[s][b] = r; + } + } + +#ifdef WORDS_BIGENDIAN + for (size_t s = 0; s < 8; ++s) + for (size_t b = 0; b < 256; ++b) + crc32_table[s][b] = bswap32(crc32_table[s][b]); +#endif + + return; +} + + +static void +print_crc32_table(void) +{ + printf("/* This file has been automatically generated by " + "crc32_tablegen.c. */\n\n" + "const uint32_t lzma_crc32_table[8][256] = {\n\t{"); + + for (size_t s = 0; s < 8; ++s) { + for (size_t b = 0; b < 256; ++b) { + if ((b % 4) == 0) + printf("\n\t\t"); + + printf("0x%08" PRIX32, crc32_table[s][b]); + + if (b != 255) + printf(",%s", (b+1) % 4 == 0 ? "" : " "); + } + + if (s == 7) + printf("\n\t}\n};\n"); + else + printf("\n\t}, {"); + } + + return; +} + + +static void +print_lz_table(void) +{ + printf("/* This file has been automatically generated by " + "crc32_tablegen.c. */\n\n" + "const uint32_t lzma_lz_hash_table[256] = {"); + + for (size_t b = 0; b < 256; ++b) { + if ((b % 4) == 0) + printf("\n\t"); + + printf("0x%08" PRIX32, crc32_table[0][b]); + + if (b != 255) + printf(",%s", (b+1) % 4 == 0 ? "" : " "); + } + + printf("\n};\n"); + + return; +} + + +int +main(void) +{ + init_crc32_table(); + +#ifdef LZ_HASH_TABLE + print_lz_table(); +#else + print_crc32_table(); +#endif + + return 0; +} diff --git a/src/liblzma/check/crc32_x86.S b/src/liblzma/check/crc32_x86.S new file mode 100644 index 000000000000..67f68a4145f8 --- /dev/null +++ b/src/liblzma/check/crc32_x86.S @@ -0,0 +1,304 @@ +/* + * Speed-optimized CRC32 using slicing-by-eight algorithm + * + * This uses only i386 instructions, but it is optimized for i686 and later + * (including e.g. Pentium II/III/IV, Athlon XP, and Core 2). For i586 + * (e.g. Pentium), slicing-by-four would be better, and even the C version + * of slicing-by-eight built with gcc -march=i586 tends to be a little bit + * better than this. Very few probably run this code on i586 or older x86 + * so this shouldn't be a problem in practice. + * + * Authors: Igor Pavlov (original version) + * Lasse Collin (AT&T syntax, PIC support, better portability) + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * This code needs lzma_crc32_table, which can be created using the + * following C code: + +uint32_t lzma_crc32_table[8][256]; + +void +init_table(void) +{ + // IEEE-802.3 + static const uint32_t poly32 = UINT32_C(0xEDB88320); + + // Castagnoli + // static const uint32_t poly32 = UINT32_C(0x82F63B78); + + // Koopman + // static const uint32_t poly32 = UINT32_C(0xEB31D82E); + + for (size_t s = 0; s < 8; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint32_t r = s == 0 ? b : lzma_crc32_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly32; + else + r >>= 1; + } + + lzma_crc32_table[s][b] = r; + } + } +} + + * The prototype of the CRC32 function: + * extern uint32_t lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc); + */ + +/* + * On some systems, the functions need to be prefixed. The prefix is + * usually an underscore. + */ +#ifndef __USER_LABEL_PREFIX__ +# define __USER_LABEL_PREFIX__ +#endif +#define MAKE_SYM_CAT(prefix, sym) prefix ## sym +#define MAKE_SYM(prefix, sym) MAKE_SYM_CAT(prefix, sym) +#define LZMA_CRC32 MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc32) +#define LZMA_CRC32_TABLE MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc32_table) + +/* + * Solaris assembler doesn't have .p2align, and Darwin uses .align + * differently than GNU/Linux and Solaris. + */ +#if defined(__APPLE__) || defined(__MSDOS__) +# define ALIGN(pow2, abs) .align pow2 +#else +# define ALIGN(pow2, abs) .align abs +#endif + + .text + .globl LZMA_CRC32 + +#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) \ + && !defined(__MSDOS__) + .type LZMA_CRC32, @function +#endif + + ALIGN(4, 16) +LZMA_CRC32: + /* + * Register usage: + * %eax crc + * %esi buf + * %edi size or buf + size + * %ebx lzma_crc32_table + * %ebp Table index + * %ecx Temporary + * %edx Temporary + */ + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl 0x14(%esp), %esi /* buf */ + movl 0x18(%esp), %edi /* size */ + movl 0x1C(%esp), %eax /* crc */ + + /* + * Store the address of lzma_crc32_table to %ebx. This is needed to + * get position-independent code (PIC). + * + * The PIC macro is defined by libtool, while __PIC__ is defined + * by GCC but only on some systems. Testing for both makes it simpler + * to test this code without libtool, and keeps the code working also + * when built with libtool but using something else than GCC. + * + * I understood that libtool may define PIC on Windows even though + * the code in Windows DLLs is not PIC in sense that it is in ELF + * binaries, so we need a separate check to always use the non-PIC + * code on Windows. + */ +#if (!defined(PIC) && !defined(__PIC__)) \ + || (defined(_WIN32) || defined(__CYGWIN__)) + /* Not PIC */ + movl $ LZMA_CRC32_TABLE, %ebx +#elif defined(__APPLE__) + /* Mach-O */ + call .L_get_pc +.L_pic: + leal .L_lzma_crc32_table$non_lazy_ptr-.L_pic(%ebx), %ebx + movl (%ebx), %ebx +#else + /* ELF */ + call .L_get_pc + addl $_GLOBAL_OFFSET_TABLE_, %ebx + movl LZMA_CRC32_TABLE@GOT(%ebx), %ebx +#endif + + /* Complement the initial value. */ + notl %eax + + ALIGN(4, 16) +.L_align: + /* + * Check if there is enough input to use slicing-by-eight. + * We need 16 bytes, because the loop pre-reads eight bytes. + */ + cmpl $16, %edi + jb .L_rest + + /* Check if we have reached alignment of eight bytes. */ + testl $7, %esi + jz .L_slice + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrl $8, %eax + xorl (%ebx, %ebp, 4), %eax + decl %edi + jmp .L_align + + ALIGN(2, 4) +.L_slice: + /* + * If we get here, there's at least 16 bytes of aligned input + * available. Make %edi multiple of eight bytes. Store the possible + * remainder over the "size" variable in the argument stack. + */ + movl %edi, 0x18(%esp) + andl $-8, %edi + subl %edi, 0x18(%esp) + + /* + * Let %edi be buf + size - 8 while running the main loop. This way + * we can compare for equality to determine when exit the loop. + */ + addl %esi, %edi + subl $8, %edi + + /* Read in the first eight aligned bytes. */ + xorl (%esi), %eax + movl 4(%esi), %ecx + movzbl %cl, %ebp + +.L_loop: + movl 0x0C00(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl 0x0800(%ebx, %ebp, 4), %edx + shrl $16, %ecx + xorl 8(%esi), %edx + movzbl %cl, %ebp + xorl 0x0400(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl (%ebx, %ebp, 4), %edx + movzbl %al, %ebp + + /* + * Read the next four bytes, for which the CRC is calculated + * on the next interation of the loop. + */ + movl 12(%esi), %ecx + + xorl 0x1C00(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + shrl $16, %eax + xorl 0x1800(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + movzbl %al, %eax + movl 0x1400(%ebx, %eax, 4), %eax + addl $8, %esi + xorl %edx, %eax + xorl 0x1000(%ebx, %ebp, 4), %eax + + /* Check for end of aligned input. */ + cmpl %edi, %esi + movzbl %cl, %ebp + jne .L_loop + + /* + * Process the remaining eight bytes, which we have already + * copied to %ecx and %edx. + */ + movl 0x0C00(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl 0x0800(%ebx, %ebp, 4), %edx + shrl $16, %ecx + movzbl %cl, %ebp + xorl 0x0400(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl (%ebx, %ebp, 4), %edx + movzbl %al, %ebp + + xorl 0x1C00(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + shrl $16, %eax + xorl 0x1800(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + movzbl %al, %eax + movl 0x1400(%ebx, %eax, 4), %eax + addl $8, %esi + xorl %edx, %eax + xorl 0x1000(%ebx, %ebp, 4), %eax + + /* Copy the number of remaining bytes to %edi. */ + movl 0x18(%esp), %edi + +.L_rest: + /* Check for end of input. */ + testl %edi, %edi + jz .L_return + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrl $8, %eax + xorl (%ebx, %ebp, 4), %eax + decl %edi + jmp .L_rest + +.L_return: + /* Complement the final value. */ + notl %eax + + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + +#if defined(PIC) || defined(__PIC__) + ALIGN(4, 16) +.L_get_pc: + movl (%esp), %ebx + ret +#endif + +#if defined(__APPLE__) && (defined(PIC) || defined(__PIC__)) + /* Mach-O PIC */ + .section __IMPORT,__pointers,non_lazy_symbol_pointers +.L_lzma_crc32_table$non_lazy_ptr: + .indirect_symbol LZMA_CRC32_TABLE + .long 0 + +#elif defined(_WIN32) || defined(__CYGWIN__) +# ifdef DLL_EXPORT + /* This is equivalent of __declspec(dllexport). */ + .section .drectve + .ascii " -export:lzma_crc32" +# endif + +#elif !defined(__MSDOS__) + /* ELF */ + .size LZMA_CRC32, .-LZMA_CRC32 +#endif + +/* + * This is needed to support non-executable stack. It's ugly to + * use __linux__ here, but I don't know a way to detect when + * we are using GNU assembler. + */ +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",@progbits +#endif diff --git a/src/liblzma/check/crc64_fast.c b/src/liblzma/check/crc64_fast.c new file mode 100644 index 000000000000..52af29ed48d8 --- /dev/null +++ b/src/liblzma/check/crc64_fast.c @@ -0,0 +1,72 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64.c +/// \brief CRC64 calculation +/// +/// Calculate the CRC64 using the slice-by-four algorithm. This is the same +/// idea that is used in crc32_fast.c, but for CRC64 we use only four tables +/// instead of eight to avoid increasing CPU cache usage. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" +#include "crc_macros.h" + + +#ifdef WORDS_BIGENDIAN +# define A1(x) ((x) >> 56) +#else +# define A1 A +#endif + + +// See the comments in crc32_fast.c. They aren't duplicated here. +extern LZMA_API(uint64_t) +lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) +{ + crc = ~crc; + +#ifdef WORDS_BIGENDIAN + crc = bswap64(crc); +#endif + + if (size > 4) { + while ((uintptr_t)(buf) & 3) { + crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); + --size; + } + + const uint8_t *const limit = buf + (size & ~(size_t)(3)); + size &= (size_t)(3); + + while (buf < limit) { +#ifdef WORDS_BIGENDIAN + const uint32_t tmp = (crc >> 32) + ^ *(const uint32_t *)(buf); +#else + const uint32_t tmp = crc ^ *(const uint32_t *)(buf); +#endif + buf += 4; + + crc = lzma_crc64_table[3][A(tmp)] + ^ lzma_crc64_table[2][B(tmp)] + ^ S32(crc) + ^ lzma_crc64_table[1][C(tmp)] + ^ lzma_crc64_table[0][D(tmp)]; + } + } + + while (size-- != 0) + crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); + +#ifdef WORDS_BIGENDIAN + crc = bswap64(crc); +#endif + + return ~crc; +} diff --git a/src/liblzma/check/crc64_small.c b/src/liblzma/check/crc64_small.c new file mode 100644 index 000000000000..55d72316bce7 --- /dev/null +++ b/src/liblzma/check/crc64_small.c @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64_small.c +/// \brief CRC64 calculation (size-optimized) +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + + +static uint64_t crc64_table[256]; + + +static void +crc64_init(void) +{ + static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); + + for (size_t b = 0; b < 256; ++b) { + uint64_t r = b; + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly64; + else + r >>= 1; + } + + crc64_table[b] = r; + } + + return; +} + + +extern LZMA_API(uint64_t) +lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) +{ + mythread_once(crc64_init); + + crc = ~crc; + + while (size != 0) { + crc = crc64_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); + --size; + } + + return ~crc; +} diff --git a/src/liblzma/check/crc64_table.c b/src/liblzma/check/crc64_table.c new file mode 100644 index 000000000000..1fbcd94703c7 --- /dev/null +++ b/src/liblzma/check/crc64_table.c @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64_table.c +/// \brief Precalculated CRC64 table with correct endianness +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + +#ifdef WORDS_BIGENDIAN +# include "crc64_table_be.h" +#else +# include "crc64_table_le.h" +#endif diff --git a/src/liblzma/check/crc64_table_be.h b/src/liblzma/check/crc64_table_be.h new file mode 100644 index 000000000000..ea074f397a70 --- /dev/null +++ b/src/liblzma/check/crc64_table_be.h @@ -0,0 +1,521 @@ +/* This file has been automatically generated by crc64_tablegen.c. */ + +const uint64_t lzma_crc64_table[4][256] = { + { + UINT64_C(0x0000000000000000), UINT64_C(0x6F5FA703BE4C2EB3), + UINT64_C(0x5BA040A8573684F4), UINT64_C(0x34FFE7ABE97AAA47), + UINT64_C(0x335E8FFF84C3D07B), UINT64_C(0x5C0128FC3A8FFEC8), + UINT64_C(0x68FECF57D3F5548F), UINT64_C(0x07A168546DB97A3C), + UINT64_C(0x66BC1EFF0987A1F7), UINT64_C(0x09E3B9FCB7CB8F44), + UINT64_C(0x3D1C5E575EB12503), UINT64_C(0x5243F954E0FD0BB0), + UINT64_C(0x55E291008D44718C), UINT64_C(0x3ABD360333085F3F), + UINT64_C(0x0E42D1A8DA72F578), UINT64_C(0x611D76AB643EDBCB), + UINT64_C(0x4966335138A19B7D), UINT64_C(0x2639945286EDB5CE), + UINT64_C(0x12C673F96F971F89), UINT64_C(0x7D99D4FAD1DB313A), + UINT64_C(0x7A38BCAEBC624B06), UINT64_C(0x15671BAD022E65B5), + UINT64_C(0x2198FC06EB54CFF2), UINT64_C(0x4EC75B055518E141), + UINT64_C(0x2FDA2DAE31263A8A), UINT64_C(0x40858AAD8F6A1439), + UINT64_C(0x747A6D066610BE7E), UINT64_C(0x1B25CA05D85C90CD), + UINT64_C(0x1C84A251B5E5EAF1), UINT64_C(0x73DB05520BA9C442), + UINT64_C(0x4724E2F9E2D36E05), UINT64_C(0x287B45FA5C9F40B6), + UINT64_C(0x92CC66A2704237FB), UINT64_C(0xFD93C1A1CE0E1948), + UINT64_C(0xC96C260A2774B30F), UINT64_C(0xA633810999389DBC), + UINT64_C(0xA192E95DF481E780), UINT64_C(0xCECD4E5E4ACDC933), + UINT64_C(0xFA32A9F5A3B76374), UINT64_C(0x956D0EF61DFB4DC7), + UINT64_C(0xF470785D79C5960C), UINT64_C(0x9B2FDF5EC789B8BF), + UINT64_C(0xAFD038F52EF312F8), UINT64_C(0xC08F9FF690BF3C4B), + UINT64_C(0xC72EF7A2FD064677), UINT64_C(0xA87150A1434A68C4), + UINT64_C(0x9C8EB70AAA30C283), UINT64_C(0xF3D11009147CEC30), + UINT64_C(0xDBAA55F348E3AC86), UINT64_C(0xB4F5F2F0F6AF8235), + UINT64_C(0x800A155B1FD52872), UINT64_C(0xEF55B258A19906C1), + UINT64_C(0xE8F4DA0CCC207CFD), UINT64_C(0x87AB7D0F726C524E), + UINT64_C(0xB3549AA49B16F809), UINT64_C(0xDC0B3DA7255AD6BA), + UINT64_C(0xBD164B0C41640D71), UINT64_C(0xD249EC0FFF2823C2), + UINT64_C(0xE6B60BA416528985), UINT64_C(0x89E9ACA7A81EA736), + UINT64_C(0x8E48C4F3C5A7DD0A), UINT64_C(0xE11763F07BEBF3B9), + UINT64_C(0xD5E8845B929159FE), UINT64_C(0xBAB723582CDD774D), + UINT64_C(0xA187C3EBCA2BB664), UINT64_C(0xCED864E8746798D7), + UINT64_C(0xFA2783439D1D3290), UINT64_C(0x9578244023511C23), + UINT64_C(0x92D94C144EE8661F), UINT64_C(0xFD86EB17F0A448AC), + UINT64_C(0xC9790CBC19DEE2EB), UINT64_C(0xA626ABBFA792CC58), + UINT64_C(0xC73BDD14C3AC1793), UINT64_C(0xA8647A177DE03920), + UINT64_C(0x9C9B9DBC949A9367), UINT64_C(0xF3C43ABF2AD6BDD4), + UINT64_C(0xF46552EB476FC7E8), UINT64_C(0x9B3AF5E8F923E95B), + UINT64_C(0xAFC512431059431C), UINT64_C(0xC09AB540AE156DAF), + UINT64_C(0xE8E1F0BAF28A2D19), UINT64_C(0x87BE57B94CC603AA), + UINT64_C(0xB341B012A5BCA9ED), UINT64_C(0xDC1E17111BF0875E), + UINT64_C(0xDBBF7F457649FD62), UINT64_C(0xB4E0D846C805D3D1), + UINT64_C(0x801F3FED217F7996), UINT64_C(0xEF4098EE9F335725), + UINT64_C(0x8E5DEE45FB0D8CEE), UINT64_C(0xE10249464541A25D), + UINT64_C(0xD5FDAEEDAC3B081A), UINT64_C(0xBAA209EE127726A9), + UINT64_C(0xBD0361BA7FCE5C95), UINT64_C(0xD25CC6B9C1827226), + UINT64_C(0xE6A3211228F8D861), UINT64_C(0x89FC861196B4F6D2), + UINT64_C(0x334BA549BA69819F), UINT64_C(0x5C14024A0425AF2C), + UINT64_C(0x68EBE5E1ED5F056B), UINT64_C(0x07B442E253132BD8), + UINT64_C(0x00152AB63EAA51E4), UINT64_C(0x6F4A8DB580E67F57), + UINT64_C(0x5BB56A1E699CD510), UINT64_C(0x34EACD1DD7D0FBA3), + UINT64_C(0x55F7BBB6B3EE2068), UINT64_C(0x3AA81CB50DA20EDB), + UINT64_C(0x0E57FB1EE4D8A49C), UINT64_C(0x61085C1D5A948A2F), + UINT64_C(0x66A93449372DF013), UINT64_C(0x09F6934A8961DEA0), + UINT64_C(0x3D0974E1601B74E7), UINT64_C(0x5256D3E2DE575A54), + UINT64_C(0x7A2D961882C81AE2), UINT64_C(0x1572311B3C843451), + UINT64_C(0x218DD6B0D5FE9E16), UINT64_C(0x4ED271B36BB2B0A5), + UINT64_C(0x497319E7060BCA99), UINT64_C(0x262CBEE4B847E42A), + UINT64_C(0x12D3594F513D4E6D), UINT64_C(0x7D8CFE4CEF7160DE), + UINT64_C(0x1C9188E78B4FBB15), UINT64_C(0x73CE2FE4350395A6), + UINT64_C(0x4731C84FDC793FE1), UINT64_C(0x286E6F4C62351152), + UINT64_C(0x2FCF07180F8C6B6E), UINT64_C(0x4090A01BB1C045DD), + UINT64_C(0x746F47B058BAEF9A), UINT64_C(0x1B30E0B3E6F6C129), + UINT64_C(0x420F87D795576CC9), UINT64_C(0x2D5020D42B1B427A), + UINT64_C(0x19AFC77FC261E83D), UINT64_C(0x76F0607C7C2DC68E), + UINT64_C(0x715108281194BCB2), UINT64_C(0x1E0EAF2BAFD89201), + UINT64_C(0x2AF1488046A23846), UINT64_C(0x45AEEF83F8EE16F5), + UINT64_C(0x24B399289CD0CD3E), UINT64_C(0x4BEC3E2B229CE38D), + UINT64_C(0x7F13D980CBE649CA), UINT64_C(0x104C7E8375AA6779), + UINT64_C(0x17ED16D718131D45), UINT64_C(0x78B2B1D4A65F33F6), + UINT64_C(0x4C4D567F4F2599B1), UINT64_C(0x2312F17CF169B702), + UINT64_C(0x0B69B486ADF6F7B4), UINT64_C(0x6436138513BAD907), + UINT64_C(0x50C9F42EFAC07340), UINT64_C(0x3F96532D448C5DF3), + UINT64_C(0x38373B79293527CF), UINT64_C(0x57689C7A9779097C), + UINT64_C(0x63977BD17E03A33B), UINT64_C(0x0CC8DCD2C04F8D88), + UINT64_C(0x6DD5AA79A4715643), UINT64_C(0x028A0D7A1A3D78F0), + UINT64_C(0x3675EAD1F347D2B7), UINT64_C(0x592A4DD24D0BFC04), + UINT64_C(0x5E8B258620B28638), UINT64_C(0x31D482859EFEA88B), + UINT64_C(0x052B652E778402CC), UINT64_C(0x6A74C22DC9C82C7F), + UINT64_C(0xD0C3E175E5155B32), UINT64_C(0xBF9C46765B597581), + UINT64_C(0x8B63A1DDB223DFC6), UINT64_C(0xE43C06DE0C6FF175), + UINT64_C(0xE39D6E8A61D68B49), UINT64_C(0x8CC2C989DF9AA5FA), + UINT64_C(0xB83D2E2236E00FBD), UINT64_C(0xD762892188AC210E), + UINT64_C(0xB67FFF8AEC92FAC5), UINT64_C(0xD920588952DED476), + UINT64_C(0xEDDFBF22BBA47E31), UINT64_C(0x8280182105E85082), + UINT64_C(0x8521707568512ABE), UINT64_C(0xEA7ED776D61D040D), + UINT64_C(0xDE8130DD3F67AE4A), UINT64_C(0xB1DE97DE812B80F9), + UINT64_C(0x99A5D224DDB4C04F), UINT64_C(0xF6FA752763F8EEFC), + UINT64_C(0xC205928C8A8244BB), UINT64_C(0xAD5A358F34CE6A08), + UINT64_C(0xAAFB5DDB59771034), UINT64_C(0xC5A4FAD8E73B3E87), + UINT64_C(0xF15B1D730E4194C0), UINT64_C(0x9E04BA70B00DBA73), + UINT64_C(0xFF19CCDBD43361B8), UINT64_C(0x90466BD86A7F4F0B), + UINT64_C(0xA4B98C738305E54C), UINT64_C(0xCBE62B703D49CBFF), + UINT64_C(0xCC47432450F0B1C3), UINT64_C(0xA318E427EEBC9F70), + UINT64_C(0x97E7038C07C63537), UINT64_C(0xF8B8A48FB98A1B84), + UINT64_C(0xE388443C5F7CDAAD), UINT64_C(0x8CD7E33FE130F41E), + UINT64_C(0xB8280494084A5E59), UINT64_C(0xD777A397B60670EA), + UINT64_C(0xD0D6CBC3DBBF0AD6), UINT64_C(0xBF896CC065F32465), + UINT64_C(0x8B768B6B8C898E22), UINT64_C(0xE4292C6832C5A091), + UINT64_C(0x85345AC356FB7B5A), UINT64_C(0xEA6BFDC0E8B755E9), + UINT64_C(0xDE941A6B01CDFFAE), UINT64_C(0xB1CBBD68BF81D11D), + UINT64_C(0xB66AD53CD238AB21), UINT64_C(0xD935723F6C748592), + UINT64_C(0xEDCA9594850E2FD5), UINT64_C(0x829532973B420166), + UINT64_C(0xAAEE776D67DD41D0), UINT64_C(0xC5B1D06ED9916F63), + UINT64_C(0xF14E37C530EBC524), UINT64_C(0x9E1190C68EA7EB97), + UINT64_C(0x99B0F892E31E91AB), UINT64_C(0xF6EF5F915D52BF18), + UINT64_C(0xC210B83AB428155F), UINT64_C(0xAD4F1F390A643BEC), + UINT64_C(0xCC5269926E5AE027), UINT64_C(0xA30DCE91D016CE94), + UINT64_C(0x97F2293A396C64D3), UINT64_C(0xF8AD8E3987204A60), + UINT64_C(0xFF0CE66DEA99305C), UINT64_C(0x9053416E54D51EEF), + UINT64_C(0xA4ACA6C5BDAFB4A8), UINT64_C(0xCBF301C603E39A1B), + UINT64_C(0x7144229E2F3EED56), UINT64_C(0x1E1B859D9172C3E5), + UINT64_C(0x2AE46236780869A2), UINT64_C(0x45BBC535C6444711), + UINT64_C(0x421AAD61ABFD3D2D), UINT64_C(0x2D450A6215B1139E), + UINT64_C(0x19BAEDC9FCCBB9D9), UINT64_C(0x76E54ACA4287976A), + UINT64_C(0x17F83C6126B94CA1), UINT64_C(0x78A79B6298F56212), + UINT64_C(0x4C587CC9718FC855), UINT64_C(0x2307DBCACFC3E6E6), + UINT64_C(0x24A6B39EA27A9CDA), UINT64_C(0x4BF9149D1C36B269), + UINT64_C(0x7F06F336F54C182E), UINT64_C(0x105954354B00369D), + UINT64_C(0x382211CF179F762B), UINT64_C(0x577DB6CCA9D35898), + UINT64_C(0x6382516740A9F2DF), UINT64_C(0x0CDDF664FEE5DC6C), + UINT64_C(0x0B7C9E30935CA650), UINT64_C(0x642339332D1088E3), + UINT64_C(0x50DCDE98C46A22A4), UINT64_C(0x3F83799B7A260C17), + UINT64_C(0x5E9E0F301E18D7DC), UINT64_C(0x31C1A833A054F96F), + UINT64_C(0x053E4F98492E5328), UINT64_C(0x6A61E89BF7627D9B), + UINT64_C(0x6DC080CF9ADB07A7), UINT64_C(0x029F27CC24972914), + UINT64_C(0x3660C067CDED8353), UINT64_C(0x593F676473A1ADE0) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x0DF1D05C9279E954), + UINT64_C(0x1AE2A1B924F3D2A9), UINT64_C(0x171371E5B68A3BFD), + UINT64_C(0xB1DA4DDC62497DC1), UINT64_C(0xBC2B9D80F0309495), + UINT64_C(0xAB38EC6546BAAF68), UINT64_C(0xA6C93C39D4C3463C), + UINT64_C(0xE7AB9517EE3D2210), UINT64_C(0xEA5A454B7C44CB44), + UINT64_C(0xFD4934AECACEF0B9), UINT64_C(0xF0B8E4F258B719ED), + UINT64_C(0x5671D8CB8C745FD1), UINT64_C(0x5B8008971E0DB685), + UINT64_C(0x4C937972A8878D78), UINT64_C(0x4162A92E3AFE642C), + UINT64_C(0xCE572B2FDC7B4420), UINT64_C(0xC3A6FB734E02AD74), + UINT64_C(0xD4B58A96F8889689), UINT64_C(0xD9445ACA6AF17FDD), + UINT64_C(0x7F8D66F3BE3239E1), UINT64_C(0x727CB6AF2C4BD0B5), + UINT64_C(0x656FC74A9AC1EB48), UINT64_C(0x689E171608B8021C), + UINT64_C(0x29FCBE3832466630), UINT64_C(0x240D6E64A03F8F64), + UINT64_C(0x331E1F8116B5B499), UINT64_C(0x3EEFCFDD84CC5DCD), + UINT64_C(0x9826F3E4500F1BF1), UINT64_C(0x95D723B8C276F2A5), + UINT64_C(0x82C4525D74FCC958), UINT64_C(0x8F358201E685200C), + UINT64_C(0x9CAF565EB8F78840), UINT64_C(0x915E86022A8E6114), + UINT64_C(0x864DF7E79C045AE9), UINT64_C(0x8BBC27BB0E7DB3BD), + UINT64_C(0x2D751B82DABEF581), UINT64_C(0x2084CBDE48C71CD5), + UINT64_C(0x3797BA3BFE4D2728), UINT64_C(0x3A666A676C34CE7C), + UINT64_C(0x7B04C34956CAAA50), UINT64_C(0x76F51315C4B34304), + UINT64_C(0x61E662F0723978F9), UINT64_C(0x6C17B2ACE04091AD), + UINT64_C(0xCADE8E953483D791), UINT64_C(0xC72F5EC9A6FA3EC5), + UINT64_C(0xD03C2F2C10700538), UINT64_C(0xDDCDFF708209EC6C), + UINT64_C(0x52F87D71648CCC60), UINT64_C(0x5F09AD2DF6F52534), + UINT64_C(0x481ADCC8407F1EC9), UINT64_C(0x45EB0C94D206F79D), + UINT64_C(0xE32230AD06C5B1A1), UINT64_C(0xEED3E0F194BC58F5), + UINT64_C(0xF9C0911422366308), UINT64_C(0xF4314148B04F8A5C), + UINT64_C(0xB553E8668AB1EE70), UINT64_C(0xB8A2383A18C80724), + UINT64_C(0xAFB149DFAE423CD9), UINT64_C(0xA24099833C3BD58D), + UINT64_C(0x0489A5BAE8F893B1), UINT64_C(0x097875E67A817AE5), + UINT64_C(0x1E6B0403CC0B4118), UINT64_C(0x139AD45F5E72A84C), + UINT64_C(0x385FADBC70EF1181), UINT64_C(0x35AE7DE0E296F8D5), + UINT64_C(0x22BD0C05541CC328), UINT64_C(0x2F4CDC59C6652A7C), + UINT64_C(0x8985E06012A66C40), UINT64_C(0x8474303C80DF8514), + UINT64_C(0x936741D93655BEE9), UINT64_C(0x9E969185A42C57BD), + UINT64_C(0xDFF438AB9ED23391), UINT64_C(0xD205E8F70CABDAC5), + UINT64_C(0xC5169912BA21E138), UINT64_C(0xC8E7494E2858086C), + UINT64_C(0x6E2E7577FC9B4E50), UINT64_C(0x63DFA52B6EE2A704), + UINT64_C(0x74CCD4CED8689CF9), UINT64_C(0x793D04924A1175AD), + UINT64_C(0xF6088693AC9455A1), UINT64_C(0xFBF956CF3EEDBCF5), + UINT64_C(0xECEA272A88678708), UINT64_C(0xE11BF7761A1E6E5C), + UINT64_C(0x47D2CB4FCEDD2860), UINT64_C(0x4A231B135CA4C134), + UINT64_C(0x5D306AF6EA2EFAC9), UINT64_C(0x50C1BAAA7857139D), + UINT64_C(0x11A3138442A977B1), UINT64_C(0x1C52C3D8D0D09EE5), + UINT64_C(0x0B41B23D665AA518), UINT64_C(0x06B06261F4234C4C), + UINT64_C(0xA0795E5820E00A70), UINT64_C(0xAD888E04B299E324), + UINT64_C(0xBA9BFFE10413D8D9), UINT64_C(0xB76A2FBD966A318D), + UINT64_C(0xA4F0FBE2C81899C1), UINT64_C(0xA9012BBE5A617095), + UINT64_C(0xBE125A5BECEB4B68), UINT64_C(0xB3E38A077E92A23C), + UINT64_C(0x152AB63EAA51E400), UINT64_C(0x18DB666238280D54), + UINT64_C(0x0FC817878EA236A9), UINT64_C(0x0239C7DB1CDBDFFD), + UINT64_C(0x435B6EF52625BBD1), UINT64_C(0x4EAABEA9B45C5285), + UINT64_C(0x59B9CF4C02D66978), UINT64_C(0x54481F1090AF802C), + UINT64_C(0xF2812329446CC610), UINT64_C(0xFF70F375D6152F44), + UINT64_C(0xE8638290609F14B9), UINT64_C(0xE59252CCF2E6FDED), + UINT64_C(0x6AA7D0CD1463DDE1), UINT64_C(0x67560091861A34B5), + UINT64_C(0x7045717430900F48), UINT64_C(0x7DB4A128A2E9E61C), + UINT64_C(0xDB7D9D11762AA020), UINT64_C(0xD68C4D4DE4534974), + UINT64_C(0xC19F3CA852D97289), UINT64_C(0xCC6EECF4C0A09BDD), + UINT64_C(0x8D0C45DAFA5EFFF1), UINT64_C(0x80FD9586682716A5), + UINT64_C(0x97EEE463DEAD2D58), UINT64_C(0x9A1F343F4CD4C40C), + UINT64_C(0x3CD6080698178230), UINT64_C(0x3127D85A0A6E6B64), + UINT64_C(0x2634A9BFBCE45099), UINT64_C(0x2BC579E32E9DB9CD), + UINT64_C(0xF5A054D6CA71FB90), UINT64_C(0xF851848A580812C4), + UINT64_C(0xEF42F56FEE822939), UINT64_C(0xE2B325337CFBC06D), + UINT64_C(0x447A190AA8388651), UINT64_C(0x498BC9563A416F05), + UINT64_C(0x5E98B8B38CCB54F8), UINT64_C(0x536968EF1EB2BDAC), + UINT64_C(0x120BC1C1244CD980), UINT64_C(0x1FFA119DB63530D4), + UINT64_C(0x08E9607800BF0B29), UINT64_C(0x0518B02492C6E27D), + UINT64_C(0xA3D18C1D4605A441), UINT64_C(0xAE205C41D47C4D15), + UINT64_C(0xB9332DA462F676E8), UINT64_C(0xB4C2FDF8F08F9FBC), + UINT64_C(0x3BF77FF9160ABFB0), UINT64_C(0x3606AFA5847356E4), + UINT64_C(0x2115DE4032F96D19), UINT64_C(0x2CE40E1CA080844D), + UINT64_C(0x8A2D32257443C271), UINT64_C(0x87DCE279E63A2B25), + UINT64_C(0x90CF939C50B010D8), UINT64_C(0x9D3E43C0C2C9F98C), + UINT64_C(0xDC5CEAEEF8379DA0), UINT64_C(0xD1AD3AB26A4E74F4), + UINT64_C(0xC6BE4B57DCC44F09), UINT64_C(0xCB4F9B0B4EBDA65D), + UINT64_C(0x6D86A7329A7EE061), UINT64_C(0x6077776E08070935), + UINT64_C(0x7764068BBE8D32C8), UINT64_C(0x7A95D6D72CF4DB9C), + UINT64_C(0x690F0288728673D0), UINT64_C(0x64FED2D4E0FF9A84), + UINT64_C(0x73EDA3315675A179), UINT64_C(0x7E1C736DC40C482D), + UINT64_C(0xD8D54F5410CF0E11), UINT64_C(0xD5249F0882B6E745), + UINT64_C(0xC237EEED343CDCB8), UINT64_C(0xCFC63EB1A64535EC), + UINT64_C(0x8EA4979F9CBB51C0), UINT64_C(0x835547C30EC2B894), + UINT64_C(0x94463626B8488369), UINT64_C(0x99B7E67A2A316A3D), + UINT64_C(0x3F7EDA43FEF22C01), UINT64_C(0x328F0A1F6C8BC555), + UINT64_C(0x259C7BFADA01FEA8), UINT64_C(0x286DABA6487817FC), + UINT64_C(0xA75829A7AEFD37F0), UINT64_C(0xAAA9F9FB3C84DEA4), + UINT64_C(0xBDBA881E8A0EE559), UINT64_C(0xB04B584218770C0D), + UINT64_C(0x1682647BCCB44A31), UINT64_C(0x1B73B4275ECDA365), + UINT64_C(0x0C60C5C2E8479898), UINT64_C(0x0191159E7A3E71CC), + UINT64_C(0x40F3BCB040C015E0), UINT64_C(0x4D026CECD2B9FCB4), + UINT64_C(0x5A111D096433C749), UINT64_C(0x57E0CD55F64A2E1D), + UINT64_C(0xF129F16C22896821), UINT64_C(0xFCD82130B0F08175), + UINT64_C(0xEBCB50D5067ABA88), UINT64_C(0xE63A8089940353DC), + UINT64_C(0xCDFFF96ABA9EEA11), UINT64_C(0xC00E293628E70345), + UINT64_C(0xD71D58D39E6D38B8), UINT64_C(0xDAEC888F0C14D1EC), + UINT64_C(0x7C25B4B6D8D797D0), UINT64_C(0x71D464EA4AAE7E84), + UINT64_C(0x66C7150FFC244579), UINT64_C(0x6B36C5536E5DAC2D), + UINT64_C(0x2A546C7D54A3C801), UINT64_C(0x27A5BC21C6DA2155), + UINT64_C(0x30B6CDC470501AA8), UINT64_C(0x3D471D98E229F3FC), + UINT64_C(0x9B8E21A136EAB5C0), UINT64_C(0x967FF1FDA4935C94), + UINT64_C(0x816C801812196769), UINT64_C(0x8C9D504480608E3D), + UINT64_C(0x03A8D24566E5AE31), UINT64_C(0x0E590219F49C4765), + UINT64_C(0x194A73FC42167C98), UINT64_C(0x14BBA3A0D06F95CC), + UINT64_C(0xB2729F9904ACD3F0), UINT64_C(0xBF834FC596D53AA4), + UINT64_C(0xA8903E20205F0159), UINT64_C(0xA561EE7CB226E80D), + UINT64_C(0xE403475288D88C21), UINT64_C(0xE9F2970E1AA16575), + UINT64_C(0xFEE1E6EBAC2B5E88), UINT64_C(0xF31036B73E52B7DC), + UINT64_C(0x55D90A8EEA91F1E0), UINT64_C(0x5828DAD278E818B4), + UINT64_C(0x4F3BAB37CE622349), UINT64_C(0x42CA7B6B5C1BCA1D), + UINT64_C(0x5150AF3402696251), UINT64_C(0x5CA17F6890108B05), + UINT64_C(0x4BB20E8D269AB0F8), UINT64_C(0x4643DED1B4E359AC), + UINT64_C(0xE08AE2E860201F90), UINT64_C(0xED7B32B4F259F6C4), + UINT64_C(0xFA68435144D3CD39), UINT64_C(0xF799930DD6AA246D), + UINT64_C(0xB6FB3A23EC544041), UINT64_C(0xBB0AEA7F7E2DA915), + UINT64_C(0xAC199B9AC8A792E8), UINT64_C(0xA1E84BC65ADE7BBC), + UINT64_C(0x072177FF8E1D3D80), UINT64_C(0x0AD0A7A31C64D4D4), + UINT64_C(0x1DC3D646AAEEEF29), UINT64_C(0x1032061A3897067D), + UINT64_C(0x9F07841BDE122671), UINT64_C(0x92F654474C6BCF25), + UINT64_C(0x85E525A2FAE1F4D8), UINT64_C(0x8814F5FE68981D8C), + UINT64_C(0x2EDDC9C7BC5B5BB0), UINT64_C(0x232C199B2E22B2E4), + UINT64_C(0x343F687E98A88919), UINT64_C(0x39CEB8220AD1604D), + UINT64_C(0x78AC110C302F0461), UINT64_C(0x755DC150A256ED35), + UINT64_C(0x624EB0B514DCD6C8), UINT64_C(0x6FBF60E986A53F9C), + UINT64_C(0xC9765CD0526679A0), UINT64_C(0xC4878C8CC01F90F4), + UINT64_C(0xD394FD697695AB09), UINT64_C(0xDE652D35E4EC425D) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0xCB6D6A914AE10B3F), + UINT64_C(0x96DBD42295C2177E), UINT64_C(0x5DB6BEB3DF231C41), + UINT64_C(0x2CB7A9452A852FFC), UINT64_C(0xE7DAC3D4606424C3), + UINT64_C(0xBA6C7D67BF473882), UINT64_C(0x710117F6F5A633BD), + UINT64_C(0xDD705D247FA5876A), UINT64_C(0x161D37B535448C55), + UINT64_C(0x4BAB8906EA679014), UINT64_C(0x80C6E397A0869B2B), + UINT64_C(0xF1C7F4615520A896), UINT64_C(0x3AAA9EF01FC1A3A9), + UINT64_C(0x671C2043C0E2BFE8), UINT64_C(0xAC714AD28A03B4D7), + UINT64_C(0xBAE1BA48FE4A0FD5), UINT64_C(0x718CD0D9B4AB04EA), + UINT64_C(0x2C3A6E6A6B8818AB), UINT64_C(0xE75704FB21691394), + UINT64_C(0x9656130DD4CF2029), UINT64_C(0x5D3B799C9E2E2B16), + UINT64_C(0x008DC72F410D3757), UINT64_C(0xCBE0ADBE0BEC3C68), + UINT64_C(0x6791E76C81EF88BF), UINT64_C(0xACFC8DFDCB0E8380), + UINT64_C(0xF14A334E142D9FC1), UINT64_C(0x3A2759DF5ECC94FE), + UINT64_C(0x4B264E29AB6AA743), UINT64_C(0x804B24B8E18BAC7C), + UINT64_C(0xDDFD9A0B3EA8B03D), UINT64_C(0x1690F09A7449BB02), + UINT64_C(0xF1DD7B3ED73AC638), UINT64_C(0x3AB011AF9DDBCD07), + UINT64_C(0x6706AF1C42F8D146), UINT64_C(0xAC6BC58D0819DA79), + UINT64_C(0xDD6AD27BFDBFE9C4), UINT64_C(0x1607B8EAB75EE2FB), + UINT64_C(0x4BB10659687DFEBA), UINT64_C(0x80DC6CC8229CF585), + UINT64_C(0x2CAD261AA89F4152), UINT64_C(0xE7C04C8BE27E4A6D), + UINT64_C(0xBA76F2383D5D562C), UINT64_C(0x711B98A977BC5D13), + UINT64_C(0x001A8F5F821A6EAE), UINT64_C(0xCB77E5CEC8FB6591), + UINT64_C(0x96C15B7D17D879D0), UINT64_C(0x5DAC31EC5D3972EF), + UINT64_C(0x4B3CC1762970C9ED), UINT64_C(0x8051ABE76391C2D2), + UINT64_C(0xDDE71554BCB2DE93), UINT64_C(0x168A7FC5F653D5AC), + UINT64_C(0x678B683303F5E611), UINT64_C(0xACE602A24914ED2E), + UINT64_C(0xF150BC119637F16F), UINT64_C(0x3A3DD680DCD6FA50), + UINT64_C(0x964C9C5256D54E87), UINT64_C(0x5D21F6C31C3445B8), + UINT64_C(0x00974870C31759F9), UINT64_C(0xCBFA22E189F652C6), + UINT64_C(0xBAFB35177C50617B), UINT64_C(0x71965F8636B16A44), + UINT64_C(0x2C20E135E9927605), UINT64_C(0xE74D8BA4A3737D3A), + UINT64_C(0xE2BBF77CAE758C71), UINT64_C(0x29D69DEDE494874E), + UINT64_C(0x7460235E3BB79B0F), UINT64_C(0xBF0D49CF71569030), + UINT64_C(0xCE0C5E3984F0A38D), UINT64_C(0x056134A8CE11A8B2), + UINT64_C(0x58D78A1B1132B4F3), UINT64_C(0x93BAE08A5BD3BFCC), + UINT64_C(0x3FCBAA58D1D00B1B), UINT64_C(0xF4A6C0C99B310024), + UINT64_C(0xA9107E7A44121C65), UINT64_C(0x627D14EB0EF3175A), + UINT64_C(0x137C031DFB5524E7), UINT64_C(0xD811698CB1B42FD8), + UINT64_C(0x85A7D73F6E973399), UINT64_C(0x4ECABDAE247638A6), + UINT64_C(0x585A4D34503F83A4), UINT64_C(0x933727A51ADE889B), + UINT64_C(0xCE819916C5FD94DA), UINT64_C(0x05ECF3878F1C9FE5), + UINT64_C(0x74EDE4717ABAAC58), UINT64_C(0xBF808EE0305BA767), + UINT64_C(0xE2363053EF78BB26), UINT64_C(0x295B5AC2A599B019), + UINT64_C(0x852A10102F9A04CE), UINT64_C(0x4E477A81657B0FF1), + UINT64_C(0x13F1C432BA5813B0), UINT64_C(0xD89CAEA3F0B9188F), + UINT64_C(0xA99DB955051F2B32), UINT64_C(0x62F0D3C44FFE200D), + UINT64_C(0x3F466D7790DD3C4C), UINT64_C(0xF42B07E6DA3C3773), + UINT64_C(0x13668C42794F4A49), UINT64_C(0xD80BE6D333AE4176), + UINT64_C(0x85BD5860EC8D5D37), UINT64_C(0x4ED032F1A66C5608), + UINT64_C(0x3FD1250753CA65B5), UINT64_C(0xF4BC4F96192B6E8A), + UINT64_C(0xA90AF125C60872CB), UINT64_C(0x62679BB48CE979F4), + UINT64_C(0xCE16D16606EACD23), UINT64_C(0x057BBBF74C0BC61C), + UINT64_C(0x58CD05449328DA5D), UINT64_C(0x93A06FD5D9C9D162), + UINT64_C(0xE2A178232C6FE2DF), UINT64_C(0x29CC12B2668EE9E0), + UINT64_C(0x747AAC01B9ADF5A1), UINT64_C(0xBF17C690F34CFE9E), + UINT64_C(0xA987360A8705459C), UINT64_C(0x62EA5C9BCDE44EA3), + UINT64_C(0x3F5CE22812C752E2), UINT64_C(0xF43188B9582659DD), + UINT64_C(0x85309F4FAD806A60), UINT64_C(0x4E5DF5DEE761615F), + UINT64_C(0x13EB4B6D38427D1E), UINT64_C(0xD88621FC72A37621), + UINT64_C(0x74F76B2EF8A0C2F6), UINT64_C(0xBF9A01BFB241C9C9), + UINT64_C(0xE22CBF0C6D62D588), UINT64_C(0x2941D59D2783DEB7), + UINT64_C(0x5840C26BD225ED0A), UINT64_C(0x932DA8FA98C4E635), + UINT64_C(0xCE9B164947E7FA74), UINT64_C(0x05F67CD80D06F14B), + UINT64_C(0xC477EFF95CEB18E3), UINT64_C(0x0F1A8568160A13DC), + UINT64_C(0x52AC3BDBC9290F9D), UINT64_C(0x99C1514A83C804A2), + UINT64_C(0xE8C046BC766E371F), UINT64_C(0x23AD2C2D3C8F3C20), + UINT64_C(0x7E1B929EE3AC2061), UINT64_C(0xB576F80FA94D2B5E), + UINT64_C(0x1907B2DD234E9F89), UINT64_C(0xD26AD84C69AF94B6), + UINT64_C(0x8FDC66FFB68C88F7), UINT64_C(0x44B10C6EFC6D83C8), + UINT64_C(0x35B01B9809CBB075), UINT64_C(0xFEDD7109432ABB4A), + UINT64_C(0xA36BCFBA9C09A70B), UINT64_C(0x6806A52BD6E8AC34), + UINT64_C(0x7E9655B1A2A11736), UINT64_C(0xB5FB3F20E8401C09), + UINT64_C(0xE84D819337630048), UINT64_C(0x2320EB027D820B77), + UINT64_C(0x5221FCF4882438CA), UINT64_C(0x994C9665C2C533F5), + UINT64_C(0xC4FA28D61DE62FB4), UINT64_C(0x0F9742475707248B), + UINT64_C(0xA3E60895DD04905C), UINT64_C(0x688B620497E59B63), + UINT64_C(0x353DDCB748C68722), UINT64_C(0xFE50B62602278C1D), + UINT64_C(0x8F51A1D0F781BFA0), UINT64_C(0x443CCB41BD60B49F), + UINT64_C(0x198A75F26243A8DE), UINT64_C(0xD2E71F6328A2A3E1), + UINT64_C(0x35AA94C78BD1DEDB), UINT64_C(0xFEC7FE56C130D5E4), + UINT64_C(0xA37140E51E13C9A5), UINT64_C(0x681C2A7454F2C29A), + UINT64_C(0x191D3D82A154F127), UINT64_C(0xD2705713EBB5FA18), + UINT64_C(0x8FC6E9A03496E659), UINT64_C(0x44AB83317E77ED66), + UINT64_C(0xE8DAC9E3F47459B1), UINT64_C(0x23B7A372BE95528E), + UINT64_C(0x7E011DC161B64ECF), UINT64_C(0xB56C77502B5745F0), + UINT64_C(0xC46D60A6DEF1764D), UINT64_C(0x0F000A3794107D72), + UINT64_C(0x52B6B4844B336133), UINT64_C(0x99DBDE1501D26A0C), + UINT64_C(0x8F4B2E8F759BD10E), UINT64_C(0x4426441E3F7ADA31), + UINT64_C(0x1990FAADE059C670), UINT64_C(0xD2FD903CAAB8CD4F), + UINT64_C(0xA3FC87CA5F1EFEF2), UINT64_C(0x6891ED5B15FFF5CD), + UINT64_C(0x352753E8CADCE98C), UINT64_C(0xFE4A3979803DE2B3), + UINT64_C(0x523B73AB0A3E5664), UINT64_C(0x9956193A40DF5D5B), + UINT64_C(0xC4E0A7899FFC411A), UINT64_C(0x0F8DCD18D51D4A25), + UINT64_C(0x7E8CDAEE20BB7998), UINT64_C(0xB5E1B07F6A5A72A7), + UINT64_C(0xE8570ECCB5796EE6), UINT64_C(0x233A645DFF9865D9), + UINT64_C(0x26CC1885F29E9492), UINT64_C(0xEDA17214B87F9FAD), + UINT64_C(0xB017CCA7675C83EC), UINT64_C(0x7B7AA6362DBD88D3), + UINT64_C(0x0A7BB1C0D81BBB6E), UINT64_C(0xC116DB5192FAB051), + UINT64_C(0x9CA065E24DD9AC10), UINT64_C(0x57CD0F730738A72F), + UINT64_C(0xFBBC45A18D3B13F8), UINT64_C(0x30D12F30C7DA18C7), + UINT64_C(0x6D67918318F90486), UINT64_C(0xA60AFB1252180FB9), + UINT64_C(0xD70BECE4A7BE3C04), UINT64_C(0x1C668675ED5F373B), + UINT64_C(0x41D038C6327C2B7A), UINT64_C(0x8ABD5257789D2045), + UINT64_C(0x9C2DA2CD0CD49B47), UINT64_C(0x5740C85C46359078), + UINT64_C(0x0AF676EF99168C39), UINT64_C(0xC19B1C7ED3F78706), + UINT64_C(0xB09A0B882651B4BB), UINT64_C(0x7BF761196CB0BF84), + UINT64_C(0x2641DFAAB393A3C5), UINT64_C(0xED2CB53BF972A8FA), + UINT64_C(0x415DFFE973711C2D), UINT64_C(0x8A30957839901712), + UINT64_C(0xD7862BCBE6B30B53), UINT64_C(0x1CEB415AAC52006C), + UINT64_C(0x6DEA56AC59F433D1), UINT64_C(0xA6873C3D131538EE), + UINT64_C(0xFB31828ECC3624AF), UINT64_C(0x305CE81F86D72F90), + UINT64_C(0xD71163BB25A452AA), UINT64_C(0x1C7C092A6F455995), + UINT64_C(0x41CAB799B06645D4), UINT64_C(0x8AA7DD08FA874EEB), + UINT64_C(0xFBA6CAFE0F217D56), UINT64_C(0x30CBA06F45C07669), + UINT64_C(0x6D7D1EDC9AE36A28), UINT64_C(0xA610744DD0026117), + UINT64_C(0x0A613E9F5A01D5C0), UINT64_C(0xC10C540E10E0DEFF), + UINT64_C(0x9CBAEABDCFC3C2BE), UINT64_C(0x57D7802C8522C981), + UINT64_C(0x26D697DA7084FA3C), UINT64_C(0xEDBBFD4B3A65F103), + UINT64_C(0xB00D43F8E546ED42), UINT64_C(0x7B602969AFA7E67D), + UINT64_C(0x6DF0D9F3DBEE5D7F), UINT64_C(0xA69DB362910F5640), + UINT64_C(0xFB2B0DD14E2C4A01), UINT64_C(0x3046674004CD413E), + UINT64_C(0x414770B6F16B7283), UINT64_C(0x8A2A1A27BB8A79BC), + UINT64_C(0xD79CA49464A965FD), UINT64_C(0x1CF1CE052E486EC2), + UINT64_C(0xB08084D7A44BDA15), UINT64_C(0x7BEDEE46EEAAD12A), + UINT64_C(0x265B50F53189CD6B), UINT64_C(0xED363A647B68C654), + UINT64_C(0x9C372D928ECEF5E9), UINT64_C(0x575A4703C42FFED6), + UINT64_C(0x0AECF9B01B0CE297), UINT64_C(0xC181932151EDE9A8) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0xDCA12C225E8AEE1D), + UINT64_C(0xB8435944BC14DD3B), UINT64_C(0x64E27566E29E3326), + UINT64_C(0x7087B2887829BA77), UINT64_C(0xAC269EAA26A3546A), + UINT64_C(0xC8C4EBCCC43D674C), UINT64_C(0x1465C7EE9AB78951), + UINT64_C(0xE00E6511F15274EF), UINT64_C(0x3CAF4933AFD89AF2), + UINT64_C(0x584D3C554D46A9D4), UINT64_C(0x84EC107713CC47C9), + UINT64_C(0x9089D799897BCE98), UINT64_C(0x4C28FBBBD7F12085), + UINT64_C(0x28CA8EDD356F13A3), UINT64_C(0xF46BA2FF6BE5FDBE), + UINT64_C(0x4503C48DC90A304C), UINT64_C(0x99A2E8AF9780DE51), + UINT64_C(0xFD409DC9751EED77), UINT64_C(0x21E1B1EB2B94036A), + UINT64_C(0x35847605B1238A3B), UINT64_C(0xE9255A27EFA96426), + UINT64_C(0x8DC72F410D375700), UINT64_C(0x5166036353BDB91D), + UINT64_C(0xA50DA19C385844A3), UINT64_C(0x79AC8DBE66D2AABE), + UINT64_C(0x1D4EF8D8844C9998), UINT64_C(0xC1EFD4FADAC67785), + UINT64_C(0xD58A13144071FED4), UINT64_C(0x092B3F361EFB10C9), + UINT64_C(0x6DC94A50FC6523EF), UINT64_C(0xB1686672A2EFCDF2), + UINT64_C(0x8A06881B93156098), UINT64_C(0x56A7A439CD9F8E85), + UINT64_C(0x3245D15F2F01BDA3), UINT64_C(0xEEE4FD7D718B53BE), + UINT64_C(0xFA813A93EB3CDAEF), UINT64_C(0x262016B1B5B634F2), + UINT64_C(0x42C263D7572807D4), UINT64_C(0x9E634FF509A2E9C9), + UINT64_C(0x6A08ED0A62471477), UINT64_C(0xB6A9C1283CCDFA6A), + UINT64_C(0xD24BB44EDE53C94C), UINT64_C(0x0EEA986C80D92751), + UINT64_C(0x1A8F5F821A6EAE00), UINT64_C(0xC62E73A044E4401D), + UINT64_C(0xA2CC06C6A67A733B), UINT64_C(0x7E6D2AE4F8F09D26), + UINT64_C(0xCF054C965A1F50D4), UINT64_C(0x13A460B40495BEC9), + UINT64_C(0x774615D2E60B8DEF), UINT64_C(0xABE739F0B88163F2), + UINT64_C(0xBF82FE1E2236EAA3), UINT64_C(0x6323D23C7CBC04BE), + UINT64_C(0x07C1A75A9E223798), UINT64_C(0xDB608B78C0A8D985), + UINT64_C(0x2F0B2987AB4D243B), UINT64_C(0xF3AA05A5F5C7CA26), + UINT64_C(0x974870C31759F900), UINT64_C(0x4BE95CE149D3171D), + UINT64_C(0x5F8C9B0FD3649E4C), UINT64_C(0x832DB72D8DEE7051), + UINT64_C(0xE7CFC24B6F704377), UINT64_C(0x3B6EEE6931FAAD6A), + UINT64_C(0x91131E980D8418A2), UINT64_C(0x4DB232BA530EF6BF), + UINT64_C(0x295047DCB190C599), UINT64_C(0xF5F16BFEEF1A2B84), + UINT64_C(0xE194AC1075ADA2D5), UINT64_C(0x3D3580322B274CC8), + UINT64_C(0x59D7F554C9B97FEE), UINT64_C(0x8576D976973391F3), + UINT64_C(0x711D7B89FCD66C4D), UINT64_C(0xADBC57ABA25C8250), + UINT64_C(0xC95E22CD40C2B176), UINT64_C(0x15FF0EEF1E485F6B), + UINT64_C(0x019AC90184FFD63A), UINT64_C(0xDD3BE523DA753827), + UINT64_C(0xB9D9904538EB0B01), UINT64_C(0x6578BC676661E51C), + UINT64_C(0xD410DA15C48E28EE), UINT64_C(0x08B1F6379A04C6F3), + UINT64_C(0x6C538351789AF5D5), UINT64_C(0xB0F2AF7326101BC8), + UINT64_C(0xA497689DBCA79299), UINT64_C(0x783644BFE22D7C84), + UINT64_C(0x1CD431D900B34FA2), UINT64_C(0xC0751DFB5E39A1BF), + UINT64_C(0x341EBF0435DC5C01), UINT64_C(0xE8BF93266B56B21C), + UINT64_C(0x8C5DE64089C8813A), UINT64_C(0x50FCCA62D7426F27), + UINT64_C(0x44990D8C4DF5E676), UINT64_C(0x983821AE137F086B), + UINT64_C(0xFCDA54C8F1E13B4D), UINT64_C(0x207B78EAAF6BD550), + UINT64_C(0x1B1596839E91783A), UINT64_C(0xC7B4BAA1C01B9627), + UINT64_C(0xA356CFC72285A501), UINT64_C(0x7FF7E3E57C0F4B1C), + UINT64_C(0x6B92240BE6B8C24D), UINT64_C(0xB7330829B8322C50), + UINT64_C(0xD3D17D4F5AAC1F76), UINT64_C(0x0F70516D0426F16B), + UINT64_C(0xFB1BF3926FC30CD5), UINT64_C(0x27BADFB03149E2C8), + UINT64_C(0x4358AAD6D3D7D1EE), UINT64_C(0x9FF986F48D5D3FF3), + UINT64_C(0x8B9C411A17EAB6A2), UINT64_C(0x573D6D38496058BF), + UINT64_C(0x33DF185EABFE6B99), UINT64_C(0xEF7E347CF5748584), + UINT64_C(0x5E16520E579B4876), UINT64_C(0x82B77E2C0911A66B), + UINT64_C(0xE6550B4AEB8F954D), UINT64_C(0x3AF42768B5057B50), + UINT64_C(0x2E91E0862FB2F201), UINT64_C(0xF230CCA471381C1C), + UINT64_C(0x96D2B9C293A62F3A), UINT64_C(0x4A7395E0CD2CC127), + UINT64_C(0xBE18371FA6C93C99), UINT64_C(0x62B91B3DF843D284), + UINT64_C(0x065B6E5B1ADDE1A2), UINT64_C(0xDAFA427944570FBF), + UINT64_C(0xCE9F8597DEE086EE), UINT64_C(0x123EA9B5806A68F3), + UINT64_C(0x76DCDCD362F45BD5), UINT64_C(0xAA7DF0F13C7EB5C8), + UINT64_C(0xA739329F30A7E9D6), UINT64_C(0x7B981EBD6E2D07CB), + UINT64_C(0x1F7A6BDB8CB334ED), UINT64_C(0xC3DB47F9D239DAF0), + UINT64_C(0xD7BE8017488E53A1), UINT64_C(0x0B1FAC351604BDBC), + UINT64_C(0x6FFDD953F49A8E9A), UINT64_C(0xB35CF571AA106087), + UINT64_C(0x4737578EC1F59D39), UINT64_C(0x9B967BAC9F7F7324), + UINT64_C(0xFF740ECA7DE14002), UINT64_C(0x23D522E8236BAE1F), + UINT64_C(0x37B0E506B9DC274E), UINT64_C(0xEB11C924E756C953), + UINT64_C(0x8FF3BC4205C8FA75), UINT64_C(0x535290605B421468), + UINT64_C(0xE23AF612F9ADD99A), UINT64_C(0x3E9BDA30A7273787), + UINT64_C(0x5A79AF5645B904A1), UINT64_C(0x86D883741B33EABC), + UINT64_C(0x92BD449A818463ED), UINT64_C(0x4E1C68B8DF0E8DF0), + UINT64_C(0x2AFE1DDE3D90BED6), UINT64_C(0xF65F31FC631A50CB), + UINT64_C(0x0234930308FFAD75), UINT64_C(0xDE95BF2156754368), + UINT64_C(0xBA77CA47B4EB704E), UINT64_C(0x66D6E665EA619E53), + UINT64_C(0x72B3218B70D61702), UINT64_C(0xAE120DA92E5CF91F), + UINT64_C(0xCAF078CFCCC2CA39), UINT64_C(0x165154ED92482424), + UINT64_C(0x2D3FBA84A3B2894E), UINT64_C(0xF19E96A6FD386753), + UINT64_C(0x957CE3C01FA65475), UINT64_C(0x49DDCFE2412CBA68), + UINT64_C(0x5DB8080CDB9B3339), UINT64_C(0x8119242E8511DD24), + UINT64_C(0xE5FB5148678FEE02), UINT64_C(0x395A7D6A3905001F), + UINT64_C(0xCD31DF9552E0FDA1), UINT64_C(0x1190F3B70C6A13BC), + UINT64_C(0x757286D1EEF4209A), UINT64_C(0xA9D3AAF3B07ECE87), + UINT64_C(0xBDB66D1D2AC947D6), UINT64_C(0x6117413F7443A9CB), + UINT64_C(0x05F5345996DD9AED), UINT64_C(0xD954187BC85774F0), + UINT64_C(0x683C7E096AB8B902), UINT64_C(0xB49D522B3432571F), + UINT64_C(0xD07F274DD6AC6439), UINT64_C(0x0CDE0B6F88268A24), + UINT64_C(0x18BBCC8112910375), UINT64_C(0xC41AE0A34C1BED68), + UINT64_C(0xA0F895C5AE85DE4E), UINT64_C(0x7C59B9E7F00F3053), + UINT64_C(0x88321B189BEACDED), UINT64_C(0x5493373AC56023F0), + UINT64_C(0x3071425C27FE10D6), UINT64_C(0xECD06E7E7974FECB), + UINT64_C(0xF8B5A990E3C3779A), UINT64_C(0x241485B2BD499987), + UINT64_C(0x40F6F0D45FD7AAA1), UINT64_C(0x9C57DCF6015D44BC), + UINT64_C(0x362A2C073D23F174), UINT64_C(0xEA8B002563A91F69), + UINT64_C(0x8E69754381372C4F), UINT64_C(0x52C85961DFBDC252), + UINT64_C(0x46AD9E8F450A4B03), UINT64_C(0x9A0CB2AD1B80A51E), + UINT64_C(0xFEEEC7CBF91E9638), UINT64_C(0x224FEBE9A7947825), + UINT64_C(0xD6244916CC71859B), UINT64_C(0x0A85653492FB6B86), + UINT64_C(0x6E671052706558A0), UINT64_C(0xB2C63C702EEFB6BD), + UINT64_C(0xA6A3FB9EB4583FEC), UINT64_C(0x7A02D7BCEAD2D1F1), + UINT64_C(0x1EE0A2DA084CE2D7), UINT64_C(0xC2418EF856C60CCA), + UINT64_C(0x7329E88AF429C138), UINT64_C(0xAF88C4A8AAA32F25), + UINT64_C(0xCB6AB1CE483D1C03), UINT64_C(0x17CB9DEC16B7F21E), + UINT64_C(0x03AE5A028C007B4F), UINT64_C(0xDF0F7620D28A9552), + UINT64_C(0xBBED03463014A674), UINT64_C(0x674C2F646E9E4869), + UINT64_C(0x93278D9B057BB5D7), UINT64_C(0x4F86A1B95BF15BCA), + UINT64_C(0x2B64D4DFB96F68EC), UINT64_C(0xF7C5F8FDE7E586F1), + UINT64_C(0xE3A03F137D520FA0), UINT64_C(0x3F01133123D8E1BD), + UINT64_C(0x5BE36657C146D29B), UINT64_C(0x87424A759FCC3C86), + UINT64_C(0xBC2CA41CAE3691EC), UINT64_C(0x608D883EF0BC7FF1), + UINT64_C(0x046FFD5812224CD7), UINT64_C(0xD8CED17A4CA8A2CA), + UINT64_C(0xCCAB1694D61F2B9B), UINT64_C(0x100A3AB68895C586), + UINT64_C(0x74E84FD06A0BF6A0), UINT64_C(0xA84963F2348118BD), + UINT64_C(0x5C22C10D5F64E503), UINT64_C(0x8083ED2F01EE0B1E), + UINT64_C(0xE4619849E3703838), UINT64_C(0x38C0B46BBDFAD625), + UINT64_C(0x2CA57385274D5F74), UINT64_C(0xF0045FA779C7B169), + UINT64_C(0x94E62AC19B59824F), UINT64_C(0x484706E3C5D36C52), + UINT64_C(0xF92F6091673CA1A0), UINT64_C(0x258E4CB339B64FBD), + UINT64_C(0x416C39D5DB287C9B), UINT64_C(0x9DCD15F785A29286), + UINT64_C(0x89A8D2191F151BD7), UINT64_C(0x5509FE3B419FF5CA), + UINT64_C(0x31EB8B5DA301C6EC), UINT64_C(0xED4AA77FFD8B28F1), + UINT64_C(0x19210580966ED54F), UINT64_C(0xC58029A2C8E43B52), + UINT64_C(0xA1625CC42A7A0874), UINT64_C(0x7DC370E674F0E669), + UINT64_C(0x69A6B708EE476F38), UINT64_C(0xB5079B2AB0CD8125), + UINT64_C(0xD1E5EE4C5253B203), UINT64_C(0x0D44C26E0CD95C1E) + } +}; diff --git a/src/liblzma/check/crc64_table_le.h b/src/liblzma/check/crc64_table_le.h new file mode 100644 index 000000000000..1196b31e1323 --- /dev/null +++ b/src/liblzma/check/crc64_table_le.h @@ -0,0 +1,521 @@ +/* This file has been automatically generated by crc64_tablegen.c. */ + +const uint64_t lzma_crc64_table[4][256] = { + { + UINT64_C(0x0000000000000000), UINT64_C(0xB32E4CBE03A75F6F), + UINT64_C(0xF4843657A840A05B), UINT64_C(0x47AA7AE9ABE7FF34), + UINT64_C(0x7BD0C384FF8F5E33), UINT64_C(0xC8FE8F3AFC28015C), + UINT64_C(0x8F54F5D357CFFE68), UINT64_C(0x3C7AB96D5468A107), + UINT64_C(0xF7A18709FF1EBC66), UINT64_C(0x448FCBB7FCB9E309), + UINT64_C(0x0325B15E575E1C3D), UINT64_C(0xB00BFDE054F94352), + UINT64_C(0x8C71448D0091E255), UINT64_C(0x3F5F08330336BD3A), + UINT64_C(0x78F572DAA8D1420E), UINT64_C(0xCBDB3E64AB761D61), + UINT64_C(0x7D9BA13851336649), UINT64_C(0xCEB5ED8652943926), + UINT64_C(0x891F976FF973C612), UINT64_C(0x3A31DBD1FAD4997D), + UINT64_C(0x064B62BCAEBC387A), UINT64_C(0xB5652E02AD1B6715), + UINT64_C(0xF2CF54EB06FC9821), UINT64_C(0x41E11855055BC74E), + UINT64_C(0x8A3A2631AE2DDA2F), UINT64_C(0x39146A8FAD8A8540), + UINT64_C(0x7EBE1066066D7A74), UINT64_C(0xCD905CD805CA251B), + UINT64_C(0xF1EAE5B551A2841C), UINT64_C(0x42C4A90B5205DB73), + UINT64_C(0x056ED3E2F9E22447), UINT64_C(0xB6409F5CFA457B28), + UINT64_C(0xFB374270A266CC92), UINT64_C(0x48190ECEA1C193FD), + UINT64_C(0x0FB374270A266CC9), UINT64_C(0xBC9D3899098133A6), + UINT64_C(0x80E781F45DE992A1), UINT64_C(0x33C9CD4A5E4ECDCE), + UINT64_C(0x7463B7A3F5A932FA), UINT64_C(0xC74DFB1DF60E6D95), + UINT64_C(0x0C96C5795D7870F4), UINT64_C(0xBFB889C75EDF2F9B), + UINT64_C(0xF812F32EF538D0AF), UINT64_C(0x4B3CBF90F69F8FC0), + UINT64_C(0x774606FDA2F72EC7), UINT64_C(0xC4684A43A15071A8), + UINT64_C(0x83C230AA0AB78E9C), UINT64_C(0x30EC7C140910D1F3), + UINT64_C(0x86ACE348F355AADB), UINT64_C(0x3582AFF6F0F2F5B4), + UINT64_C(0x7228D51F5B150A80), UINT64_C(0xC10699A158B255EF), + UINT64_C(0xFD7C20CC0CDAF4E8), UINT64_C(0x4E526C720F7DAB87), + UINT64_C(0x09F8169BA49A54B3), UINT64_C(0xBAD65A25A73D0BDC), + UINT64_C(0x710D64410C4B16BD), UINT64_C(0xC22328FF0FEC49D2), + UINT64_C(0x85895216A40BB6E6), UINT64_C(0x36A71EA8A7ACE989), + UINT64_C(0x0ADDA7C5F3C4488E), UINT64_C(0xB9F3EB7BF06317E1), + UINT64_C(0xFE5991925B84E8D5), UINT64_C(0x4D77DD2C5823B7BA), + UINT64_C(0x64B62BCAEBC387A1), UINT64_C(0xD7986774E864D8CE), + UINT64_C(0x90321D9D438327FA), UINT64_C(0x231C512340247895), + UINT64_C(0x1F66E84E144CD992), UINT64_C(0xAC48A4F017EB86FD), + UINT64_C(0xEBE2DE19BC0C79C9), UINT64_C(0x58CC92A7BFAB26A6), + UINT64_C(0x9317ACC314DD3BC7), UINT64_C(0x2039E07D177A64A8), + UINT64_C(0x67939A94BC9D9B9C), UINT64_C(0xD4BDD62ABF3AC4F3), + UINT64_C(0xE8C76F47EB5265F4), UINT64_C(0x5BE923F9E8F53A9B), + UINT64_C(0x1C4359104312C5AF), UINT64_C(0xAF6D15AE40B59AC0), + UINT64_C(0x192D8AF2BAF0E1E8), UINT64_C(0xAA03C64CB957BE87), + UINT64_C(0xEDA9BCA512B041B3), UINT64_C(0x5E87F01B11171EDC), + UINT64_C(0x62FD4976457FBFDB), UINT64_C(0xD1D305C846D8E0B4), + UINT64_C(0x96797F21ED3F1F80), UINT64_C(0x2557339FEE9840EF), + UINT64_C(0xEE8C0DFB45EE5D8E), UINT64_C(0x5DA24145464902E1), + UINT64_C(0x1A083BACEDAEFDD5), UINT64_C(0xA9267712EE09A2BA), + UINT64_C(0x955CCE7FBA6103BD), UINT64_C(0x267282C1B9C65CD2), + UINT64_C(0x61D8F8281221A3E6), UINT64_C(0xD2F6B4961186FC89), + UINT64_C(0x9F8169BA49A54B33), UINT64_C(0x2CAF25044A02145C), + UINT64_C(0x6B055FEDE1E5EB68), UINT64_C(0xD82B1353E242B407), + UINT64_C(0xE451AA3EB62A1500), UINT64_C(0x577FE680B58D4A6F), + UINT64_C(0x10D59C691E6AB55B), UINT64_C(0xA3FBD0D71DCDEA34), + UINT64_C(0x6820EEB3B6BBF755), UINT64_C(0xDB0EA20DB51CA83A), + UINT64_C(0x9CA4D8E41EFB570E), UINT64_C(0x2F8A945A1D5C0861), + UINT64_C(0x13F02D374934A966), UINT64_C(0xA0DE61894A93F609), + UINT64_C(0xE7741B60E174093D), UINT64_C(0x545A57DEE2D35652), + UINT64_C(0xE21AC88218962D7A), UINT64_C(0x5134843C1B317215), + UINT64_C(0x169EFED5B0D68D21), UINT64_C(0xA5B0B26BB371D24E), + UINT64_C(0x99CA0B06E7197349), UINT64_C(0x2AE447B8E4BE2C26), + UINT64_C(0x6D4E3D514F59D312), UINT64_C(0xDE6071EF4CFE8C7D), + UINT64_C(0x15BB4F8BE788911C), UINT64_C(0xA6950335E42FCE73), + UINT64_C(0xE13F79DC4FC83147), UINT64_C(0x521135624C6F6E28), + UINT64_C(0x6E6B8C0F1807CF2F), UINT64_C(0xDD45C0B11BA09040), + UINT64_C(0x9AEFBA58B0476F74), UINT64_C(0x29C1F6E6B3E0301B), + UINT64_C(0xC96C5795D7870F42), UINT64_C(0x7A421B2BD420502D), + UINT64_C(0x3DE861C27FC7AF19), UINT64_C(0x8EC62D7C7C60F076), + UINT64_C(0xB2BC941128085171), UINT64_C(0x0192D8AF2BAF0E1E), + UINT64_C(0x4638A2468048F12A), UINT64_C(0xF516EEF883EFAE45), + UINT64_C(0x3ECDD09C2899B324), UINT64_C(0x8DE39C222B3EEC4B), + UINT64_C(0xCA49E6CB80D9137F), UINT64_C(0x7967AA75837E4C10), + UINT64_C(0x451D1318D716ED17), UINT64_C(0xF6335FA6D4B1B278), + UINT64_C(0xB199254F7F564D4C), UINT64_C(0x02B769F17CF11223), + UINT64_C(0xB4F7F6AD86B4690B), UINT64_C(0x07D9BA1385133664), + UINT64_C(0x4073C0FA2EF4C950), UINT64_C(0xF35D8C442D53963F), + UINT64_C(0xCF273529793B3738), UINT64_C(0x7C0979977A9C6857), + UINT64_C(0x3BA3037ED17B9763), UINT64_C(0x888D4FC0D2DCC80C), + UINT64_C(0x435671A479AAD56D), UINT64_C(0xF0783D1A7A0D8A02), + UINT64_C(0xB7D247F3D1EA7536), UINT64_C(0x04FC0B4DD24D2A59), + UINT64_C(0x3886B22086258B5E), UINT64_C(0x8BA8FE9E8582D431), + UINT64_C(0xCC0284772E652B05), UINT64_C(0x7F2CC8C92DC2746A), + UINT64_C(0x325B15E575E1C3D0), UINT64_C(0x8175595B76469CBF), + UINT64_C(0xC6DF23B2DDA1638B), UINT64_C(0x75F16F0CDE063CE4), + UINT64_C(0x498BD6618A6E9DE3), UINT64_C(0xFAA59ADF89C9C28C), + UINT64_C(0xBD0FE036222E3DB8), UINT64_C(0x0E21AC88218962D7), + UINT64_C(0xC5FA92EC8AFF7FB6), UINT64_C(0x76D4DE52895820D9), + UINT64_C(0x317EA4BB22BFDFED), UINT64_C(0x8250E80521188082), + UINT64_C(0xBE2A516875702185), UINT64_C(0x0D041DD676D77EEA), + UINT64_C(0x4AAE673FDD3081DE), UINT64_C(0xF9802B81DE97DEB1), + UINT64_C(0x4FC0B4DD24D2A599), UINT64_C(0xFCEEF8632775FAF6), + UINT64_C(0xBB44828A8C9205C2), UINT64_C(0x086ACE348F355AAD), + UINT64_C(0x34107759DB5DFBAA), UINT64_C(0x873E3BE7D8FAA4C5), + UINT64_C(0xC094410E731D5BF1), UINT64_C(0x73BA0DB070BA049E), + UINT64_C(0xB86133D4DBCC19FF), UINT64_C(0x0B4F7F6AD86B4690), + UINT64_C(0x4CE50583738CB9A4), UINT64_C(0xFFCB493D702BE6CB), + UINT64_C(0xC3B1F050244347CC), UINT64_C(0x709FBCEE27E418A3), + UINT64_C(0x3735C6078C03E797), UINT64_C(0x841B8AB98FA4B8F8), + UINT64_C(0xADDA7C5F3C4488E3), UINT64_C(0x1EF430E13FE3D78C), + UINT64_C(0x595E4A08940428B8), UINT64_C(0xEA7006B697A377D7), + UINT64_C(0xD60ABFDBC3CBD6D0), UINT64_C(0x6524F365C06C89BF), + UINT64_C(0x228E898C6B8B768B), UINT64_C(0x91A0C532682C29E4), + UINT64_C(0x5A7BFB56C35A3485), UINT64_C(0xE955B7E8C0FD6BEA), + UINT64_C(0xAEFFCD016B1A94DE), UINT64_C(0x1DD181BF68BDCBB1), + UINT64_C(0x21AB38D23CD56AB6), UINT64_C(0x9285746C3F7235D9), + UINT64_C(0xD52F0E859495CAED), UINT64_C(0x6601423B97329582), + UINT64_C(0xD041DD676D77EEAA), UINT64_C(0x636F91D96ED0B1C5), + UINT64_C(0x24C5EB30C5374EF1), UINT64_C(0x97EBA78EC690119E), + UINT64_C(0xAB911EE392F8B099), UINT64_C(0x18BF525D915FEFF6), + UINT64_C(0x5F1528B43AB810C2), UINT64_C(0xEC3B640A391F4FAD), + UINT64_C(0x27E05A6E926952CC), UINT64_C(0x94CE16D091CE0DA3), + UINT64_C(0xD3646C393A29F297), UINT64_C(0x604A2087398EADF8), + UINT64_C(0x5C3099EA6DE60CFF), UINT64_C(0xEF1ED5546E415390), + UINT64_C(0xA8B4AFBDC5A6ACA4), UINT64_C(0x1B9AE303C601F3CB), + UINT64_C(0x56ED3E2F9E224471), UINT64_C(0xE5C372919D851B1E), + UINT64_C(0xA26908783662E42A), UINT64_C(0x114744C635C5BB45), + UINT64_C(0x2D3DFDAB61AD1A42), UINT64_C(0x9E13B115620A452D), + UINT64_C(0xD9B9CBFCC9EDBA19), UINT64_C(0x6A978742CA4AE576), + UINT64_C(0xA14CB926613CF817), UINT64_C(0x1262F598629BA778), + UINT64_C(0x55C88F71C97C584C), UINT64_C(0xE6E6C3CFCADB0723), + UINT64_C(0xDA9C7AA29EB3A624), UINT64_C(0x69B2361C9D14F94B), + UINT64_C(0x2E184CF536F3067F), UINT64_C(0x9D36004B35545910), + UINT64_C(0x2B769F17CF112238), UINT64_C(0x9858D3A9CCB67D57), + UINT64_C(0xDFF2A94067518263), UINT64_C(0x6CDCE5FE64F6DD0C), + UINT64_C(0x50A65C93309E7C0B), UINT64_C(0xE388102D33392364), + UINT64_C(0xA4226AC498DEDC50), UINT64_C(0x170C267A9B79833F), + UINT64_C(0xDCD7181E300F9E5E), UINT64_C(0x6FF954A033A8C131), + UINT64_C(0x28532E49984F3E05), UINT64_C(0x9B7D62F79BE8616A), + UINT64_C(0xA707DB9ACF80C06D), UINT64_C(0x14299724CC279F02), + UINT64_C(0x5383EDCD67C06036), UINT64_C(0xE0ADA17364673F59) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x54E979925CD0F10D), + UINT64_C(0xA9D2F324B9A1E21A), UINT64_C(0xFD3B8AB6E5711317), + UINT64_C(0xC17D4962DC4DDAB1), UINT64_C(0x959430F0809D2BBC), + UINT64_C(0x68AFBA4665EC38AB), UINT64_C(0x3C46C3D4393CC9A6), + UINT64_C(0x10223DEE1795ABE7), UINT64_C(0x44CB447C4B455AEA), + UINT64_C(0xB9F0CECAAE3449FD), UINT64_C(0xED19B758F2E4B8F0), + UINT64_C(0xD15F748CCBD87156), UINT64_C(0x85B60D1E9708805B), + UINT64_C(0x788D87A87279934C), UINT64_C(0x2C64FE3A2EA96241), + UINT64_C(0x20447BDC2F2B57CE), UINT64_C(0x74AD024E73FBA6C3), + UINT64_C(0x899688F8968AB5D4), UINT64_C(0xDD7FF16ACA5A44D9), + UINT64_C(0xE13932BEF3668D7F), UINT64_C(0xB5D04B2CAFB67C72), + UINT64_C(0x48EBC19A4AC76F65), UINT64_C(0x1C02B80816179E68), + UINT64_C(0x3066463238BEFC29), UINT64_C(0x648F3FA0646E0D24), + UINT64_C(0x99B4B516811F1E33), UINT64_C(0xCD5DCC84DDCFEF3E), + UINT64_C(0xF11B0F50E4F32698), UINT64_C(0xA5F276C2B823D795), + UINT64_C(0x58C9FC745D52C482), UINT64_C(0x0C2085E60182358F), + UINT64_C(0x4088F7B85E56AF9C), UINT64_C(0x14618E2A02865E91), + UINT64_C(0xE95A049CE7F74D86), UINT64_C(0xBDB37D0EBB27BC8B), + UINT64_C(0x81F5BEDA821B752D), UINT64_C(0xD51CC748DECB8420), + UINT64_C(0x28274DFE3BBA9737), UINT64_C(0x7CCE346C676A663A), + UINT64_C(0x50AACA5649C3047B), UINT64_C(0x0443B3C41513F576), + UINT64_C(0xF9783972F062E661), UINT64_C(0xAD9140E0ACB2176C), + UINT64_C(0x91D78334958EDECA), UINT64_C(0xC53EFAA6C95E2FC7), + UINT64_C(0x380570102C2F3CD0), UINT64_C(0x6CEC098270FFCDDD), + UINT64_C(0x60CC8C64717DF852), UINT64_C(0x3425F5F62DAD095F), + UINT64_C(0xC91E7F40C8DC1A48), UINT64_C(0x9DF706D2940CEB45), + UINT64_C(0xA1B1C506AD3022E3), UINT64_C(0xF558BC94F1E0D3EE), + UINT64_C(0x086336221491C0F9), UINT64_C(0x5C8A4FB0484131F4), + UINT64_C(0x70EEB18A66E853B5), UINT64_C(0x2407C8183A38A2B8), + UINT64_C(0xD93C42AEDF49B1AF), UINT64_C(0x8DD53B3C839940A2), + UINT64_C(0xB193F8E8BAA58904), UINT64_C(0xE57A817AE6757809), + UINT64_C(0x18410BCC03046B1E), UINT64_C(0x4CA8725E5FD49A13), + UINT64_C(0x8111EF70BCAD5F38), UINT64_C(0xD5F896E2E07DAE35), + UINT64_C(0x28C31C54050CBD22), UINT64_C(0x7C2A65C659DC4C2F), + UINT64_C(0x406CA61260E08589), UINT64_C(0x1485DF803C307484), + UINT64_C(0xE9BE5536D9416793), UINT64_C(0xBD572CA48591969E), + UINT64_C(0x9133D29EAB38F4DF), UINT64_C(0xC5DAAB0CF7E805D2), + UINT64_C(0x38E121BA129916C5), UINT64_C(0x6C0858284E49E7C8), + UINT64_C(0x504E9BFC77752E6E), UINT64_C(0x04A7E26E2BA5DF63), + UINT64_C(0xF99C68D8CED4CC74), UINT64_C(0xAD75114A92043D79), + UINT64_C(0xA15594AC938608F6), UINT64_C(0xF5BCED3ECF56F9FB), + UINT64_C(0x088767882A27EAEC), UINT64_C(0x5C6E1E1A76F71BE1), + UINT64_C(0x6028DDCE4FCBD247), UINT64_C(0x34C1A45C131B234A), + UINT64_C(0xC9FA2EEAF66A305D), UINT64_C(0x9D135778AABAC150), + UINT64_C(0xB177A9428413A311), UINT64_C(0xE59ED0D0D8C3521C), + UINT64_C(0x18A55A663DB2410B), UINT64_C(0x4C4C23F46162B006), + UINT64_C(0x700AE020585E79A0), UINT64_C(0x24E399B2048E88AD), + UINT64_C(0xD9D81304E1FF9BBA), UINT64_C(0x8D316A96BD2F6AB7), + UINT64_C(0xC19918C8E2FBF0A4), UINT64_C(0x9570615ABE2B01A9), + UINT64_C(0x684BEBEC5B5A12BE), UINT64_C(0x3CA2927E078AE3B3), + UINT64_C(0x00E451AA3EB62A15), UINT64_C(0x540D28386266DB18), + UINT64_C(0xA936A28E8717C80F), UINT64_C(0xFDDFDB1CDBC73902), + UINT64_C(0xD1BB2526F56E5B43), UINT64_C(0x85525CB4A9BEAA4E), + UINT64_C(0x7869D6024CCFB959), UINT64_C(0x2C80AF90101F4854), + UINT64_C(0x10C66C44292381F2), UINT64_C(0x442F15D675F370FF), + UINT64_C(0xB9149F60908263E8), UINT64_C(0xEDFDE6F2CC5292E5), + UINT64_C(0xE1DD6314CDD0A76A), UINT64_C(0xB5341A8691005667), + UINT64_C(0x480F903074714570), UINT64_C(0x1CE6E9A228A1B47D), + UINT64_C(0x20A02A76119D7DDB), UINT64_C(0x744953E44D4D8CD6), + UINT64_C(0x8972D952A83C9FC1), UINT64_C(0xDD9BA0C0F4EC6ECC), + UINT64_C(0xF1FF5EFADA450C8D), UINT64_C(0xA51627688695FD80), + UINT64_C(0x582DADDE63E4EE97), UINT64_C(0x0CC4D44C3F341F9A), + UINT64_C(0x308217980608D63C), UINT64_C(0x646B6E0A5AD82731), + UINT64_C(0x9950E4BCBFA93426), UINT64_C(0xCDB99D2EE379C52B), + UINT64_C(0x90FB71CAD654A0F5), UINT64_C(0xC41208588A8451F8), + UINT64_C(0x392982EE6FF542EF), UINT64_C(0x6DC0FB7C3325B3E2), + UINT64_C(0x518638A80A197A44), UINT64_C(0x056F413A56C98B49), + UINT64_C(0xF854CB8CB3B8985E), UINT64_C(0xACBDB21EEF686953), + UINT64_C(0x80D94C24C1C10B12), UINT64_C(0xD43035B69D11FA1F), + UINT64_C(0x290BBF007860E908), UINT64_C(0x7DE2C69224B01805), + UINT64_C(0x41A405461D8CD1A3), UINT64_C(0x154D7CD4415C20AE), + UINT64_C(0xE876F662A42D33B9), UINT64_C(0xBC9F8FF0F8FDC2B4), + UINT64_C(0xB0BF0A16F97FF73B), UINT64_C(0xE4567384A5AF0636), + UINT64_C(0x196DF93240DE1521), UINT64_C(0x4D8480A01C0EE42C), + UINT64_C(0x71C2437425322D8A), UINT64_C(0x252B3AE679E2DC87), + UINT64_C(0xD810B0509C93CF90), UINT64_C(0x8CF9C9C2C0433E9D), + UINT64_C(0xA09D37F8EEEA5CDC), UINT64_C(0xF4744E6AB23AADD1), + UINT64_C(0x094FC4DC574BBEC6), UINT64_C(0x5DA6BD4E0B9B4FCB), + UINT64_C(0x61E07E9A32A7866D), UINT64_C(0x350907086E777760), + UINT64_C(0xC8328DBE8B066477), UINT64_C(0x9CDBF42CD7D6957A), + UINT64_C(0xD073867288020F69), UINT64_C(0x849AFFE0D4D2FE64), + UINT64_C(0x79A1755631A3ED73), UINT64_C(0x2D480CC46D731C7E), + UINT64_C(0x110ECF10544FD5D8), UINT64_C(0x45E7B682089F24D5), + UINT64_C(0xB8DC3C34EDEE37C2), UINT64_C(0xEC3545A6B13EC6CF), + UINT64_C(0xC051BB9C9F97A48E), UINT64_C(0x94B8C20EC3475583), + UINT64_C(0x698348B826364694), UINT64_C(0x3D6A312A7AE6B799), + UINT64_C(0x012CF2FE43DA7E3F), UINT64_C(0x55C58B6C1F0A8F32), + UINT64_C(0xA8FE01DAFA7B9C25), UINT64_C(0xFC177848A6AB6D28), + UINT64_C(0xF037FDAEA72958A7), UINT64_C(0xA4DE843CFBF9A9AA), + UINT64_C(0x59E50E8A1E88BABD), UINT64_C(0x0D0C771842584BB0), + UINT64_C(0x314AB4CC7B648216), UINT64_C(0x65A3CD5E27B4731B), + UINT64_C(0x989847E8C2C5600C), UINT64_C(0xCC713E7A9E159101), + UINT64_C(0xE015C040B0BCF340), UINT64_C(0xB4FCB9D2EC6C024D), + UINT64_C(0x49C73364091D115A), UINT64_C(0x1D2E4AF655CDE057), + UINT64_C(0x216889226CF129F1), UINT64_C(0x7581F0B03021D8FC), + UINT64_C(0x88BA7A06D550CBEB), UINT64_C(0xDC53039489803AE6), + UINT64_C(0x11EA9EBA6AF9FFCD), UINT64_C(0x4503E72836290EC0), + UINT64_C(0xB8386D9ED3581DD7), UINT64_C(0xECD1140C8F88ECDA), + UINT64_C(0xD097D7D8B6B4257C), UINT64_C(0x847EAE4AEA64D471), + UINT64_C(0x794524FC0F15C766), UINT64_C(0x2DAC5D6E53C5366B), + UINT64_C(0x01C8A3547D6C542A), UINT64_C(0x5521DAC621BCA527), + UINT64_C(0xA81A5070C4CDB630), UINT64_C(0xFCF329E2981D473D), + UINT64_C(0xC0B5EA36A1218E9B), UINT64_C(0x945C93A4FDF17F96), + UINT64_C(0x6967191218806C81), UINT64_C(0x3D8E608044509D8C), + UINT64_C(0x31AEE56645D2A803), UINT64_C(0x65479CF41902590E), + UINT64_C(0x987C1642FC734A19), UINT64_C(0xCC956FD0A0A3BB14), + UINT64_C(0xF0D3AC04999F72B2), UINT64_C(0xA43AD596C54F83BF), + UINT64_C(0x59015F20203E90A8), UINT64_C(0x0DE826B27CEE61A5), + UINT64_C(0x218CD888524703E4), UINT64_C(0x7565A11A0E97F2E9), + UINT64_C(0x885E2BACEBE6E1FE), UINT64_C(0xDCB7523EB73610F3), + UINT64_C(0xE0F191EA8E0AD955), UINT64_C(0xB418E878D2DA2858), + UINT64_C(0x492362CE37AB3B4F), UINT64_C(0x1DCA1B5C6B7BCA42), + UINT64_C(0x5162690234AF5051), UINT64_C(0x058B1090687FA15C), + UINT64_C(0xF8B09A268D0EB24B), UINT64_C(0xAC59E3B4D1DE4346), + UINT64_C(0x901F2060E8E28AE0), UINT64_C(0xC4F659F2B4327BED), + UINT64_C(0x39CDD344514368FA), UINT64_C(0x6D24AAD60D9399F7), + UINT64_C(0x414054EC233AFBB6), UINT64_C(0x15A92D7E7FEA0ABB), + UINT64_C(0xE892A7C89A9B19AC), UINT64_C(0xBC7BDE5AC64BE8A1), + UINT64_C(0x803D1D8EFF772107), UINT64_C(0xD4D4641CA3A7D00A), + UINT64_C(0x29EFEEAA46D6C31D), UINT64_C(0x7D0697381A063210), + UINT64_C(0x712612DE1B84079F), UINT64_C(0x25CF6B4C4754F692), + UINT64_C(0xD8F4E1FAA225E585), UINT64_C(0x8C1D9868FEF51488), + UINT64_C(0xB05B5BBCC7C9DD2E), UINT64_C(0xE4B2222E9B192C23), + UINT64_C(0x1989A8987E683F34), UINT64_C(0x4D60D10A22B8CE39), + UINT64_C(0x61042F300C11AC78), UINT64_C(0x35ED56A250C15D75), + UINT64_C(0xC8D6DC14B5B04E62), UINT64_C(0x9C3FA586E960BF6F), + UINT64_C(0xA0796652D05C76C9), UINT64_C(0xF4901FC08C8C87C4), + UINT64_C(0x09AB957669FD94D3), UINT64_C(0x5D42ECE4352D65DE) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x3F0BE14A916A6DCB), + UINT64_C(0x7E17C29522D4DB96), UINT64_C(0x411C23DFB3BEB65D), + UINT64_C(0xFC2F852A45A9B72C), UINT64_C(0xC3246460D4C3DAE7), + UINT64_C(0x823847BF677D6CBA), UINT64_C(0xBD33A6F5F6170171), + UINT64_C(0x6A87A57F245D70DD), UINT64_C(0x558C4435B5371D16), + UINT64_C(0x149067EA0689AB4B), UINT64_C(0x2B9B86A097E3C680), + UINT64_C(0x96A8205561F4C7F1), UINT64_C(0xA9A3C11FF09EAA3A), + UINT64_C(0xE8BFE2C043201C67), UINT64_C(0xD7B4038AD24A71AC), + UINT64_C(0xD50F4AFE48BAE1BA), UINT64_C(0xEA04ABB4D9D08C71), + UINT64_C(0xAB18886B6A6E3A2C), UINT64_C(0x94136921FB0457E7), + UINT64_C(0x2920CFD40D135696), UINT64_C(0x162B2E9E9C793B5D), + UINT64_C(0x57370D412FC78D00), UINT64_C(0x683CEC0BBEADE0CB), + UINT64_C(0xBF88EF816CE79167), UINT64_C(0x80830ECBFD8DFCAC), + UINT64_C(0xC19F2D144E334AF1), UINT64_C(0xFE94CC5EDF59273A), + UINT64_C(0x43A76AAB294E264B), UINT64_C(0x7CAC8BE1B8244B80), + UINT64_C(0x3DB0A83E0B9AFDDD), UINT64_C(0x02BB49749AF09016), + UINT64_C(0x38C63AD73E7BDDF1), UINT64_C(0x07CDDB9DAF11B03A), + UINT64_C(0x46D1F8421CAF0667), UINT64_C(0x79DA19088DC56BAC), + UINT64_C(0xC4E9BFFD7BD26ADD), UINT64_C(0xFBE25EB7EAB80716), + UINT64_C(0xBAFE7D685906B14B), UINT64_C(0x85F59C22C86CDC80), + UINT64_C(0x52419FA81A26AD2C), UINT64_C(0x6D4A7EE28B4CC0E7), + UINT64_C(0x2C565D3D38F276BA), UINT64_C(0x135DBC77A9981B71), + UINT64_C(0xAE6E1A825F8F1A00), UINT64_C(0x9165FBC8CEE577CB), + UINT64_C(0xD079D8177D5BC196), UINT64_C(0xEF72395DEC31AC5D), + UINT64_C(0xEDC9702976C13C4B), UINT64_C(0xD2C29163E7AB5180), + UINT64_C(0x93DEB2BC5415E7DD), UINT64_C(0xACD553F6C57F8A16), + UINT64_C(0x11E6F50333688B67), UINT64_C(0x2EED1449A202E6AC), + UINT64_C(0x6FF1379611BC50F1), UINT64_C(0x50FAD6DC80D63D3A), + UINT64_C(0x874ED556529C4C96), UINT64_C(0xB845341CC3F6215D), + UINT64_C(0xF95917C370489700), UINT64_C(0xC652F689E122FACB), + UINT64_C(0x7B61507C1735FBBA), UINT64_C(0x446AB136865F9671), + UINT64_C(0x057692E935E1202C), UINT64_C(0x3A7D73A3A48B4DE7), + UINT64_C(0x718C75AE7CF7BBE2), UINT64_C(0x4E8794E4ED9DD629), + UINT64_C(0x0F9BB73B5E236074), UINT64_C(0x30905671CF490DBF), + UINT64_C(0x8DA3F084395E0CCE), UINT64_C(0xB2A811CEA8346105), + UINT64_C(0xF3B432111B8AD758), UINT64_C(0xCCBFD35B8AE0BA93), + UINT64_C(0x1B0BD0D158AACB3F), UINT64_C(0x2400319BC9C0A6F4), + UINT64_C(0x651C12447A7E10A9), UINT64_C(0x5A17F30EEB147D62), + UINT64_C(0xE72455FB1D037C13), UINT64_C(0xD82FB4B18C6911D8), + UINT64_C(0x9933976E3FD7A785), UINT64_C(0xA6387624AEBDCA4E), + UINT64_C(0xA4833F50344D5A58), UINT64_C(0x9B88DE1AA5273793), + UINT64_C(0xDA94FDC5169981CE), UINT64_C(0xE59F1C8F87F3EC05), + UINT64_C(0x58ACBA7A71E4ED74), UINT64_C(0x67A75B30E08E80BF), + UINT64_C(0x26BB78EF533036E2), UINT64_C(0x19B099A5C25A5B29), + UINT64_C(0xCE049A2F10102A85), UINT64_C(0xF10F7B65817A474E), + UINT64_C(0xB01358BA32C4F113), UINT64_C(0x8F18B9F0A3AE9CD8), + UINT64_C(0x322B1F0555B99DA9), UINT64_C(0x0D20FE4FC4D3F062), + UINT64_C(0x4C3CDD90776D463F), UINT64_C(0x73373CDAE6072BF4), + UINT64_C(0x494A4F79428C6613), UINT64_C(0x7641AE33D3E60BD8), + UINT64_C(0x375D8DEC6058BD85), UINT64_C(0x08566CA6F132D04E), + UINT64_C(0xB565CA530725D13F), UINT64_C(0x8A6E2B19964FBCF4), + UINT64_C(0xCB7208C625F10AA9), UINT64_C(0xF479E98CB49B6762), + UINT64_C(0x23CDEA0666D116CE), UINT64_C(0x1CC60B4CF7BB7B05), + UINT64_C(0x5DDA28934405CD58), UINT64_C(0x62D1C9D9D56FA093), + UINT64_C(0xDFE26F2C2378A1E2), UINT64_C(0xE0E98E66B212CC29), + UINT64_C(0xA1F5ADB901AC7A74), UINT64_C(0x9EFE4CF390C617BF), + UINT64_C(0x9C4505870A3687A9), UINT64_C(0xA34EE4CD9B5CEA62), + UINT64_C(0xE252C71228E25C3F), UINT64_C(0xDD592658B98831F4), + UINT64_C(0x606A80AD4F9F3085), UINT64_C(0x5F6161E7DEF55D4E), + UINT64_C(0x1E7D42386D4BEB13), UINT64_C(0x2176A372FC2186D8), + UINT64_C(0xF6C2A0F82E6BF774), UINT64_C(0xC9C941B2BF019ABF), + UINT64_C(0x88D5626D0CBF2CE2), UINT64_C(0xB7DE83279DD54129), + UINT64_C(0x0AED25D26BC24058), UINT64_C(0x35E6C498FAA82D93), + UINT64_C(0x74FAE74749169BCE), UINT64_C(0x4BF1060DD87CF605), + UINT64_C(0xE318EB5CF9EF77C4), UINT64_C(0xDC130A1668851A0F), + UINT64_C(0x9D0F29C9DB3BAC52), UINT64_C(0xA204C8834A51C199), + UINT64_C(0x1F376E76BC46C0E8), UINT64_C(0x203C8F3C2D2CAD23), + UINT64_C(0x6120ACE39E921B7E), UINT64_C(0x5E2B4DA90FF876B5), + UINT64_C(0x899F4E23DDB20719), UINT64_C(0xB694AF694CD86AD2), + UINT64_C(0xF7888CB6FF66DC8F), UINT64_C(0xC8836DFC6E0CB144), + UINT64_C(0x75B0CB09981BB035), UINT64_C(0x4ABB2A430971DDFE), + UINT64_C(0x0BA7099CBACF6BA3), UINT64_C(0x34ACE8D62BA50668), + UINT64_C(0x3617A1A2B155967E), UINT64_C(0x091C40E8203FFBB5), + UINT64_C(0x4800633793814DE8), UINT64_C(0x770B827D02EB2023), + UINT64_C(0xCA382488F4FC2152), UINT64_C(0xF533C5C265964C99), + UINT64_C(0xB42FE61DD628FAC4), UINT64_C(0x8B2407574742970F), + UINT64_C(0x5C9004DD9508E6A3), UINT64_C(0x639BE59704628B68), + UINT64_C(0x2287C648B7DC3D35), UINT64_C(0x1D8C270226B650FE), + UINT64_C(0xA0BF81F7D0A1518F), UINT64_C(0x9FB460BD41CB3C44), + UINT64_C(0xDEA84362F2758A19), UINT64_C(0xE1A3A228631FE7D2), + UINT64_C(0xDBDED18BC794AA35), UINT64_C(0xE4D530C156FEC7FE), + UINT64_C(0xA5C9131EE54071A3), UINT64_C(0x9AC2F254742A1C68), + UINT64_C(0x27F154A1823D1D19), UINT64_C(0x18FAB5EB135770D2), + UINT64_C(0x59E69634A0E9C68F), UINT64_C(0x66ED777E3183AB44), + UINT64_C(0xB15974F4E3C9DAE8), UINT64_C(0x8E5295BE72A3B723), + UINT64_C(0xCF4EB661C11D017E), UINT64_C(0xF045572B50776CB5), + UINT64_C(0x4D76F1DEA6606DC4), UINT64_C(0x727D1094370A000F), + UINT64_C(0x3361334B84B4B652), UINT64_C(0x0C6AD20115DEDB99), + UINT64_C(0x0ED19B758F2E4B8F), UINT64_C(0x31DA7A3F1E442644), + UINT64_C(0x70C659E0ADFA9019), UINT64_C(0x4FCDB8AA3C90FDD2), + UINT64_C(0xF2FE1E5FCA87FCA3), UINT64_C(0xCDF5FF155BED9168), + UINT64_C(0x8CE9DCCAE8532735), UINT64_C(0xB3E23D8079394AFE), + UINT64_C(0x64563E0AAB733B52), UINT64_C(0x5B5DDF403A195699), + UINT64_C(0x1A41FC9F89A7E0C4), UINT64_C(0x254A1DD518CD8D0F), + UINT64_C(0x9879BB20EEDA8C7E), UINT64_C(0xA7725A6A7FB0E1B5), + UINT64_C(0xE66E79B5CC0E57E8), UINT64_C(0xD96598FF5D643A23), + UINT64_C(0x92949EF28518CC26), UINT64_C(0xAD9F7FB81472A1ED), + UINT64_C(0xEC835C67A7CC17B0), UINT64_C(0xD388BD2D36A67A7B), + UINT64_C(0x6EBB1BD8C0B17B0A), UINT64_C(0x51B0FA9251DB16C1), + UINT64_C(0x10ACD94DE265A09C), UINT64_C(0x2FA73807730FCD57), + UINT64_C(0xF8133B8DA145BCFB), UINT64_C(0xC718DAC7302FD130), + UINT64_C(0x8604F9188391676D), UINT64_C(0xB90F185212FB0AA6), + UINT64_C(0x043CBEA7E4EC0BD7), UINT64_C(0x3B375FED7586661C), + UINT64_C(0x7A2B7C32C638D041), UINT64_C(0x45209D785752BD8A), + UINT64_C(0x479BD40CCDA22D9C), UINT64_C(0x789035465CC84057), + UINT64_C(0x398C1699EF76F60A), UINT64_C(0x0687F7D37E1C9BC1), + UINT64_C(0xBBB45126880B9AB0), UINT64_C(0x84BFB06C1961F77B), + UINT64_C(0xC5A393B3AADF4126), UINT64_C(0xFAA872F93BB52CED), + UINT64_C(0x2D1C7173E9FF5D41), UINT64_C(0x121790397895308A), + UINT64_C(0x530BB3E6CB2B86D7), UINT64_C(0x6C0052AC5A41EB1C), + UINT64_C(0xD133F459AC56EA6D), UINT64_C(0xEE3815133D3C87A6), + UINT64_C(0xAF2436CC8E8231FB), UINT64_C(0x902FD7861FE85C30), + UINT64_C(0xAA52A425BB6311D7), UINT64_C(0x9559456F2A097C1C), + UINT64_C(0xD44566B099B7CA41), UINT64_C(0xEB4E87FA08DDA78A), + UINT64_C(0x567D210FFECAA6FB), UINT64_C(0x6976C0456FA0CB30), + UINT64_C(0x286AE39ADC1E7D6D), UINT64_C(0x176102D04D7410A6), + UINT64_C(0xC0D5015A9F3E610A), UINT64_C(0xFFDEE0100E540CC1), + UINT64_C(0xBEC2C3CFBDEABA9C), UINT64_C(0x81C922852C80D757), + UINT64_C(0x3CFA8470DA97D626), UINT64_C(0x03F1653A4BFDBBED), + UINT64_C(0x42ED46E5F8430DB0), UINT64_C(0x7DE6A7AF6929607B), + UINT64_C(0x7F5DEEDBF3D9F06D), UINT64_C(0x40560F9162B39DA6), + UINT64_C(0x014A2C4ED10D2BFB), UINT64_C(0x3E41CD0440674630), + UINT64_C(0x83726BF1B6704741), UINT64_C(0xBC798ABB271A2A8A), + UINT64_C(0xFD65A96494A49CD7), UINT64_C(0xC26E482E05CEF11C), + UINT64_C(0x15DA4BA4D78480B0), UINT64_C(0x2AD1AAEE46EEED7B), + UINT64_C(0x6BCD8931F5505B26), UINT64_C(0x54C6687B643A36ED), + UINT64_C(0xE9F5CE8E922D379C), UINT64_C(0xD6FE2FC403475A57), + UINT64_C(0x97E20C1BB0F9EC0A), UINT64_C(0xA8E9ED51219381C1) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x1DEE8A5E222CA1DC), + UINT64_C(0x3BDD14BC445943B8), UINT64_C(0x26339EE26675E264), + UINT64_C(0x77BA297888B28770), UINT64_C(0x6A54A326AA9E26AC), + UINT64_C(0x4C673DC4CCEBC4C8), UINT64_C(0x5189B79AEEC76514), + UINT64_C(0xEF7452F111650EE0), UINT64_C(0xF29AD8AF3349AF3C), + UINT64_C(0xD4A9464D553C4D58), UINT64_C(0xC947CC137710EC84), + UINT64_C(0x98CE7B8999D78990), UINT64_C(0x8520F1D7BBFB284C), + UINT64_C(0xA3136F35DD8ECA28), UINT64_C(0xBEFDE56BFFA26BF4), + UINT64_C(0x4C300AC98DC40345), UINT64_C(0x51DE8097AFE8A299), + UINT64_C(0x77ED1E75C99D40FD), UINT64_C(0x6A03942BEBB1E121), + UINT64_C(0x3B8A23B105768435), UINT64_C(0x2664A9EF275A25E9), + UINT64_C(0x0057370D412FC78D), UINT64_C(0x1DB9BD5363036651), + UINT64_C(0xA34458389CA10DA5), UINT64_C(0xBEAAD266BE8DAC79), + UINT64_C(0x98994C84D8F84E1D), UINT64_C(0x8577C6DAFAD4EFC1), + UINT64_C(0xD4FE714014138AD5), UINT64_C(0xC910FB1E363F2B09), + UINT64_C(0xEF2365FC504AC96D), UINT64_C(0xF2CDEFA2726668B1), + UINT64_C(0x986015931B88068A), UINT64_C(0x858E9FCD39A4A756), + UINT64_C(0xA3BD012F5FD14532), UINT64_C(0xBE538B717DFDE4EE), + UINT64_C(0xEFDA3CEB933A81FA), UINT64_C(0xF234B6B5B1162026), + UINT64_C(0xD4072857D763C242), UINT64_C(0xC9E9A209F54F639E), + UINT64_C(0x771447620AED086A), UINT64_C(0x6AFACD3C28C1A9B6), + UINT64_C(0x4CC953DE4EB44BD2), UINT64_C(0x5127D9806C98EA0E), + UINT64_C(0x00AE6E1A825F8F1A), UINT64_C(0x1D40E444A0732EC6), + UINT64_C(0x3B737AA6C606CCA2), UINT64_C(0x269DF0F8E42A6D7E), + UINT64_C(0xD4501F5A964C05CF), UINT64_C(0xC9BE9504B460A413), + UINT64_C(0xEF8D0BE6D2154677), UINT64_C(0xF26381B8F039E7AB), + UINT64_C(0xA3EA36221EFE82BF), UINT64_C(0xBE04BC7C3CD22363), + UINT64_C(0x9837229E5AA7C107), UINT64_C(0x85D9A8C0788B60DB), + UINT64_C(0x3B244DAB87290B2F), UINT64_C(0x26CAC7F5A505AAF3), + UINT64_C(0x00F95917C3704897), UINT64_C(0x1D17D349E15CE94B), + UINT64_C(0x4C9E64D30F9B8C5F), UINT64_C(0x5170EE8D2DB72D83), + UINT64_C(0x7743706F4BC2CFE7), UINT64_C(0x6AADFA3169EE6E3B), + UINT64_C(0xA218840D981E1391), UINT64_C(0xBFF60E53BA32B24D), + UINT64_C(0x99C590B1DC475029), UINT64_C(0x842B1AEFFE6BF1F5), + UINT64_C(0xD5A2AD7510AC94E1), UINT64_C(0xC84C272B3280353D), + UINT64_C(0xEE7FB9C954F5D759), UINT64_C(0xF391339776D97685), + UINT64_C(0x4D6CD6FC897B1D71), UINT64_C(0x50825CA2AB57BCAD), + UINT64_C(0x76B1C240CD225EC9), UINT64_C(0x6B5F481EEF0EFF15), + UINT64_C(0x3AD6FF8401C99A01), UINT64_C(0x273875DA23E53BDD), + UINT64_C(0x010BEB384590D9B9), UINT64_C(0x1CE5616667BC7865), + UINT64_C(0xEE288EC415DA10D4), UINT64_C(0xF3C6049A37F6B108), + UINT64_C(0xD5F59A785183536C), UINT64_C(0xC81B102673AFF2B0), + UINT64_C(0x9992A7BC9D6897A4), UINT64_C(0x847C2DE2BF443678), + UINT64_C(0xA24FB300D931D41C), UINT64_C(0xBFA1395EFB1D75C0), + UINT64_C(0x015CDC3504BF1E34), UINT64_C(0x1CB2566B2693BFE8), + UINT64_C(0x3A81C88940E65D8C), UINT64_C(0x276F42D762CAFC50), + UINT64_C(0x76E6F54D8C0D9944), UINT64_C(0x6B087F13AE213898), + UINT64_C(0x4D3BE1F1C854DAFC), UINT64_C(0x50D56BAFEA787B20), + UINT64_C(0x3A78919E8396151B), UINT64_C(0x27961BC0A1BAB4C7), + UINT64_C(0x01A58522C7CF56A3), UINT64_C(0x1C4B0F7CE5E3F77F), + UINT64_C(0x4DC2B8E60B24926B), UINT64_C(0x502C32B8290833B7), + UINT64_C(0x761FAC5A4F7DD1D3), UINT64_C(0x6BF126046D51700F), + UINT64_C(0xD50CC36F92F31BFB), UINT64_C(0xC8E24931B0DFBA27), + UINT64_C(0xEED1D7D3D6AA5843), UINT64_C(0xF33F5D8DF486F99F), + UINT64_C(0xA2B6EA171A419C8B), UINT64_C(0xBF586049386D3D57), + UINT64_C(0x996BFEAB5E18DF33), UINT64_C(0x848574F57C347EEF), + UINT64_C(0x76489B570E52165E), UINT64_C(0x6BA611092C7EB782), + UINT64_C(0x4D958FEB4A0B55E6), UINT64_C(0x507B05B56827F43A), + UINT64_C(0x01F2B22F86E0912E), UINT64_C(0x1C1C3871A4CC30F2), + UINT64_C(0x3A2FA693C2B9D296), UINT64_C(0x27C12CCDE095734A), + UINT64_C(0x993CC9A61F3718BE), UINT64_C(0x84D243F83D1BB962), + UINT64_C(0xA2E1DD1A5B6E5B06), UINT64_C(0xBF0F57447942FADA), + UINT64_C(0xEE86E0DE97859FCE), UINT64_C(0xF3686A80B5A93E12), + UINT64_C(0xD55BF462D3DCDC76), UINT64_C(0xC8B57E3CF1F07DAA), + UINT64_C(0xD6E9A7309F3239A7), UINT64_C(0xCB072D6EBD1E987B), + UINT64_C(0xED34B38CDB6B7A1F), UINT64_C(0xF0DA39D2F947DBC3), + UINT64_C(0xA1538E481780BED7), UINT64_C(0xBCBD041635AC1F0B), + UINT64_C(0x9A8E9AF453D9FD6F), UINT64_C(0x876010AA71F55CB3), + UINT64_C(0x399DF5C18E573747), UINT64_C(0x24737F9FAC7B969B), + UINT64_C(0x0240E17DCA0E74FF), UINT64_C(0x1FAE6B23E822D523), + UINT64_C(0x4E27DCB906E5B037), UINT64_C(0x53C956E724C911EB), + UINT64_C(0x75FAC80542BCF38F), UINT64_C(0x6814425B60905253), + UINT64_C(0x9AD9ADF912F63AE2), UINT64_C(0x873727A730DA9B3E), + UINT64_C(0xA104B94556AF795A), UINT64_C(0xBCEA331B7483D886), + UINT64_C(0xED6384819A44BD92), UINT64_C(0xF08D0EDFB8681C4E), + UINT64_C(0xD6BE903DDE1DFE2A), UINT64_C(0xCB501A63FC315FF6), + UINT64_C(0x75ADFF0803933402), UINT64_C(0x6843755621BF95DE), + UINT64_C(0x4E70EBB447CA77BA), UINT64_C(0x539E61EA65E6D666), + UINT64_C(0x0217D6708B21B372), UINT64_C(0x1FF95C2EA90D12AE), + UINT64_C(0x39CAC2CCCF78F0CA), UINT64_C(0x24244892ED545116), + UINT64_C(0x4E89B2A384BA3F2D), UINT64_C(0x536738FDA6969EF1), + UINT64_C(0x7554A61FC0E37C95), UINT64_C(0x68BA2C41E2CFDD49), + UINT64_C(0x39339BDB0C08B85D), UINT64_C(0x24DD11852E241981), + UINT64_C(0x02EE8F674851FBE5), UINT64_C(0x1F0005396A7D5A39), + UINT64_C(0xA1FDE05295DF31CD), UINT64_C(0xBC136A0CB7F39011), + UINT64_C(0x9A20F4EED1867275), UINT64_C(0x87CE7EB0F3AAD3A9), + UINT64_C(0xD647C92A1D6DB6BD), UINT64_C(0xCBA943743F411761), + UINT64_C(0xED9ADD965934F505), UINT64_C(0xF07457C87B1854D9), + UINT64_C(0x02B9B86A097E3C68), UINT64_C(0x1F5732342B529DB4), + UINT64_C(0x3964ACD64D277FD0), UINT64_C(0x248A26886F0BDE0C), + UINT64_C(0x7503911281CCBB18), UINT64_C(0x68ED1B4CA3E01AC4), + UINT64_C(0x4EDE85AEC595F8A0), UINT64_C(0x53300FF0E7B9597C), + UINT64_C(0xEDCDEA9B181B3288), UINT64_C(0xF02360C53A379354), + UINT64_C(0xD610FE275C427130), UINT64_C(0xCBFE74797E6ED0EC), + UINT64_C(0x9A77C3E390A9B5F8), UINT64_C(0x879949BDB2851424), + UINT64_C(0xA1AAD75FD4F0F640), UINT64_C(0xBC445D01F6DC579C), + UINT64_C(0x74F1233D072C2A36), UINT64_C(0x691FA96325008BEA), + UINT64_C(0x4F2C37814375698E), UINT64_C(0x52C2BDDF6159C852), + UINT64_C(0x034B0A458F9EAD46), UINT64_C(0x1EA5801BADB20C9A), + UINT64_C(0x38961EF9CBC7EEFE), UINT64_C(0x257894A7E9EB4F22), + UINT64_C(0x9B8571CC164924D6), UINT64_C(0x866BFB923465850A), + UINT64_C(0xA05865705210676E), UINT64_C(0xBDB6EF2E703CC6B2), + UINT64_C(0xEC3F58B49EFBA3A6), UINT64_C(0xF1D1D2EABCD7027A), + UINT64_C(0xD7E24C08DAA2E01E), UINT64_C(0xCA0CC656F88E41C2), + UINT64_C(0x38C129F48AE82973), UINT64_C(0x252FA3AAA8C488AF), + UINT64_C(0x031C3D48CEB16ACB), UINT64_C(0x1EF2B716EC9DCB17), + UINT64_C(0x4F7B008C025AAE03), UINT64_C(0x52958AD220760FDF), + UINT64_C(0x74A614304603EDBB), UINT64_C(0x69489E6E642F4C67), + UINT64_C(0xD7B57B059B8D2793), UINT64_C(0xCA5BF15BB9A1864F), + UINT64_C(0xEC686FB9DFD4642B), UINT64_C(0xF186E5E7FDF8C5F7), + UINT64_C(0xA00F527D133FA0E3), UINT64_C(0xBDE1D8233113013F), + UINT64_C(0x9BD246C15766E35B), UINT64_C(0x863CCC9F754A4287), + UINT64_C(0xEC9136AE1CA42CBC), UINT64_C(0xF17FBCF03E888D60), + UINT64_C(0xD74C221258FD6F04), UINT64_C(0xCAA2A84C7AD1CED8), + UINT64_C(0x9B2B1FD69416ABCC), UINT64_C(0x86C59588B63A0A10), + UINT64_C(0xA0F60B6AD04FE874), UINT64_C(0xBD188134F26349A8), + UINT64_C(0x03E5645F0DC1225C), UINT64_C(0x1E0BEE012FED8380), + UINT64_C(0x383870E3499861E4), UINT64_C(0x25D6FABD6BB4C038), + UINT64_C(0x745F4D278573A52C), UINT64_C(0x69B1C779A75F04F0), + UINT64_C(0x4F82599BC12AE694), UINT64_C(0x526CD3C5E3064748), + UINT64_C(0xA0A13C6791602FF9), UINT64_C(0xBD4FB639B34C8E25), + UINT64_C(0x9B7C28DBD5396C41), UINT64_C(0x8692A285F715CD9D), + UINT64_C(0xD71B151F19D2A889), UINT64_C(0xCAF59F413BFE0955), + UINT64_C(0xECC601A35D8BEB31), UINT64_C(0xF1288BFD7FA74AED), + UINT64_C(0x4FD56E9680052119), UINT64_C(0x523BE4C8A22980C5), + UINT64_C(0x74087A2AC45C62A1), UINT64_C(0x69E6F074E670C37D), + UINT64_C(0x386F47EE08B7A669), UINT64_C(0x2581CDB02A9B07B5), + UINT64_C(0x03B253524CEEE5D1), UINT64_C(0x1E5CD90C6EC2440D) + } +}; diff --git a/src/liblzma/check/crc64_tablegen.c b/src/liblzma/check/crc64_tablegen.c new file mode 100644 index 000000000000..fddaa7ed1400 --- /dev/null +++ b/src/liblzma/check/crc64_tablegen.c @@ -0,0 +1,88 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64_tablegen.c +/// \brief Generate crc64_table_le.h and crc64_table_be.h +/// +/// Compiling: gcc -std=c99 -o crc64_tablegen crc64_tablegen.c +/// Add -DWORDS_BIGENDIAN to generate big endian table. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include <stdio.h> +#include "../../common/tuklib_integer.h" + + +static uint64_t crc64_table[4][256]; + + +extern void +init_crc64_table(void) +{ + static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); + + for (size_t s = 0; s < 4; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint64_t r = s == 0 ? b : crc64_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly64; + else + r >>= 1; + } + + crc64_table[s][b] = r; + } + } + +#ifdef WORDS_BIGENDIAN + for (size_t s = 0; s < 4; ++s) + for (size_t b = 0; b < 256; ++b) + crc64_table[s][b] = bswap64(crc64_table[s][b]); +#endif + + return; +} + + +static void +print_crc64_table(void) +{ + printf("/* This file has been automatically generated by " + "crc64_tablegen.c. */\n\n" + "const uint64_t lzma_crc64_table[4][256] = {\n\t{"); + + for (size_t s = 0; s < 4; ++s) { + for (size_t b = 0; b < 256; ++b) { + if ((b % 2) == 0) + printf("\n\t\t"); + + printf("UINT64_C(0x%016" PRIX64 ")", + crc64_table[s][b]); + + if (b != 255) + printf(",%s", (b+1) % 2 == 0 ? "" : " "); + } + + if (s == 3) + printf("\n\t}\n};\n"); + else + printf("\n\t}, {"); + } + + return; +} + + +int +main(void) +{ + init_crc64_table(); + print_crc64_table(); + return 0; +} diff --git a/src/liblzma/check/crc64_x86.S b/src/liblzma/check/crc64_x86.S new file mode 100644 index 000000000000..f5bb84b97e0a --- /dev/null +++ b/src/liblzma/check/crc64_x86.S @@ -0,0 +1,287 @@ +/* + * Speed-optimized CRC64 using slicing-by-four algorithm + * + * This uses only i386 instructions, but it is optimized for i686 and later + * (including e.g. Pentium II/III/IV, Athlon XP, and Core 2). + * + * Authors: Igor Pavlov (original CRC32 assembly code) + * Lasse Collin (CRC64 adaptation of the modified CRC32 code) + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * This code needs lzma_crc64_table, which can be created using the + * following C code: + +uint64_t lzma_crc64_table[4][256]; + +void +init_table(void) +{ + // ECMA-182 + static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); + + for (size_t s = 0; s < 4; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint64_t r = s == 0 ? b : lzma_crc64_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly64; + else + r >>= 1; + } + + lzma_crc64_table[s][b] = r; + } + } +} + + * The prototype of the CRC64 function: + * extern uint64_t lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc); + */ + +/* + * On some systems, the functions need to be prefixed. The prefix is + * usually an underscore. + */ +#ifndef __USER_LABEL_PREFIX__ +# define __USER_LABEL_PREFIX__ +#endif +#define MAKE_SYM_CAT(prefix, sym) prefix ## sym +#define MAKE_SYM(prefix, sym) MAKE_SYM_CAT(prefix, sym) +#define LZMA_CRC64 MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc64) +#define LZMA_CRC64_TABLE MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc64_table) + +/* + * Solaris assembler doesn't have .p2align, and Darwin uses .align + * differently than GNU/Linux and Solaris. + */ +#if defined(__APPLE__) || defined(__MSDOS__) +# define ALIGN(pow2, abs) .align pow2 +#else +# define ALIGN(pow2, abs) .align abs +#endif + + .text + .globl LZMA_CRC64 + +#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) \ + && !defined(__MSDOS__) + .type LZMA_CRC64, @function +#endif + + ALIGN(4, 16) +LZMA_CRC64: + /* + * Register usage: + * %eax crc LSB + * %edx crc MSB + * %esi buf + * %edi size or buf + size + * %ebx lzma_crc64_table + * %ebp Table index + * %ecx Temporary + */ + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl 0x14(%esp), %esi /* buf */ + movl 0x18(%esp), %edi /* size */ + movl 0x1C(%esp), %eax /* crc LSB */ + movl 0x20(%esp), %edx /* crc MSB */ + + /* + * Store the address of lzma_crc64_table to %ebx. This is needed to + * get position-independent code (PIC). + * + * The PIC macro is defined by libtool, while __PIC__ is defined + * by GCC but only on some systems. Testing for both makes it simpler + * to test this code without libtool, and keeps the code working also + * when built with libtool but using something else than GCC. + * + * I understood that libtool may define PIC on Windows even though + * the code in Windows DLLs is not PIC in sense that it is in ELF + * binaries, so we need a separate check to always use the non-PIC + * code on Windows. + */ +#if (!defined(PIC) && !defined(__PIC__)) \ + || (defined(_WIN32) || defined(__CYGWIN__)) + /* Not PIC */ + movl $ LZMA_CRC64_TABLE, %ebx +#elif defined(__APPLE__) + /* Mach-O */ + call .L_get_pc +.L_pic: + leal .L_lzma_crc64_table$non_lazy_ptr-.L_pic(%ebx), %ebx + movl (%ebx), %ebx +#else + /* ELF */ + call .L_get_pc + addl $_GLOBAL_OFFSET_TABLE_, %ebx + movl LZMA_CRC64_TABLE@GOT(%ebx), %ebx +#endif + + /* Complement the initial value. */ + notl %eax + notl %edx + +.L_align: + /* + * Check if there is enough input to use slicing-by-four. + * We need eight bytes, because the loop pre-reads four bytes. + */ + cmpl $8, %edi + jb .L_rest + + /* Check if we have reached alignment of four bytes. */ + testl $3, %esi + jz .L_slice + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrdl $8, %edx, %eax + xorl (%ebx, %ebp, 8), %eax + shrl $8, %edx + xorl 4(%ebx, %ebp, 8), %edx + decl %edi + jmp .L_align + +.L_slice: + /* + * If we get here, there's at least eight bytes of aligned input + * available. Make %edi multiple of four bytes. Store the possible + * remainder over the "size" variable in the argument stack. + */ + movl %edi, 0x18(%esp) + andl $-4, %edi + subl %edi, 0x18(%esp) + + /* + * Let %edi be buf + size - 4 while running the main loop. This way + * we can compare for equality to determine when exit the loop. + */ + addl %esi, %edi + subl $4, %edi + + /* Read in the first four aligned bytes. */ + movl (%esi), %ecx + +.L_loop: + xorl %eax, %ecx + movzbl %cl, %ebp + movl 0x1800(%ebx, %ebp, 8), %eax + xorl %edx, %eax + movl 0x1804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + xorl 0x1000(%ebx, %ebp, 8), %eax + xorl 0x1004(%ebx, %ebp, 8), %edx + shrl $16, %ecx + movzbl %cl, %ebp + xorl 0x0800(%ebx, %ebp, 8), %eax + xorl 0x0804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + addl $4, %esi + xorl (%ebx, %ebp, 8), %eax + xorl 4(%ebx, %ebp, 8), %edx + + /* Check for end of aligned input. */ + cmpl %edi, %esi + + /* + * Copy the next input byte to %ecx. It is slightly faster to + * read it here than at the top of the loop. + */ + movl (%esi), %ecx + jb .L_loop + + /* + * Process the remaining four bytes, which we have already + * copied to %ecx. + */ + xorl %eax, %ecx + movzbl %cl, %ebp + movl 0x1800(%ebx, %ebp, 8), %eax + xorl %edx, %eax + movl 0x1804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + xorl 0x1000(%ebx, %ebp, 8), %eax + xorl 0x1004(%ebx, %ebp, 8), %edx + shrl $16, %ecx + movzbl %cl, %ebp + xorl 0x0800(%ebx, %ebp, 8), %eax + xorl 0x0804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + addl $4, %esi + xorl (%ebx, %ebp, 8), %eax + xorl 4(%ebx, %ebp, 8), %edx + + /* Copy the number of remaining bytes to %edi. */ + movl 0x18(%esp), %edi + +.L_rest: + /* Check for end of input. */ + testl %edi, %edi + jz .L_return + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrdl $8, %edx, %eax + xorl (%ebx, %ebp, 8), %eax + shrl $8, %edx + xorl 4(%ebx, %ebp, 8), %edx + decl %edi + jmp .L_rest + +.L_return: + /* Complement the final value. */ + notl %eax + notl %edx + + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + +#if defined(PIC) || defined(__PIC__) + ALIGN(4, 16) +.L_get_pc: + movl (%esp), %ebx + ret +#endif + +#if defined(__APPLE__) && (defined(PIC) || defined(__PIC__)) + /* Mach-O PIC */ + .section __IMPORT,__pointers,non_lazy_symbol_pointers +.L_lzma_crc64_table$non_lazy_ptr: + .indirect_symbol LZMA_CRC64_TABLE + .long 0 + +#elif defined(_WIN32) || defined(__CYGWIN__) +# ifdef DLL_EXPORT + /* This is equivalent of __declspec(dllexport). */ + .section .drectve + .ascii " -export:lzma_crc64" +# endif + +#elif !defined(__MSDOS__) + /* ELF */ + .size LZMA_CRC64, .-LZMA_CRC64 +#endif + +/* + * This is needed to support non-executable stack. It's ugly to + * use __linux__ here, but I don't know a way to detect when + * we are using GNU assembler. + */ +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",@progbits +#endif diff --git a/src/liblzma/check/crc_macros.h b/src/liblzma/check/crc_macros.h new file mode 100644 index 000000000000..a7c21b765dca --- /dev/null +++ b/src/liblzma/check/crc_macros.h @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc_macros.h +/// \brief Some endian-dependent macros for CRC32 and CRC64 +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifdef WORDS_BIGENDIAN +# define A(x) ((x) >> 24) +# define B(x) (((x) >> 16) & 0xFF) +# define C(x) (((x) >> 8) & 0xFF) +# define D(x) ((x) & 0xFF) + +# define S8(x) ((x) << 8) +# define S32(x) ((x) << 32) + +#else +# define A(x) ((x) & 0xFF) +# define B(x) (((x) >> 8) & 0xFF) +# define C(x) (((x) >> 16) & 0xFF) +# define D(x) ((x) >> 24) + +# define S8(x) ((x) >> 8) +# define S32(x) ((x) >> 32) +#endif diff --git a/src/liblzma/check/sha256.c b/src/liblzma/check/sha256.c new file mode 100644 index 000000000000..04231dbaef99 --- /dev/null +++ b/src/liblzma/check/sha256.c @@ -0,0 +1,201 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file sha256.c +/// \brief SHA-256 +/// +/// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they +/// are imported to liblzma, SSE instructions need to be used +/// conditionally to keep the code working on older boxes. +/// We could also support using some external libary for SHA-256. +// +// This code is based on the code found from 7-Zip, which has a modified +// version of the SHA-256 found from Crypto++ <http://www.cryptopp.com/>. +// The code was modified a little to fit into liblzma. +// +// Authors: Kevin Springle +// Wei Dai +// Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +// Avoid bogus warnings in transform(). +#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) || __GNUC__ > 4 +# pragma GCC diagnostic ignored "-Wuninitialized" +#endif + +#include "check.h" + +// At least on x86, GCC is able to optimize this to a rotate instruction. +#define rotr_32(num, amount) ((num) >> (amount) | (num) << (32 - (amount))) + +#define blk0(i) (W[i] = data[i]) +#define blk2(i) (W[i & 15] += s1(W[(i - 2) & 15]) + W[(i - 7) & 15] \ + + s0(W[(i - 15) & 15])) + +#define Ch(x, y, z) (z ^ (x & (y ^ z))) +#define Maj(x, y, z) ((x & y) | (z & (x | y))) + +#define a(i) T[(0 - i) & 7] +#define b(i) T[(1 - i) & 7] +#define c(i) T[(2 - i) & 7] +#define d(i) T[(3 - i) & 7] +#define e(i) T[(4 - i) & 7] +#define f(i) T[(5 - i) & 7] +#define g(i) T[(6 - i) & 7] +#define h(i) T[(7 - i) & 7] + +#define R(i) \ + h(i) += S1(e(i)) + Ch(e(i), f(i), g(i)) + SHA256_K[i + j] \ + + (j ? blk2(i) : blk0(i)); \ + d(i) += h(i); \ + h(i) += S0(a(i)) + Maj(a(i), b(i), c(i)) + +#define S0(x) (rotr_32(x, 2) ^ rotr_32(x, 13) ^ rotr_32(x, 22)) +#define S1(x) (rotr_32(x, 6) ^ rotr_32(x, 11) ^ rotr_32(x, 25)) +#define s0(x) (rotr_32(x, 7) ^ rotr_32(x, 18) ^ (x >> 3)) +#define s1(x) (rotr_32(x, 17) ^ rotr_32(x, 19) ^ (x >> 10)) + + +static const uint32_t SHA256_K[64] = { + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2, +}; + + +static void +transform(uint32_t state[static 8], const uint32_t data[static 16]) +{ + uint32_t W[16]; + uint32_t T[8]; + + // Copy state[] to working vars. + memcpy(T, state, sizeof(T)); + + // 64 operations, partially loop unrolled + for (unsigned int j = 0; j < 64; j += 16) { + R( 0); R( 1); R( 2); R( 3); + R( 4); R( 5); R( 6); R( 7); + R( 8); R( 9); R(10); R(11); + R(12); R(13); R(14); R(15); + } + + // Add the working vars back into state[]. + state[0] += a(0); + state[1] += b(0); + state[2] += c(0); + state[3] += d(0); + state[4] += e(0); + state[5] += f(0); + state[6] += g(0); + state[7] += h(0); +} + + +static void +process(lzma_check_state *check) +{ +#ifdef WORDS_BIGENDIAN + transform(check->state.sha256.state, check->buffer.u32); + +#else + uint32_t data[16]; + + for (size_t i = 0; i < 16; ++i) + data[i] = bswap32(check->buffer.u32[i]); + + transform(check->state.sha256.state, data); +#endif + + return; +} + + +extern void +lzma_sha256_init(lzma_check_state *check) +{ + static const uint32_t s[8] = { + 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, + 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19, + }; + + memcpy(check->state.sha256.state, s, sizeof(s)); + check->state.sha256.size = 0; + + return; +} + + +extern void +lzma_sha256_update(const uint8_t *buf, size_t size, lzma_check_state *check) +{ + // Copy the input data into a properly aligned temporary buffer. + // This way we can be called with arbitrarily sized buffers + // (no need to be multiple of 64 bytes), and the code works also + // on architectures that don't allow unaligned memory access. + while (size > 0) { + const size_t copy_start = check->state.sha256.size & 0x3F; + size_t copy_size = 64 - copy_start; + if (copy_size > size) + copy_size = size; + + memcpy(check->buffer.u8 + copy_start, buf, copy_size); + + buf += copy_size; + size -= copy_size; + check->state.sha256.size += copy_size; + + if ((check->state.sha256.size & 0x3F) == 0) + process(check); + } + + return; +} + + +extern void +lzma_sha256_finish(lzma_check_state *check) +{ + // Add padding as described in RFC 3174 (it describes SHA-1 but + // the same padding style is used for SHA-256 too). + size_t pos = check->state.sha256.size & 0x3F; + check->buffer.u8[pos++] = 0x80; + + while (pos != 64 - 8) { + if (pos == 64) { + process(check); + pos = 0; + } + + check->buffer.u8[pos++] = 0x00; + } + + // Convert the message size from bytes to bits. + check->state.sha256.size *= 8; + + check->buffer.u64[(64 - 8) / 8] = conv64be(check->state.sha256.size); + + process(check); + + for (size_t i = 0; i < 8; ++i) + check->buffer.u32[i] = conv32be(check->state.sha256.state[i]); + + return; +} diff --git a/src/liblzma/common/alone_decoder.c b/src/liblzma/common/alone_decoder.c new file mode 100644 index 000000000000..039b42859546 --- /dev/null +++ b/src/liblzma/common/alone_decoder.c @@ -0,0 +1,232 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file alone_decoder.c +/// \brief Decoder for LZMA_Alone files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "alone_decoder.h" +#include "lzma_decoder.h" +#include "lz_decoder.h" + + +struct lzma_coder_s { + lzma_next_coder next; + + enum { + SEQ_PROPERTIES, + SEQ_DICTIONARY_SIZE, + SEQ_UNCOMPRESSED_SIZE, + SEQ_CODER_INIT, + SEQ_CODE, + } sequence; + + /// Position in the header fields + size_t pos; + + /// Uncompressed size decoded from the header + lzma_vli uncompressed_size; + + /// Memory usage limit + uint64_t memlimit; + + /// Amount of memory actually needed (only an estimate) + uint64_t memusage; + + /// Options decoded from the header needed to initialize + /// the LZMA decoder + lzma_options_lzma options; +}; + + +static lzma_ret +alone_decode(lzma_coder *coder, + lzma_allocator *allocator lzma_attribute((unused)), + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, + lzma_action action) +{ + while (*out_pos < out_size + && (coder->sequence == SEQ_CODE || *in_pos < in_size)) + switch (coder->sequence) { + case SEQ_PROPERTIES: + if (lzma_lzma_lclppb_decode(&coder->options, in[*in_pos])) + return LZMA_FORMAT_ERROR; + + coder->sequence = SEQ_DICTIONARY_SIZE; + ++*in_pos; + break; + + case SEQ_DICTIONARY_SIZE: + coder->options.dict_size + |= (size_t)(in[*in_pos]) << (coder->pos * 8); + + if (++coder->pos == 4) { + if (coder->options.dict_size != UINT32_MAX) { + // A hack to ditch tons of false positives: + // We allow only dictionary sizes that are + // 2^n or 2^n + 2^(n-1). LZMA_Alone created + // only files with 2^n, but accepts any + // dictionary size. If someone complains, this + // will be reconsidered. + uint32_t d = coder->options.dict_size - 1; + d |= d >> 2; + d |= d >> 3; + d |= d >> 4; + d |= d >> 8; + d |= d >> 16; + ++d; + + if (d != coder->options.dict_size) + return LZMA_FORMAT_ERROR; + } + + coder->pos = 0; + coder->sequence = SEQ_UNCOMPRESSED_SIZE; + } + + ++*in_pos; + break; + + case SEQ_UNCOMPRESSED_SIZE: + coder->uncompressed_size + |= (lzma_vli)(in[*in_pos]) << (coder->pos * 8); + ++*in_pos; + if (++coder->pos < 8) + break; + + // Another hack to ditch false positives: Assume that + // if the uncompressed size is known, it must be less + // than 256 GiB. Again, if someone complains, this + // will be reconsidered. + if (coder->uncompressed_size != LZMA_VLI_UNKNOWN + && coder->uncompressed_size + >= (LZMA_VLI_C(1) << 38)) + return LZMA_FORMAT_ERROR; + + // Calculate the memory usage so that it is ready + // for SEQ_CODER_INIT. + coder->memusage = lzma_lzma_decoder_memusage(&coder->options) + + LZMA_MEMUSAGE_BASE; + + coder->pos = 0; + coder->sequence = SEQ_CODER_INIT; + + // Fall through + + case SEQ_CODER_INIT: { + if (coder->memusage > coder->memlimit) + return LZMA_MEMLIMIT_ERROR; + + lzma_filter_info filters[2] = { + { + .init = &lzma_lzma_decoder_init, + .options = &coder->options, + }, { + .init = NULL, + } + }; + + const lzma_ret ret = lzma_next_filter_init(&coder->next, + allocator, filters); + if (ret != LZMA_OK) + return ret; + + // Use a hack to set the uncompressed size. + lzma_lz_decoder_uncompressed(coder->next.coder, + coder->uncompressed_size); + + coder->sequence = SEQ_CODE; + break; + } + + case SEQ_CODE: { + return coder->next.code(coder->next.coder, + allocator, in, in_pos, in_size, + out, out_pos, out_size, action); + } + + default: + return LZMA_PROG_ERROR; + } + + return LZMA_OK; +} + + +static void +alone_decoder_end(lzma_coder *coder, lzma_allocator *allocator) +{ + lzma_next_end(&coder->next, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +alone_decoder_memconfig(lzma_coder *coder, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + *memusage = coder->memusage; + *old_memlimit = coder->memlimit; + + if (new_memlimit != 0) { + if (new_memlimit < coder->memusage) + return LZMA_MEMLIMIT_ERROR; + + coder->memlimit = new_memlimit; + } + + return LZMA_OK; +} + + +extern lzma_ret +lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, + uint64_t memlimit) +{ + lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator); + + if (memlimit == 0) + return LZMA_PROG_ERROR; + + if (next->coder == NULL) { + next->coder = lzma_alloc(sizeof(lzma_coder), allocator); + if (next->coder == NULL) + return LZMA_MEM_ERROR; + + next->code = &alone_decode; + next->end = &alone_decoder_end; + next->memconfig = &alone_decoder_memconfig; + next->coder->next = LZMA_NEXT_CODER_INIT; + } + + next->coder->sequence = SEQ_PROPERTIES; + next->coder->pos = 0; + next->coder->options.dict_size = 0; + next->coder->options.preset_dict = NULL; + next->coder->options.preset_dict_size = 0; + next->coder->uncompressed_size = 0; + next->coder->memlimit = memlimit; + next->coder->memusage = LZMA_MEMUSAGE_BASE; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit) +{ + lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/alone_decoder.h b/src/liblzma/common/alone_decoder.h new file mode 100644 index 000000000000..70d0d2a0ffa4 --- /dev/null +++ b/src/liblzma/common/alone_decoder.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file alone_decoder.h +/// \brief Decoder for LZMA_Alone files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_ALONE_DECODER_H +#define LZMA_ |