mcpplibs.mwrap.xz 5.8.3 exports the public API of liblzma, upstream's names
unchanged. This page lists what each module holds and the places where a module
and a header differ. tools/generate.py writes the lists
from the headers, and CI checks them on every target.
| Module | Holds |
|---|---|
mcpplibs.mwrap.xz |
everything <lzma.h> declares through lzma/*.h: lzma_stream, lzma_code, lzma_end, lzma_ret, lzma_action and the memory and progress queries (base.h); the .xz, .lzma, .lz and raw coders and their buffer forms (lzma_easy_*, lzma_stream_*, lzma_alone_*, lzma_lzip_decoder, lzma_auto_decoder, lzma_raw_*, lzma_microlzma_*, container.h); filters (lzma_filter, lzma_options_lzma, lzma_options_delta, lzma_options_bcj, lzma_lzma_preset, lzma_filters_*, lzma_str_to_filters, filter.h, lzma12.h, delta.h, bcj.h); blocks, stream flags, indexes and index hashes; checks (lzma_check, lzma_crc32, lzma_crc64, lzma_check_size); integers (lzma_vli and its coders); lzma_physmem; lzma_version_number, lzma_version_string. Re-exports the macros module |
mcpplibs.mwrap.xz.macros |
in mcpplibs::mwrap::xz::macros: the presets and their flags (LZMA_PRESET_DEFAULT, LZMA_PRESET_EXTREME, LZMA_PRESET_LEVEL_MASK), the decoder flags (LZMA_CONCATENATED, LZMA_TELL_*, LZMA_IGNORE_CHECK, LZMA_FAIL_FAST), the filter IDs (LZMA_FILTER_*), the limits and defaults of the LZMA options, of blocks, streams, indexes and VLIs, the LZMA_STR_* flags, and the version (LZMA_VERSION, LZMA_VERSION_STRING, LZMA_VERSION_MAJOR …) |
compat.xz does not build hardware_cputhreads.c, stream_encoder_mt.c or
stream_decoder_mt.c: the multithreaded coders need a thread library the
package does not configure. Their functions (lzma_cputhreads,
lzma_stream_encoder_mt, lzma_stream_encoder_mt_memusage,
lzma_stream_decoder_mt) would not link and are not exported; lzma_mt, the
options structure, is. tools/surface.toml lists them as unbuilt, and
tests/linked.cpp links every function that is exported.
- Constants. Each object-like macro whose expansion is a constant
expression is an
inline constexprof the same name and value; tests/macros.cpp compares every one with its macro. LZMA_STREAM_INITis an initializer, not a value, and stays a macro in<mwrap/xz/macros.hpp>, with upstream'sNULLwrittennullptr.- Macros with arguments.
lzma_vli_is_valid(vli)(readingLZMA_VLI_MAXandLZMA_VLI_UNKNOWNfrom the macros module),lzma_set_ext_size(opt, size),lzma_block_header_size_decode(b)andLZMA_VLI_C(n)stay macros there. The second and third cast touint32_tanduint64_t: importstd.compat.LZMA_VLI_Cexpands to<stdint.h>'sUINT64_C; in a module-only unit writelzma_vli{n}. - Declaration syntax.
LZMA_API,LZMA_API_CALL,LZMA_API_IMPORT,lzma_attribute,lzma_attr_*,lzma_nothrow, and the stringification stepsLZMA_VERSION_STRING_CandLZMA_VERSION_STRING_C_are not offered. tools/surface.toml lists them.
#include <lzma.h> and import mcpplibs.mwrap.xz; may appear in one unit:
they declare the same entities. A macro expands even inside a qualified name,
so mcpplibs::mwrap::xz::macros::LZMA_CONCATENATED written after the header is
...::macros::0x08. In such a unit use the header's macros, or read their
values under other names and #undef the macros before naming the constants
(tests/macros.cpp does this).
The package depends on compat.xz 5.8.3, which builds liblzma from the release
sources with the target's toolchain. A program that imports the module links
that library; it does not look for a system liblzma.
The library is static, and the module reads lzma.h with LZMA_API_STATIC
defined (5.8.3.1). On Windows the header otherwise declares every function
imported from a DLL, and a unit that read it so calls through __imp_lzma_*.
A unit that includes lzma.h itself beside the module defines
LZMA_API_STATIC before it, or includes <mwrap/xz/macros.hpp> first, which
defines it. 5.8.3 did not: its tests passed in the dev profile, and a program
built in the release profile, where the link collects unreferenced sections,
faulted at its first call into the library on Windows.