]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
2 years agoCI: Change ci_build.sh to use bash instead of sh.
Jia Tan [Fri, 24 Mar 2023 12:06:33 +0000 (20:06 +0800)] 
CI: Change ci_build.sh to use bash instead of sh.

This script is only meant to be run as part of the CI build/test process
on machines that are known to have bash (Ubuntu and MacOS). If this
assumption changes in the future, then the bash specific commands will
need to be replaced with a more portable option. For now, it is
convenient to use bash commands.

2 years agoCMake: Only build xzdec if decoders are enabled.
Jia Tan [Fri, 24 Mar 2023 12:05:59 +0000 (20:05 +0800)] 
CMake: Only build xzdec if decoders are enabled.

2 years agoBuild: Removes redundant check for LZMA1 filter support.
Jia Tan [Wed, 22 Mar 2023 07:42:04 +0000 (15:42 +0800)] 
Build: Removes redundant check for LZMA1 filter support.

2 years agoCMake: Bump maximum policy version to 3.26.
Lasse Collin [Thu, 23 Mar 2023 13:14:29 +0000 (15:14 +0200)] 
CMake: Bump maximum policy version to 3.26.

It adds only one new policy related to FOLDERS which we don't use.
This makes it clear that the code is compatible with the policies
up to 3.26.

2 years agoCMake: Conditionally build xz list.* files if decoders are enabled.
Jia Tan [Tue, 21 Mar 2023 15:36:00 +0000 (23:36 +0800)] 
CMake: Conditionally build xz list.* files if decoders are enabled.

2 years agoCMake: Allow configuring features as cache variables.
Jia Tan [Sat, 25 Feb 2023 03:46:50 +0000 (11:46 +0800)] 
CMake: Allow configuring features as cache variables.

This allows users to change the features they build either in
CMakeCache.txt or by using a CMake GUI. The sources built for
liblzma are affected by this too, so only the necessary files
will be compiled.

2 years agoBuild: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69.
Lasse Collin [Tue, 21 Mar 2023 12:07:51 +0000 (14:07 +0200)] 
Build: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69.

It's obsolete in Autoconf >= 2.70 and just an alias for AC_PROG_CC
but Autoconf 2.69 requires AC_PROG_CC_C99 to get a C99 compiler.

2 years agoBuild: configure.ac: Use AS_IF and AS_CASE where required.
Lasse Collin [Tue, 21 Mar 2023 12:04:37 +0000 (14:04 +0200)] 
Build: configure.ac: Use AS_IF and AS_CASE where required.

This makes no functional difference in the generated configure
(at least with the Autotools versions I have installed) but this
change might prevent future bugs like the one that was just
fixed in the commit 5a5bd7f871818029d5ccbe189f087f591258c294.

2 years agoUpdate THANKS.
Lasse Collin [Tue, 21 Mar 2023 11:12:03 +0000 (13:12 +0200)] 
Update THANKS.

2 years agoBuild: Fix --disable-threads breaking the building of shared libs.
Lasse Collin [Tue, 21 Mar 2023 11:11:49 +0000 (13:11 +0200)] 
Build: Fix --disable-threads breaking the building of shared libs.

This is broken in the releases 5.2.6 to 5.4.2. A workaround
for these releases is to pass EGREP='grep -E' as an argument
to configure in addition to --disable-threads.

The problem appeared when m4/ax_pthread.m4 was updated in
the commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad which
introduced the use of AC_EGREP_CPP. AC_EGREP_CPP calls
AC_REQUIRE([AC_PROG_EGREP]) to set the shell variable EGREP
but this was only executed if POSIX threads were enabled.
Libtool code also has AC_REQUIRE([AC_PROG_EGREP]) but Autoconf
omits it as AC_PROG_EGREP has already been required earlier.
Thus, if not using POSIX threads, the shell variable EGREP
would be undefined in the Libtool code in configure.

ax_pthread.m4 is fine. The bug was in configure.ac which called
AX_PTHREAD conditionally in an incorrect way. Using AS_CASE
ensures that all AC_REQUIREs get always run.

Thanks to Frank Busse for reporting the bug.
Fixes: https://github.com/tukaani-project/xz/issues/45
2 years agoliblzma: Silence -Wsign-conversion in SSE2 code in memcmplen.h.
Lasse Collin [Sun, 19 Mar 2023 20:45:59 +0000 (22:45 +0200)] 
liblzma: Silence -Wsign-conversion in SSE2 code in memcmplen.h.

Thanks to Christian Hesse for reporting the issue.
Fixes: https://github.com/tukaani-project/xz/issues/44
2 years agoAdd NEWS for 5.4.2.
Jia Tan [Sat, 18 Mar 2023 14:10:57 +0000 (22:10 +0800)] 
Add NEWS for 5.4.2.

