mcpplibs.mwrap.zstd 1.5.7 exports Zstandard's stable API, 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.zstd |
the stable API of <zstd.h>: one-shot ZSTD_compress, ZSTD_decompress, ZSTD_compressBound, ZSTD_getFrameContentSize, ZSTD_findFrameCompressedSize; explicit contexts (ZSTD_CCtx, ZSTD_DCtx and their create, free, compressCCtx, decompressDCtx); the advanced API (ZSTD_cParameter, ZSTD_dParameter and their enumerators, ZSTD_CCtx_setParameter, ZSTD_compress2, ZSTD_cParam_getBounds, ZSTD_strategy, ZSTD_ResetDirective); streaming (ZSTD_inBuffer, ZSTD_outBuffer, ZSTD_EndDirective, ZSTD_compressStream2, ZSTD_decompressStream, the CStream/DStream forms); dictionaries (ZSTD_CDict, ZSTD_DDict, *_usingDict, *_usingCDict, *_usingDDict, ZSTD_CCtx_loadDictionary, refPrefix, getDictID_*); ZSTD_sizeof_*; ZSTD_versionNumber, ZSTD_versionString, ZSTD_isError, ZSTD_getErrorName, levels. From <zstd_errors.h>: ZSTD_ErrorCode with every ZSTD_error_*, ZSTD_getErrorCode, ZSTD_getErrorString. Re-exports the macros module |
mcpplibs.mwrap.zstd.macros |
in mcpplibs::mwrap::zstd::macros: ZSTD_VERSION_MAJOR, _MINOR, _RELEASE, _NUMBER, _STRING; ZSTD_CLEVEL_DEFAULT; ZSTD_MAGICNUMBER, ZSTD_MAGIC_DICTIONARY, ZSTD_MAGIC_SKIPPABLE_START, ZSTD_MAGIC_SKIPPABLE_MASK; ZSTD_BLOCKSIZELOG_MAX, ZSTD_BLOCKSIZE_MAX; ZSTD_CONTENTSIZE_UNKNOWN, ZSTD_CONTENTSIZE_ERROR; ZSTD_MAX_INPUT_SIZE |
- The experimental API. The part of
<zstd.h>behindZSTD_STATIC_LINKING_ONLYis declared only when a unit defines that macro before the header, and upstream may change it in any release. A program that needs it includes<zstd.h>with the macro and links the samecompat.zstd. <zdict.h>.compat.zstdbuildslib/common,lib/compressandlib/decompress, notlib/dictBuilder; theZDICT_*functions would not link. A raw-content dictionary (any bytes) works withZSTD_createCDict.
- 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. ZSTD_COMPRESSBOUND(srcSize)is a constant expression whereZSTD_compressBoundis a call, so it stays a macro in<mwrap/zstd/macros.hpp>, readingZSTD_MAX_INPUT_SIZEfrom the macros module. It casts tosize_t: importstd.compat, which declares::size_t.- Declaration syntax.
ZSTDLIB_API,ZSTDLIB_VISIBLE,ZSTDLIB_HIDDEN, theirZSTDERRORLIB_*counterparts,ZSTD_DEPRECATED, and the stringification stepsZSTD_QUOTE,ZSTD_EXPAND_AND_QUOTE,ZSTD_LIB_VERSION(whose result isZSTD_VERSION_STRING) are not offered. tools/surface.toml lists them.
#include <zstd.h> and import mcpplibs.mwrap.zstd; may appear in one unit:
they declare the same entities. A macro expands even inside a qualified name,
so mcpplibs::mwrap::zstd::macros::ZSTD_CLEVEL_DEFAULT written after the header
is ...::macros::3. 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.zstd 1.5.7, which builds Zstandard from the
release sources with the target's toolchain, without assembly
(ZSTD_DISABLE_ASM). A program that imports the module links that library; it
does not look for a system zstd.