2 years agoAdd NEWS for 5.2.11.
Jia Tan [Sat, 18 Mar 2023 14:10:12 +0000 (22:10 +0800)] 
Add NEWS for 5.2.11.

2 years agoUpdate the copy of GNU GPLv3 from gnu.org to COPYING.GPLv3.
Lasse Collin [Sat, 18 Mar 2023 14:00:54 +0000 (16:00 +0200)] 
Update the copy of GNU GPLv3 from gnu.org to COPYING.GPLv3.

2 years agoChange a few HTTP URLs to HTTPS.
Lasse Collin [Sat, 18 Mar 2023 13:51:57 +0000 (15:51 +0200)] 
Change a few HTTP URLs to HTTPS.

The xz man page timestamp was intentionally left unchanged.

2 years agoCMake: Fix typo in a comment.
Jia Tan [Fri, 17 Mar 2023 16:40:28 +0000 (00:40 +0800)] 
CMake: Fix typo in a comment.

2 years agoWindows: build.bash: Copy liblzma API docs to the output package.
Lasse Collin [Fri, 17 Mar 2023 16:36:22 +0000 (18:36 +0200)] 
Windows: build.bash: Copy liblzma API docs to the output package.

2 years agoWindows: Add microlzma_*.c to the VS project files.
Lasse Collin [Fri, 17 Mar 2023 06:53:38 +0000 (08:53 +0200)] 
Windows: Add microlzma_*.c to the VS project files.

These should have been included in 5.3.2alpha already.

2 years agoCMake: Add microlzma_*.c to the build.
Lasse Collin [Fri, 17 Mar 2023 06:43:51 +0000 (08:43 +0200)] 
CMake: Add microlzma_*.c to the build.

These should have been included in 5.3.2alpha already.

2 years agoBuild: Update comments about unaligned access to mention 64-bit.
Lasse Collin [Fri, 17 Mar 2023 06:41:36 +0000 (08:41 +0200)] 
Build: Update comments about unaligned access to mention 64-bit.

2 years agoTests: Update .gitignore.
Lasse Collin [Thu, 16 Mar 2023 22:02:30 +0000 (00:02 +0200)] 
Tests: Update .gitignore.

2 years agopo4a/update-po: Display the script name consistently in error messages.
Lasse Collin [Tue, 14 Mar 2023 18:04:03 +0000 (20:04 +0200)] 
po4a/update-po: Display the script name consistently in error messages.

2 years agoDoc: Rename Doxygen HTML doc directory name liblzma => api.
Jia Tan [Thu, 16 Mar 2023 17:30:36 +0000 (01:30 +0800)] 
Doc: Rename Doxygen HTML doc directory name liblzma => api.

When the docs are installed, calling the directory "liblzma" is
confusing since multiple other files in the doc directory are for
liblzma. This should also make it more natural for distros when they
package the documentation.

2 years agoliblzma: Remove note from lzma_options_bcj about the ARM64 exception.
Jia Tan [Thu, 16 Mar 2023 14:07:15 +0000 (22:07 +0800)] 
liblzma: Remove note from lzma_options_bcj about the ARM64 exception.

This was left in by mistake since an early version of the ARM64 filter
used a different struct for its options.

2 years agoCI: Add doxygen as a dependency.
Jia Tan [Thu, 16 Mar 2023 13:44:02 +0000 (21:44 +0800)] 
CI: Add doxygen as a dependency.

Autogen now requires --no-doxygen or having doxygen installed to run
without errors.

2 years agoCOPYING: Add a note about the included Doxygen-generated HTML.
Lasse Collin [Wed, 15 Mar 2023 17:19:13 +0000 (19:19 +0200)] 
COPYING: Add a note about the included Doxygen-generated HTML.

2 years agoDoc: Update PACKAGERS with details about liblzma API docs install.
Jia Tan [Thu, 16 Mar 2023 13:41:09 +0000 (21:41 +0800)] 
Doc: Update PACKAGERS with details about liblzma API docs install.

2 years agoliblzma: Add set lzma.h as the main page for Doxygen documentation.
Jia Tan [Thu, 16 Mar 2023 13:38:32 +0000 (21:38 +0800)] 
liblzma: Add set lzma.h as the main page for Doxygen documentation.

The \mainpage command is used in the first block of comments in lzma.h.
This changes the previously nearly empty index.html to use the first
comment block in lzma.h for its contents.

lzma.h is no longer documented separately, but this is for the better
since lzma.h only defined a few macros that users do not need to use.
The individual API header files all have a disclaimer that they should
not be #included directly, so there should be no confusion on the fact
that lzma.h should be the only header used by applications.

Additionally, the note "See ../lzma.h for information about liblzma as
a whole." was removed since lzma.h is now the main page of the
generated HTML and does not have its own page anymore. So it would be
confusing in the HTML version and was only a "nice to have" when
browsing the source files.

2 years agoBuild: Generate doxygen documentation in autogen.sh.
Jia Tan [Thu, 16 Mar 2023 13:37:32 +0000 (21:37 +0800)] 
Build: Generate doxygen documentation in autogen.sh.

Another command line option (--no-doxygen) was added to disable
creating the doxygen documenation in cases where it not wanted or
if the doxygen tool is not installed.

2 years agoBuild: Create doxygen/update-doxygen script.
Jia Tan [Thu, 16 Mar 2023 13:35:55 +0000 (21:35 +0800)] 
Build: Create doxygen/update-doxygen script.

This is a helper script to generate the Doxygen documentation. It can be
run in 'liblzma' or 'internal' mode by setting the first argument. It
will default to 'liblzma' mode and only generate documentation for the
liblzma API header files.

The helper script will be run during the custom mydist hook when we
create releases. This hook already alters the source directory, so its
fine to do it here too. This way, we can include the Doxygen generated
files in the distrubtion and when installing.

In 'liblzma' mode, the JavaScript is stripped from the .html files and
the .js files are removed. This avoids license hassle from jQuery and
other libraries that Doxygen 1.9.6 puts into jquery.js in minified form.

2 years agoBuild: Install Doxygen docs and include in distribution if generated.
Jia Tan [Thu, 16 Mar 2023 13:34:36 +0000 (21:34 +0800)] 
Build: Install Doxygen docs and include in distribution if generated.

Added a install-data-local target to install the Doxygen documentation
only when it has been generated. In order to correctly remove the docs,
a corresponding uninstall-local target was added.

If the doxygen docs exist in the source tree, they will also be included
in the distribution now too.

2 years agoDoxygen: Refactor Doxyfile.in to doxygen/Doxyfile.
Lasse Collin [Thu, 16 Mar 2023 13:23:48 +0000 (21:23 +0800)] 
Doxygen: Refactor Doxyfile.in to doxygen/Doxyfile.

Instead of having Doxyfile.in configured by Autoconf, the Doxyfile
can have the tags that need to be configured piped into the doxygen
command through stdin with the overrides after Doxyfile's contents.

Going forward, the documentation should be generated in two different
modes: liblzma or internal.

liblzma is useful for most users. It is the documentation for just
the liblzma API header files. This is the default.

internal is for people who want to understand how xz and liblzma work.
It might be useful for people who want to contribute to the project.

2 years agoTests: Remove unused macros and functions.
Jia Tan [Tue, 28 Feb 2023 15:22:36 +0000 (23:22 +0800)] 
Tests: Remove unused macros and functions.

2 years agoliblzma: Defines masks for return values from lzma_index_checks().
Jia Tan [Thu, 29 Dec 2022 13:52:15 +0000 (21:52 +0800)] 
liblzma: Defines masks for return values from lzma_index_checks().

2 years agoTests: Refactors existing lzma_index tests.
Jia Tan [Thu, 12 Jan 2023 14:29:07 +0000 (22:29 +0800)] 
Tests: Refactors existing lzma_index tests.

Converts the existing lzma_index tests into tuktests and covers every
API function from index.h except for lzma_file_info_decoder, which can
be tested in the future.

2 years agoxz: Simplify the error-label in Capsicum sandbox code.
Lasse Collin [Sat, 11 Mar 2023 16:42:08 +0000 (18:42 +0200)] 
xz: Simplify the error-label in Capsicum sandbox code.

Also remove unneeded "sandbox_allowed = false;" as this code
will never be run more than once (making it work with multiple
input files isn't trivial).

2 years agoxz: Make Capsicum sandbox more strict with stdin and stdout.
Lasse Collin [Tue, 7 Mar 2023 17:59:23 +0000 (19:59 +0200)] 
xz: Make Capsicum sandbox more strict with stdin and stdout.

2 years agoRevert: "Add warning if Capsicum sandbox system calls are unsupported."
Jia Tan [Wed, 8 Mar 2023 15:08:46 +0000 (23:08 +0800)] 
Revert: "Add warning if Capsicum sandbox system calls are unsupported."

The warning causes the exit status to be 2, so this will cause problems
for many scripted use cases for xz. The sandbox usage is already very
limited already, so silently disabling this allows it to be more usable.

2 years agoxz: Fix -Wunused-label in io_sandbox_enter().
Jia Tan [Tue, 7 Mar 2023 12:02:22 +0000 (20:02 +0800)] 
xz: Fix -Wunused-label in io_sandbox_enter().

Thanks to Xin Li for recommending the fix.

2 years agoxz: Add warning if Capsicum sandbox system calls are unsupported.
Jia Tan [Mon, 6 Mar 2023 13:37:45 +0000 (21:37 +0800)] 
xz: Add warning if Capsicum sandbox system calls are unsupported.

The warning is only used when errno == ENOSYS. Otherwise, xz still
issues a fatal error.

2 years agoxz: Skip Capsicum sandbox system calls when they are unsupported.
Jia Tan [Mon, 6 Mar 2023 13:27:53 +0000 (21:27 +0800)] 
xz: Skip Capsicum sandbox system calls when they are unsupported.

If a system has the Capsicum header files but does not actually
implement the system calls, then this would render xz unusable. Instead,
we can check if errno == ENOSYS and not issue a fatal error.

2 years agoxz: Reorder cap_enter() to beginning of capsicum sandbox code.
Jia Tan [Mon, 6 Mar 2023 13:08:26 +0000 (21:08 +0800)] 
xz: Reorder cap_enter() to beginning of capsicum sandbox code.

cap_enter() puts the process into the sandbox. If later calls to
cap_rights_limit() fail, then the process can still have some extra
protections.

2 years agoliblzma: Clarify lzma_lzma_preset() documentation in lzma12.h.
Jia Tan [Fri, 24 Feb 2023 15:46:23 +0000 (23:46 +0800)] 
liblzma: Clarify lzma_lzma_preset() documentation in lzma12.h.

lzma_lzma_preset() does not guarentee that the lzma_options_lzma are
usable in an encoder even if it returns false (success). If liblzma
is built with default configurations, then the options will always be
usable. However if the match finders hc3, hc4, or bt4 are disabled, then
the options may not be usable depending on the preset level requested.

The documentation was updated to reflect this complexity, since this
behavior was unclear before.

2 years agoCMake: Require that the C compiler supports C99 or a newer standard.
Lasse Collin [Mon, 27 Feb 2023 16:38:35 +0000 (18:38 +0200)] 
CMake: Require that the C compiler supports C99 or a newer standard.

Thanks to autoantwort for reporting the issue and suggesting
a different patch:
https://github.com/tukaani-project/xz/pull/42

2 years agoTests: Small tweak to test-vli.c.
Jia Tan [Fri, 24 Feb 2023 10:10:37 +0000 (18:10 +0800)] 
Tests: Small tweak to test-vli.c.

The static global variables can be disabled if encoders and decoders
are not built. If they are not disabled and -Werror is used, it will
cause an usused warning as an error.

2 years agoliblzma: Replace '\n' -> newline in filter.h documentation.
Jia Tan [Mon, 6 Feb 2023 13:46:43 +0000 (21:46 +0800)] 
liblzma: Replace '\n' -> newline in filter.h documentation.

The '\n' renders as a newline when the comments are converted to html
by Doxygen.

2 years agoliblzma: Shorten return description for two functions in filter.h.
Jia Tan [Mon, 6 Feb 2023 13:45:37 +0000 (21:45 +0800)] 
liblzma: Shorten return description for two functions in filter.h.

Shorten the description for lzma_raw_encoder_memusage() and
lzma_raw_decoder_memusage().

2 years agoliblzma: Reword a few lines in filter.h
Jia Tan [Mon, 6 Feb 2023 13:44:45 +0000 (21:44 +0800)] 
liblzma: Reword a few lines in filter.h

2 years agoliblzma: Improve documentation in filter.h.
Jia Tan [Mon, 6 Feb 2023 13:35:06 +0000 (21:35 +0800)] 
liblzma: Improve documentation in filter.h.

All functions now explicitly specify parameter and return values.
The notes and code annotations were moved before the parameter and
return value descriptions for consistency.

Also, the description above lzma_filter_encoder_is_supported() about
not being able to list available filters was removed since
lzma_str_list_filters() will do this.

2 years agoUpdate THANKS.
Lasse Collin [Thu, 23 Feb 2023 18:46:16 +0000 (20:46 +0200)] 
Update THANKS.

2 years agoliblzma: Avoid null pointer + 0 (undefined behavior in C).
Lasse Collin [Tue, 21 Feb 2023 20:57:10 +0000 (22:57 +0200)] 
liblzma: Avoid null pointer + 0 (undefined behavior in C).

In the C99 and C17 standards, section 6.5.6 paragraph 8 means that
adding 0 to a null pointer is undefined behavior. As of writing,
"clang -fsanitize=undefined" (Clang 15) diagnoses this. However,
I'm not aware of any compiler that would take advantage of this
when optimizing (Clang 15 included). It's good to avoid this anyway
since compilers might some day infer that pointer arithmetic implies
that the pointer is not NULL. That is, the following foo() would then
unconditionally return 0, even for foo(NULL, 0):

    void bar(char *a, char *b);

    int foo(char *a, size_t n)
    {
        bar(a, a + n);
        return a == NULL;
    }

In contrast to C, C++ explicitly allows null pointer + 0. So if
the above is compiled as C++ then there is no undefined behavior
in the foo(NULL, 0) call.

To me it seems that changing the C standard would be the sane
thing to do (just add one sentence) as it would ensure that a huge
amount of old code won't break in the future. Based on web searches
it seems that a large number of codebases (where null pointer + 0
occurs) are being fixed instead to be future-proof in case compilers
will some day optimize based on it (like making the above foo(NULL, 0)
return 0) which in the worst case will cause security bugs.

Some projects don't plan to change it. For example, gnulib and thus
many GNU tools currently require that null pointer + 0 is defined:

    https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00000.html

    https://www.gnu.org/software/gnulib/manual/html_node/Other-portability-assumptions.html

In XZ Utils null pointer + 0 issue should be fixed after this
commit. This adds a few if-statements and thus branches to avoid
null pointer + 0. These check for size > 0 instead of ptr != NULL
because this way bugs where size > 0 && ptr == NULL will likely
get caught quickly. None of them are in hot spots so it shouldn't
matter for performance.

A little less readable version would be replacing

    ptr + offset

with

    offset != 0 ? ptr + offset : ptr

or creating a macro for it:

    #define my_ptr_add(ptr, offset) \
            ((offset) != 0 ? ((ptr) + (offset)) : (ptr))

Checking for offset != 0 instead of ptr != NULL allows GCC >= 8.1,
Clang >= 7, and Clang-based ICX to optimize it to the very same code
as ptr + offset. That is, it won't create a branch. So for hot code
this could be a good solution to avoid null pointer + 0. Unfortunately
other compilers like ICC 2021 or MSVC 19.33 (VS2022) will create a
branch from my_ptr_add().

Thanks to Marcin Kowalczyk for reporting the problem:
https://github.com/tukaani-project/xz/issues/36

2 years agoliblzma: Adjust container.h for consistency with filter.h.
Jia Tan [Mon, 6 Feb 2023 16:00:44 +0000 (00:00 +0800)] 
liblzma: Adjust container.h for consistency with filter.h.

2 years agoliblzma: Fix small typos and reword a few things in filter.h.
Jia Tan [Mon, 6 Feb 2023 16:00:09 +0000 (00:00 +0800)] 
liblzma: Fix small typos and reword a few things in filter.h.

2 years agoliblzma: Convert list of flags in lzma_mt to bulleted list.
Jia Tan [Mon, 6 Feb 2023 15:42:08 +0000 (23:42 +0800)] 
liblzma: Convert list of flags in lzma_mt to bulleted list.

2 years agoliblzma: Fix typo in documentation in container.h
Jia Tan [Thu, 26 Jan 2023 15:17:41 +0000 (23:17 +0800)] 
liblzma: Fix typo in documentation in container.h

lzma_microlzma_decoder -> lzma_microlzma_encoder

2 years agoliblzma: Improve documentation for container.h
Jia Tan [Thu, 26 Jan 2023 15:16:34 +0000 (23:16 +0800)] 
liblzma: Improve documentation for container.h

Standardizing each function to always specify parameters and return
values. Also moved the parameters and return values to the end of each
function description.

2 years agoCMake: Add LZIP decoder test to list of tests.
Jia Tan [Wed, 22 Feb 2023 12:59:41 +0000 (20:59 +0800)] 
CMake: Add LZIP decoder test to list of tests.

2 years agoUpdate THANKS.
Lasse Collin [Fri, 17 Feb 2023 18:56:49 +0000 (20:56 +0200)] 
Update THANKS.

2 years agoBuild: Use only the generic symbol versioning on MicroBlaze.
Lasse Collin [Fri, 17 Feb 2023 18:48:28 +0000 (20:48 +0200)] 
Build: Use only the generic symbol versioning on MicroBlaze.

On MicroBlaze, GCC 12 is broken in sense that
__has_attribute(__symver__) returns true but it still doesn't
support the __symver__ attribute even though the platform is ELF
and symbol versioning is supported if using the traditional
__asm__(".symver ...") method. Avoiding the traditional method is
good because it breaks LTO (-flto) builds with GCC.

See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766

For now the only extra symbols in liblzma_linux.map are the
compatibility symbols with the patch that spread from RHEL/CentOS 7.
These require the use of __symver__ attribute or __asm__(".symver ...")
in the C code. Compatibility with the patch from CentOS 7 doesn't
seem valuable on MicroBlaze so use liblzma_generic.map on MicroBlaze
instead. It doesn't require anything special in the C code and thus
no LTO issues either.

An alternative would be to detect support for __symver__
attribute in configure.ac and CMakeLists.txt and fall back
to __asm__(".symver ...") but then LTO would be silently broken
on MicroBlaze. It sounds likely that MicroBlaze is a special
case so let's treat it as a such because that is simpler. If
a similar issue exists on some other platform too then hopefully
someone will report it and this can be reconsidered.

(This doesn't do the same fix in CMakeLists.txt. Perhaps it should
but perhaps CMake build of liblzma doesn't matter much on MicroBlaze.
The problem breaks the build so it's easy to notice and can be fixed
later.)

Thanks to Vincent Fazio for reporting the problem and proposing
a patch (in the end that solution wasn't used):
https://github.com/tukaani-project/xz/pull/32

2 years agoliblzma: Very minor API doc tweaks.
Lasse Collin [Thu, 16 Feb 2023 19:09:00 +0000 (21:09 +0200)] 
liblzma: Very minor API doc tweaks.

Use "member" to refer to struct members as that's the term used
by the C standard.

Use lzma_options_delta.dist and such in docs so that in Doxygen's
HTML output they will link to the doc of the struct member.

Clean up a few trailing white spaces too.

2 years agoliblzma: Adjust spacing in doc headers in bcj.h.
Jia Tan [Thu, 16 Feb 2023 16:54:33 +0000 (00:54 +0800)] 
liblzma: Adjust spacing in doc headers in bcj.h.

2 years agoliblzma: Adjust documentation in bcj.h for consistent style.
Jia Tan [Thu, 16 Feb 2023 16:44:44 +0000 (00:44 +0800)] 
liblzma: Adjust documentation in bcj.h for consistent style.

2 years agoliblzma: Rename field => member in documentation.
Jia Tan [Thu, 16 Feb 2023 16:36:05 +0000 (00:36 +0800)] 
liblzma: Rename field => member in documentation.

Also adjusted preset value => preset level.

2 years agoliblzma: Silence a warning from MSVC.
Lasse Collin [Thu, 16 Feb 2023 15:59:50 +0000 (17:59 +0200)] 
liblzma: Silence a warning from MSVC.

It gives C4146 here since unary minus with unsigned integer
is still unsigned (which is the intention here). Doing it
with substraction makes it clearer and avoids the warning.

Thanks to Nathan Moinvaziri for reporting this.

2 years ago liblzma: Improve documentation for stream_flags.h
Jia Tan [Thu, 16 Feb 2023 13:04:54 +0000 (21:04 +0800)] 
 liblzma: Improve documentation for stream_flags.h

Standardizing each function to always specify parameters and return
values. Also moved the parameters and return values to the end of each
function description.

A few small things were reworded and long sentences broken up.

2 years agoliblzma: Improve documentation in lzma12.h.
Jia Tan [Tue, 14 Feb 2023 13:50:16 +0000 (21:50 +0800)] 
liblzma: Improve documentation in lzma12.h.

All functions now explicitly specify parameter and return values.

2 years agoliblzma: Improve documentation in check.h.
Jia Tan [Fri, 27 Jan 2023 14:44:06 +0000 (22:44 +0800)] 
liblzma: Improve documentation in check.h.

All functions now explicitly specify parameter and return values.
Also moved the note about SHA-256 functions not being exported to the
top of the file.

2 years agoliblzma: Improve documentation in index.h
Jia Tan [Wed, 8 Feb 2023 13:33:52 +0000 (21:33 +0800)] 
liblzma: Improve documentation in index.h

All functions now explicitly specify parameter and return values.

2 years agoliblzma: Reword a comment in index.h.
Jia Tan [Wed, 8 Feb 2023 12:35:32 +0000 (20:35 +0800)] 
liblzma: Reword a comment in index.h.

2 years agoliblzma: Omit lzma_index_iter's internal field from Doxygen docs.
Jia Tan [Wed, 8 Feb 2023 12:30:23 +0000 (20:30 +0800)] 
liblzma: Omit lzma_index_iter's internal field from Doxygen docs.

Add \private above this field and its sub-fields since it is not meant
to be modified by users.

2 years agoliblzma: Fix documentation for LZMA_MEMLIMIT_ERROR.
Jia Tan [Sat, 21 Jan 2023 13:32:03 +0000 (21:32 +0800)] 
liblzma: Fix documentation for LZMA_MEMLIMIT_ERROR.

LZMA_MEMLIMIT_ERROR was missing the "<" character needed to put
documentation after a member.

2 years agoliblzma: Improve documentation for base.h.
Jia Tan [Fri, 20 Jan 2023 16:29:38 +0000 (00:29 +0800)] 
liblzma: Improve documentation for base.h.

Standardizing each function to always specify params and return values.
Also fixed a small grammar mistake.

2 years agoliblzma: Add one more missing [out] annotation in vli.h
Jia Tan [Mon, 13 Feb 2023 16:12:34 +0000 (00:12 +0800)] 
liblzma: Add one more missing [out] annotation in vli.h

2 years agoliblzma: Minor improvements to vli.h.
Jia Tan [Mon, 13 Feb 2023 16:08:33 +0000 (00:08 +0800)] 
liblzma: Minor improvements to vli.h.

Added [out] annotations to parameters that are pointers and can have
their value changed. Also added a clarification to lzma_vli_is_valid.

2 years agoliblzma: Add comments for macros in delta.h.
Jia Tan [Fri, 10 Feb 2023 13:38:02 +0000 (21:38 +0800)] 
liblzma: Add comments for macros in delta.h.

Document LZMA_DELTA_DIST_MIN and LZMA_DELTA_DIST_MAX for completeness
and to avoid Doxygen warnings.

2 years agoliblzma: Improve documentation in index_hash.h.
Jia Tan [Fri, 10 Feb 2023 13:35:23 +0000 (21:35 +0800)] 
liblzma: Improve documentation in index_hash.h.

All functions now explicitly specify parameter and return values.
Also reworded the description of lzma_index_hash_init() for readability.

2 years agoxz: Improve the comment about start_time in mytime.c.
Lasse Collin [Tue, 7 Feb 2023 17:07:45 +0000 (19:07 +0200)] 
xz: Improve the comment about start_time in mytime.c.

start_time is relative to an arbitary point in time, it's not
time of day, so using it for anything else than time differences
wouldn't make sense.

2 years agoBuild: Adjust CMake version search regex.
Jia Tan [Sat, 4 Feb 2023 13:06:35 +0000 (21:06 +0800)] 
Build: Adjust CMake version search regex.

Now, the LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, and LZMA_VERSION_PATCH
macros do not need to be on consecutive lines in version.h. They can be
separated by more whitespace, comments, or even other content, as long
as they appear in the proper order (major, minor, patch).

2 years agoxz: Add a comment clarifying the use of start_time in mytime.c.
Jia Tan [Sat, 4 Feb 2023 04:01:23 +0000 (12:01 +0800)] 
xz: Add a comment clarifying the use of start_time in mytime.c.

2 years agoliblzma: Improve documentation for version.h.
Jia Tan [Thu, 26 Jan 2023 01:50:21 +0000 (09:50 +0800)] 
liblzma: Improve documentation for version.h.

Specified parameter and return values for API functions and documented
a few more of the macros.

2 years agoDocs: Omit SIGTSTP not handled from TODO.
Jia Tan [Fri, 3 Feb 2023 14:52:55 +0000 (22:52 +0800)] 
Docs: Omit SIGTSTP not handled from TODO.

2 years agoliblzma: Fix bug in lzma_str_from_filters() not checking filters[] length.
Jia Tan [Thu, 2 Feb 2023 16:33:32 +0000 (00:33 +0800)] 
liblzma: Fix bug in lzma_str_from_filters() not checking filters[] length.

The bug is only a problem in applications that do not properly terminate
the filters[] array with LZMA_VLI_UNKNOWN or have more than
LZMA_FILTERS_MAX filters. This bug does not affect xz.

2 years agoTests: Create test_filter_str.c.
Jia Tan [Thu, 2 Feb 2023 16:32:47 +0000 (00:32 +0800)] 
Tests: Create test_filter_str.c.

Tests lzma_str_to_filters(), lzma_str_from_filters(), and
lzma_str_list_filters() API functions.

2 years agoliblzma: Fix typos in comments in string_conversion.c.
Jia Tan [Sun, 22 Jan 2023 00:49:00 +0000 (08:49 +0800)] 
liblzma: Fix typos in comments in string_conversion.c.

2 years agoliblzma: Clarify block encoder and decoder documentation.
Jia Tan [Thu, 2 Feb 2023 16:20:20 +0000 (00:20 +0800)] 
liblzma: Clarify block encoder and decoder documentation.

Added a few sentences to the description for lzma_block_encoder() and
lzma_block_decoder() to highlight that the Block Header must be coded
before calling these functions.

2 years agoUpdate lzma_block documentation for lzma_block_uncomp_encode().
Jia Tan [Thu, 2 Feb 2023 16:12:24 +0000 (00:12 +0800)] 
Update lzma_block documentation for lzma_block_uncomp_encode().

2 years agoliblzma: Minor edits to lzma_block header_size documentation.
Jia Tan [Thu, 2 Feb 2023 16:11:37 +0000 (00:11 +0800)] 
liblzma: Minor edits to lzma_block header_size documentation.

2 years agoliblzma: Enumerate functions that read version in lzma_block.
Jia Tan [Thu, 2 Feb 2023 16:11:07 +0000 (00:11 +0800)] 
liblzma: Enumerate functions that read version in lzma_block.

2 years agoliblzma: Clarify comment in block.h.
Jia Tan [Thu, 2 Feb 2023 16:10:34 +0000 (00:10 +0800)] 
liblzma: Clarify comment in block.h.

2 years agoliblzma: Improve documentation for block.h.
Jia Tan [Thu, 2 Feb 2023 16:07:23 +0000 (00:07 +0800)] 
liblzma: Improve documentation for block.h.

Standardizing each function to always specify params and return values.
Output pointer parameters are also marked with doxygen style [out] to
make it clear. Any note sections were also moved above the parameter and
return sections for consistency.

2 years agoliblzma: Clarify a comment about LZMA_STR_NO_VALIDATION.
Jia Tan [Wed, 1 Feb 2023 15:38:30 +0000 (23:38 +0800)] 
liblzma: Clarify a comment about LZMA_STR_NO_VALIDATION.

The flag description for LZMA_STR_NO_VALIDATION was previously confusing
about the treatment for filters than cannot be used with .xz format
(lzma1) without using LZMA_STR_ALL_FILTERS. Now, it is clear that
LZMA_STR_NO_VALIDATION is not a super set of LZMA_STR_ALL_FILTERS.

2 years agoCI: Update .gitignore for artifacts directory in build-aux.
Jia Tan [Wed, 1 Feb 2023 13:43:33 +0000 (21:43 +0800)] 
CI: Update .gitignore for artifacts directory in build-aux.

The workflow action for our CI pipeline can only reference artifacts in
the source directory, so we should ignore these files if the ci_build.sh
is run locally.

2 years agoCI: Add quotes around variables in a few places.
Jia Tan [Wed, 1 Feb 2023 13:36:46 +0000 (21:36 +0800)] 
CI: Add quotes around variables in a few places.

2 years agoCI: Upload test logs as artifacts if a test fails.
Jia Tan [Wed, 1 Feb 2023 13:36:22 +0000 (21:36 +0800)] 
CI: Upload test logs as artifacts if a test fails.

2 years agoxz: Use clock_gettime() even if CLOCK_MONOTONIC isn't available.
Lasse Collin [Fri, 27 Jan 2023 18:02:49 +0000 (20:02 +0200)] 
xz: Use clock_gettime() even if CLOCK_MONOTONIC isn't available.

mythread.h and thus liblzma already does it.

2 years agopo4a/po4a.conf: Sort the language identifiers in alphabetical order.
Lasse Collin [Fri, 27 Jan 2023 17:41:19 +0000 (19:41 +0200)] 
po4a/po4a.conf: Sort the language identifiers in alphabetical order.

2 years agoxz: Add SIGTSTP handler for progress indicator time keeping.
Lasse Collin [Thu, 26 Jan 2023 16:29:17 +0000 (18:29 +0200)] 
xz: Add SIGTSTP handler for progress indicator time keeping.

This way, if xz is stopped the elapsed time and estimated time
remaining won't get confused by the amount of time spent in
the stopped state.

This raises SIGSTOP. It's not clear to me if this is the correct way.
POSIX and glibc docs say that SIGTSTP shouldn't stop the process if
it is orphaned but this commit doesn't attempt to handle that.

Search for SIGTSTP in section 2.4.3:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

2 years agoTranslations: Add Brazilian Portuguese translation of man pages.
Jia Tan [Fri, 27 Jan 2023 12:14:51 +0000 (20:14 +0800)] 
Translations: Add Brazilian Portuguese translation of man pages.

Thanks to Rafael Fontenelle.

2 years agoBuild: Avoid different quoting style in --enable-doxygen doc.
Lasse Collin [Thu, 26 Jan 2023 15:51:06 +0000 (17:51 +0200)] 
Build: Avoid different quoting style in --enable-doxygen doc.

2 years agotuklib_physmem: Check for __has_warning before GCC version.
Lasse Collin [Thu, 26 Jan 2023 15:39:46 +0000 (17:39 +0200)] 
tuklib_physmem: Check for __has_warning before GCC version.

Clang can be configured to fake a too high GCC version so
this way it's more robust.