Expand description
Low-level bindings to the zstd library.
Structs§
- POOL_
ctx_ s - ZDICT_
cover_ params_ t - ZDICT_cover_params_t: k and d are the only required parameters. For others, value 0 means default.
- ZDICT_
fast Cover_ params_ t - ZDICT_
legacy_ params_ t - ZDICT_
params_ t - ZSTD_
CCtx_ params_ s - ZSTD_
CCtx_ s - ZSTD_
CDict_ s - ZSTD_
DCtx_ s - ZSTD_
DDict_ s - ZSTD_
Sequence - ZSTD_
bounds - ZSTD_
compression Parameters - ZSTD_
custom Mem - ZSTD_
frame Header - ZSTD_
frame Parameters - ZSTD_
frame Progression - ZSTD_
inBuffer_ s - Streaming
- ZSTD_
outBuffer_ s - ZSTD_
parameters
Enums§
- ZSTD_
EndDirective - ZSTD_
Error Code - ZSTD_
Reset Directive - ZSTD_
cParameter - ZSTD_
dParameter - Advanced decompression API (Requires v1.4.0+)
- ZSTD_
dict Attach Pref_ e - ZSTD_
dict Content Type_ e - ZSTD_
dict Load Method_ e - ZSTD_
force Ignore Checksum_ e - ZSTD_
format_ e - ZSTD_
frame Type_ e - ZSTD_
literal Compression Mode_ e - ZSTD_
next Input Type_ e - ZSTD_
param Switch_ e - ZSTD_
refMultipleD Dicts_ e - ZSTD_
sequence Format_ e - ZSTD_
strategy - Advanced compression API (Requires v1.4.0+)
Constants§
- ZDICT_
CONTENTSIZE_ MIN - ZDICT_
DICTSIZE_ MIN - ZSTD_
BLOCKSIZELOG_ MAX - ZSTD_
BLOCKSIZE_ MAX - ZSTD_
BLOCKSIZE_ MAX_ MIN - ZSTD_
CHAINLOG_ MAX_ 32 - ZSTD_
CHAINLOG_ MAX_ 64 - ZSTD_
CHAINLOG_ MIN - ZSTD_
CLEVEL_ DEFAULT - ZSTD_
CONTENTSIZE_ ERROR - ZSTD_
CONTENTSIZE_ UNKNOWN - ZSTD_
FRAMEHEADERSIZE_ MAX - ZSTD_
HASHLOG_ MIN - ZSTD_
LDM_ BUCKETSIZELOG_ MAX - ZSTD_
LDM_ BUCKETSIZELOG_ MIN - ZSTD_
LDM_ HASHLOG_ MIN - ZSTD_
LDM_ HASHRATELOG_ MIN - ZSTD_
LDM_ MINMATCH_ MAX - ZSTD_
LDM_ MINMATCH_ MIN - ZSTD_
MAGICNUMBER - ZSTD_
MAGIC_ DICTIONARY - ZSTD_
MAGIC_ SKIPPABLE_ MASK - ZSTD_
MAGIC_ SKIPPABLE_ START - ZSTD_
MINMATCH_ MAX - ZSTD_
MINMATCH_ MIN - ZSTD_
OVERLAPLOG_ MAX - ZSTD_
OVERLAPLOG_ MIN - ZSTD_
SEARCHLOG_ MIN - ZSTD_
SKIPPABLEHEADERSIZE - ZSTD_
SRCSIZEHINT_ MIN - ZSTD_
TARGETCBLOCKSIZE_ MAX - ZSTD_
TARGETCBLOCKSIZE_ MIN - ZSTD_
TARGETLENGTH_ MAX - ZSTD_
TARGETLENGTH_ MIN - ZSTD_
VERSION_ MAJOR - ZSTD_
VERSION_ MINOR - ZSTD_
VERSION_ NUMBER - ZSTD_
VERSION_ RELEASE - ZSTD_
WINDOWLOG_ LIMIT_ DEFAULT - ZSTD_
WINDOWLOG_ MAX_ 32 - ZSTD_
WINDOWLOG_ MAX_ 64 - ZSTD_
WINDOWLOG_ MIN
Statics§
- ZSTD_
defaultC ⚠Mem - < this constant defers to stdlib’s functions
Functions§
- ZDICT_
addEntropy ⚠Tables From Buffer - ZDICT_
finalize ⚠Dictionary - ZDICT_finalizeDictionary(): Given a custom content as a basis for dictionary, and a set of samples, finalize dictionary by adding headers and statistics according to the zstd dictionary format.
- ZDICT_
getDict ⚠Header Size - ZDICT_
getDictID ⚠ - ZDICT_
getError ⚠Name - ZDICT_
isError ⚠ - ZDICT_
optimize ⚠Train From Buffer_ cover - ZDICT_optimizeTrainFromBuffer_cover():
The same requirements as above hold for all the parameters except
parameters
. This function tries many parameter combinations and picks the best parameters.*parameters
is filled with the best parameters found, dictionary constructed with those parameters is stored indictBuffer
. - ZDICT_
optimize ⚠Train From Buffer_ fast Cover - ZDICT_optimizeTrainFromBuffer_fastCover():
The same requirements as above hold for all the parameters except
parameters
. This function tries many parameter combinations (specifically, k and d combinations) and picks the best parameters.*parameters
is filled with the best parameters found, dictionary constructed with those parameters is stored indictBuffer
. All of the parameters d, k, steps, f, and accel are optional. If d is non-zero then we don’t check multiple values of d, otherwise we check d = {6, 8}. if steps is zero it defaults to its default value. If k is non-zero then we don’t check multiple values of k, otherwise we check steps values in [50, 2000]. If f is zero, default value of 20 is used. If accel is zero, default value of 1 is used. - ZDICT_
train ⚠From Buffer - ZDICT_trainFromBuffer():
Train a dictionary from an array of samples.
Redirect towards ZDICT_optimizeTrainFromBuffer_fastCover() single-threaded, with d=8, steps=4,
f=20, and accel=1.
Samples must be stored concatenated in a single flat buffer
samplesBuffer
, supplied with an array of sizessamplesSizes
, providing the size of each sample, in order. The resulting dictionary will be saved intodictBuffer
. @return: size of dictionary stored intodictBuffer
(<=dictBufferCapacity
) or an error code, which can be tested with ZDICT_isError(). Note: Dictionary training will fail if there are not enough samples to construct a dictionary, or if most of the samples are too small (< 8 bytes being the lower limit). If dictionary training fails, you should use zstd without a dictionary, as the dictionary would’ve been ineffective anyways. If you believe your samples would benefit from a dictionary please open an issue with details, and we can look into it. Note: ZDICT_trainFromBuffer()’s memory usage is about 6 MB. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It’s possible to select smaller or larger size, just by specifyingdictBufferCapacity
. In general, it’s recommended to provide a few thousands samples, though this can vary a lot. It’s recommended that total size of all samples be about ~x100 times the target size of dictionary. - ZDICT_
train ⚠From Buffer_ cover - ZDICT_trainFromBuffer_cover():
Train a dictionary from an array of samples using the COVER algorithm.
Samples must be stored concatenated in a single flat buffer
samplesBuffer
, supplied with an array of sizessamplesSizes
, providing the size of each sample, in order. The resulting dictionary will be saved intodictBuffer
. @return: size of dictionary stored intodictBuffer
(<=dictBufferCapacity
) or an error code, which can be tested with ZDICT_isError(). See ZDICT_trainFromBuffer() for details on failure modes. Note: ZDICT_trainFromBuffer_cover() requires about 9 bytes of memory for each input byte. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It’s possible to select smaller or larger size, just by specifyingdictBufferCapacity
. In general, it’s recommended to provide a few thousands samples, though this can vary a lot. It’s recommended that total size of all samples be about ~x100 times the target size of dictionary. - ZDICT_
train ⚠From Buffer_ fast Cover - ZDICT_trainFromBuffer_fastCover():
Train a dictionary from an array of samples using a modified version of COVER algorithm.
Samples must be stored concatenated in a single flat buffer
samplesBuffer
, supplied with an array of sizessamplesSizes
, providing the size of each sample, in order. d and k are required. All other parameters are optional, will use default values if not provided The resulting dictionary will be saved intodictBuffer
. @return: size of dictionary stored intodictBuffer
(<=dictBufferCapacity
) or an error code, which can be tested with ZDICT_isError(). See ZDICT_trainFromBuffer() for details on failure modes. Note: ZDICT_trainFromBuffer_fastCover() requires 6 * 2^f bytes of memory. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It’s possible to select smaller or larger size, just by specifyingdictBufferCapacity
. In general, it’s recommended to provide a few thousands samples, though this can vary a lot. It’s recommended that total size of all samples be about ~x100 times the target size of dictionary. - ZDICT_
train ⚠From Buffer_ legacy - ZDICT_trainFromBuffer_legacy():
Train a dictionary from an array of samples.
Samples must be stored concatenated in a single flat buffer
samplesBuffer
, supplied with an array of sizessamplesSizes
, providing the size of each sample, in order. The resulting dictionary will be saved intodictBuffer
.parameters
is optional and can be provided with values set to 0 to mean “default”. @return: size of dictionary stored intodictBuffer
(<=dictBufferCapacity
) or an error code, which can be tested with ZDICT_isError(). See ZDICT_trainFromBuffer() for details on failure modes. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It’s possible to select smaller or larger size, just by specifyingdictBufferCapacity
. In general, it’s recommended to provide a few thousands samples, though this can vary a lot. It’s recommended that total size of all samples be about ~x100 times the target size of dictionary. Note: ZDICT_trainFromBuffer_legacy() will send notifications into stderr if instructed to, using notificationLevel>0. - ZSTD_
CCtx ⚠Params_ getParameter - ZSTD_CCtxParams_getParameter() : Similar to ZSTD_CCtx_getParameter. Get the requested value of one compression parameter, selected by enum ZSTD_cParameter. @result : 0, or an error code (which can be tested with ZSTD_isError()).
- ZSTD_
CCtx ⚠Params_ init - ZSTD_CCtxParams_init() : Initializes the compression parameters of cctxParams according to compression level. All other parameters are reset to their default values.
- ZSTD_
CCtx ⚠Params_ init_ advanced - ZSTD_CCtxParams_init_advanced() : Initializes the compression and frame parameters of cctxParams according to params. All other parameters are reset to their default values.
- ZSTD_
CCtx ⚠Params_ register Sequence Producer - ZSTD_CCtxParams_registerSequenceProducer() : Same as ZSTD_registerSequenceProducer(), but operates on ZSTD_CCtx_params. This is used for accurate size estimation with ZSTD_estimateCCtxSize_usingCCtxParams(), which is needed when creating a ZSTD_CCtx with ZSTD_initStaticCCtx().
- ZSTD_
CCtx ⚠Params_ reset - ZSTD_CCtxParams_reset() : Reset params to default values.
- ZSTD_
CCtx ⚠Params_ setParameter - ZSTD_CCtxParams_setParameter() : Requires v1.4.0+ Similar to ZSTD_CCtx_setParameter. Set one compression parameter, selected by enum ZSTD_cParameter. Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_setParametersUsingCCtxParams(). @result : a code representing success or failure (which can be tested with ZSTD_isError()).
- ZSTD_
CCtx_ ⚠getParameter - ZSTD_CCtx_getParameter() : Get the requested compression parameter value, selected by enum ZSTD_cParameter, and store it into int* value. @return : 0, or an error code (which can be tested with ZSTD_isError()).
- ZSTD_
CCtx_ ⚠load Dictionary - ZSTD_CCtx_loadDictionary() : Requires v1.4.0+
Create an internal CDict from
dict
buffer. Decompression will have to use same dictionary. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary, meaning “return to no-dictionary mode”. Note 1 : Dictionary is sticky, it will be used for all future compressed frames, until parameters are reset, a new dictionary is loaded, or the dictionary is explicitly invalidated by loading a NULL dictionary. Note 2 : Loading a dictionary involves building tables. It’s also a CPU consuming operation, with non-negligible impact on latency. Tables are dependent on compression parameters, and for this reason, compression parameters can no longer be changed after loading a dictionary. Note 3 :dict
content will be copied internally. Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead. In such a case, dictionary buffer must outlive its users. Note 4 : Use ZSTD_CCtx_loadDictionary_advanced() to precisely select how dictionary content must be interpreted. Note 5 : This method does not benefit from LDM (long distance mode). If you want to employ LDM on some large dictionary content, prefer employing ZSTD_CCtx_refPrefix() described below. - ZSTD_
CCtx_ ⚠load Dictionary_ advanced - ZSTD_CCtx_loadDictionary_advanced() : Same as ZSTD_CCtx_loadDictionary(), but gives finer control over how to load the dictionary (by copy ? by reference ?) and how to interpret it (automatic ? force raw mode ? full mode only ?)
- ZSTD_
CCtx_ ⚠load Dictionary_ byReference - ZSTD_CCtx_loadDictionary_byReference() :
Same as ZSTD_CCtx_loadDictionary(), but dictionary content is referenced, instead of being copied into CCtx.
It saves some memory, but also requires that
dict
outlives its usage withincctx
- ZSTD_
CCtx_ ⚠refC Dict - ZSTD_CCtx_refCDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used for all future compressed frames. Note that compression parameters are enforced from within CDict, and supersede any compression parameter previously set within CCtx. The parameters ignored are labelled as “superseded-by-cdict” in the ZSTD_cParameter enum docs. The ignored parameters will be used again if the CCtx is returned to no-dictionary mode. The dictionary will remain valid for future compressed frames using same CCtx. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Referencing a NULL CDict means “return to no-dictionary mode”. Note 1 : Currently, only one dictionary can be managed. Referencing a new dictionary effectively “discards” any previous one. Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx.
- ZSTD_
CCtx_ ⚠refPrefix - ZSTD_CCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) for next compressed frame. A prefix is only used once. Tables are discarded at end of frame (ZSTD_e_end). Decompression will need same prefix to properly regenerate data. Compressing with a prefix is similar in outcome as performing a diff and compressing it, but performs much faster, especially during decompression (compression speed is tunable with compression level). This method is compatible with LDM (long distance mode). @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary Note 1 : Prefix buffer is referenced. It must outlive compression. Its content must remain unmodified during compression. Note 2 : If the intention is to diff some large src data blob with some prior version of itself, ensure that the window size is large enough to contain the entire source. See ZSTD_c_windowLog. Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters. It’s a CPU consuming operation, with non-negligible impact on latency. If there is a need to use the same prefix multiple times, consider loadDictionary instead. Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent). Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation.
- ZSTD_
CCtx_ ⚠refPrefix_ advanced - ZSTD_CCtx_refPrefix_advanced() : Same as ZSTD_CCtx_refPrefix(), but gives finer control over how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)
- ZSTD_
CCtx_ ⚠refThread Pool - ZSTD_
CCtx_ ⚠reset - ZSTD_CCtx_reset() : There are 2 different things that can be reset, independently or jointly :
- ZSTD_
CCtx_ ⚠setC Params - ZSTD_CCtx_setCParams() : Set all parameters provided within @p cparams into the working @p cctx. Note : if modifying parameters during compression (MT mode only), note that changes to the .windowLog parameter will be ignored. @return 0 on success, or an error code (can be checked with ZSTD_isError()). On failure, no parameters are updated.
- ZSTD_
CCtx_ ⚠setF Params - ZSTD_CCtx_setFParams() : Set all parameters provided within @p fparams into the working @p cctx. @return 0 on success, or an error code (can be checked with ZSTD_isError()).
- ZSTD_
CCtx_ ⚠setParameter - ZSTD_CCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_cParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is generally only possible during frame initialization (before starting compression). Exception : when using multi-threading mode (nbWorkers >= 1), the following parameters can be updated during compression (within same frame): => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy. new parameters will be active for next job only (after a flush()). @return : an error code (which can be tested using ZSTD_isError()).
- ZSTD_
CCtx_ ⚠setParameters UsingC CtxParams - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply a set of ZSTD_CCtx_params to the compression context. This can be done even after compression is started, if nbWorkers==0, this will have no impact until a new compression is started. if nbWorkers>=1, new parameters will be picked up at next job, with a few restrictions (windowLog, pledgedSrcSize, nbWorkers, jobSize, and overlapLog are not updated).
- ZSTD_
CCtx_ ⚠setParams - ZSTD_CCtx_setParams() : Set all parameters provided within @p params into the working @p cctx. @return 0 on success, or an error code (can be checked with ZSTD_isError()).
- ZSTD_
CCtx_ ⚠setPledged SrcSize - ZSTD_CCtx_setPledgedSrcSize() : Total input data size to be compressed as a single frame. Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag. This value will also be controlled at end of frame, and trigger an error if not respected. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame. In order to mean “unknown content size”, pass constant ZSTD_CONTENTSIZE_UNKNOWN. ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame. Note 2 : pledgedSrcSize is only valid once, for the next frame. It’s discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN. Note 3 : Whenever all input data is provided and consumed in a single round, for example with ZSTD_compress2(), or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end), this value is automatically overridden by srcSize instead.
- ZSTD_
CStream ⚠InSize - ZSTD_
CStream ⚠OutSize - ZSTD_
DCtx_ ⚠getParameter - ZSTD_DCtx_getParameter() : Get the requested decompression parameter value, selected by enum ZSTD_dParameter, and store it into int* value. @return : 0, or an error code (which can be tested with ZSTD_isError()).
- ZSTD_
DCtx_ ⚠load Dictionary - ZSTD_DCtx_loadDictionary() : Requires v1.4.0+
Create an internal DDict from dict buffer, to be used to decompress all future frames.
The dictionary remains valid for all future frames, until explicitly invalidated, or
a new dictionary is loaded.
@result : 0, or an error code (which can be tested with ZSTD_isError()).
Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,
meaning “return to no-dictionary mode”.
Note 1 : Loading a dictionary involves building tables,
which has a non-negligible impact on CPU usage and latency.
It’s recommended to “load once, use many times”, to amortize the cost
Note 2 :
dict
content will be copied internally, sodict
can be released after loading. Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead. Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of how dictionary content is loaded and interpreted. - ZSTD_
DCtx_ ⚠load Dictionary_ advanced - ZSTD_DCtx_loadDictionary_advanced() : Same as ZSTD_DCtx_loadDictionary(), but gives direct control over how to load the dictionary (by copy ? by reference ?) and how to interpret it (automatic ? force raw mode ? full mode only ?).
- ZSTD_
DCtx_ ⚠load Dictionary_ byReference - ZSTD_DCtx_loadDictionary_byReference() :
Same as ZSTD_DCtx_loadDictionary(),
but references
dict
content instead of copying it intodctx
. This saves memory ifdict
remains around., However, it’s imperative thatdict
remains accessible (and unmodified) while being used, so it must outlive decompression. - ZSTD_
DCtx_ ⚠refD Dict - ZSTD_DCtx_refDDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used to decompress next frames. The dictionary remains active for decompression of future frames using same DCtx.
- ZSTD_
DCtx_ ⚠refPrefix - ZSTD_DCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) to decompress next frame. This is the reverse operation of ZSTD_CCtx_refPrefix(), and must use the same prefix as the one used during compression. Prefix is only used once. Reference is discarded at end of frame. End of frame is reached when ZSTD_decompressStream() returns 0. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary Note 2 : Prefix buffer is referenced. It must outlive decompression. Prefix buffer must remain unmodified up to the end of frame, reached when ZSTD_decompressStream() returns 0. Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent). Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section) Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. A full dictionary is more costly, as it requires building tables.
- ZSTD_
DCtx_ ⚠refPrefix_ advanced - ZSTD_DCtx_refPrefix_advanced() : Same as ZSTD_DCtx_refPrefix(), but gives finer control over how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)
- ZSTD_
DCtx_ ⚠reset - ZSTD_DCtx_reset() : Return a DCtx to clean state. Session and parameters can be reset jointly or separately. Parameters can only be reset when no active frame is being decompressed. @return : 0, or an error code, which can be tested with ZSTD_isError()
- ZSTD_
DCtx_ ⚠setFormat - ZSTD_DCtx_setFormat() : This function is REDUNDANT. Prefer ZSTD_DCtx_setParameter(). Instruct the decoder context about what kind of data to decode next. This instruction is mandatory to decode data without a fully-formed header, such ZSTD_f_zstd1_magicless for example. @return : 0, or an error code (which can be tested using ZSTD_isError()).
- ZSTD_
DCtx_ ⚠setMax Window Size - ZSTD_DCtx_setMaxWindowSize() : Refuses allocating internal buffers for frames requiring a window size larger than provided limit. This protects a decoder context from reserving too much memory for itself (potential attack scenario). This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode. By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) @return : 0, or an error code (which can be tested using ZSTD_isError()).
- ZSTD_
DCtx_ ⚠setParameter - ZSTD_DCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_dParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is only possible during frame initialization (before starting decompression). @return : 0, or an error code (which can be tested using ZSTD_isError()).
- ZSTD_
DStream ⚠InSize - ZSTD_
DStream ⚠OutSize - ZSTD_
adjustC ⚠Params - ZSTD_adjustCParams() :
optimize params for a given
srcSize
anddictSize
.srcSize
can be unknown, in which case use ZSTD_CONTENTSIZE_UNKNOWN.dictSize
must be0
when there is no dictionary. cPar can be invalid : all parameters will be clamped within valid range in the @return struct. This function never fails (wide contract) - ZSTD_
cParam_ ⚠getBounds - ZSTD_cParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains - an error status field, which must be tested using ZSTD_isError() - lower and upper bounds, both inclusive
- ZSTD_
checkC ⚠Params - ZSTD_checkCParams() : Ensure param values remain within authorized range. @return 0 on success, or an error code (can be checked with ZSTD_isError())
- ZSTD_
compress ⚠ - Simple API
/
/*! ZSTD_compress() :
Compresses
src
content as a single zstd compressed frame into already allocateddst
. NOTE: ProvidingdstCapacity >= ZSTD_compressBound(srcSize)
guarantees that zstd will have enough space to successfully compress the data. @return : compressed size written intodst
(<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()). - ZSTD_
compress2 ⚠ - ZSTD_compress2() : Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API. (note that this entry point doesn’t even expose a compression level parameter). ZSTD_compress2() always starts a new frame. Should cctx hold data from a previously unfinished frame, everything about it is forgotten.
- ZSTD_
compress ⚠Begin - Buffer-less streaming compression (synchronous mode)
- ZSTD_
compress ⚠Begin_ advanced - ZSTD_
compress ⚠Begin_ usingC Dict - ZSTD_
compress ⚠Begin_ usingC Dict_ advanced - ZSTD_
compress ⚠Begin_ using Dict - ZSTD_
compress ⚠Block - ZSTD_
compress ⚠Bound - ZSTD_
compressC ⚠Ctx - ZSTD_compressCCtx() :
Same as ZSTD_compress(), using an explicit ZSTD_CCtx.
Important : in order to mirror
ZSTD_compress()
behavior, this function compresses at the requested compression level, ignoring any other advanced parameter . If any advanced parameter was set using the advanced API, they will all be reset. OnlycompressionLevel
remains. - ZSTD_
compress ⚠Continue - ZSTD_
compress ⚠End - ZSTD_
compress ⚠Sequences - ZSTD_compressSequences() : Compress an array of ZSTD_Sequence, associated with @src buffer, into dst. @src contains the entire input (not just the literals). If @srcSize > sum(sequence.length), the remaining bytes are considered all literals If a dictionary is included, then the cctx should reference the dict. (see: ZSTD_CCtx_refCDict(), ZSTD_CCtx_loadDictionary(), etc.) The entire source is compressed into a single frame.
- ZSTD_
compress ⚠Stream - Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue). NOTE: The return value is different. ZSTD_compressStream() returns a hint for the next read size (if non-zero and not an error). ZSTD_compressStream2() returns the minimum nb of bytes left to flush (if non-zero and not an error).
- ZSTD_
compress ⚠Stream2 - ZSTD_compressStream2() : Requires v1.4.0+ Behaves about the same as ZSTD_compressStream, with additional control on end directive.
- ZSTD_
compress ⚠Stream2_ simple Args - ZSTD_compressStream2_simpleArgs() : Same as ZSTD_compressStream2(), but using only integral types as arguments. This variant might be helpful for binders from dynamic languages which have troubles handling structures containing memory pointers.
- ZSTD_
compress_ ⚠advanced - ZSTD_compress_advanced() : Note : this function is now DEPRECATED. It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters. This prototype will generate compilation warnings.
- ZSTD_
compress_ ⚠usingC Dict - ZSTD_compress_usingCDict() : Compression using a digested Dictionary. Recommended when same dictionary is used multiple times. Note : compression level is decided at dictionary creation time, and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)
- ZSTD_
compress_ ⚠usingC Dict_ advanced - ZSTD_compress_usingCDict_advanced() : Note : this function is now DEPRECATED. It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters. This prototype will generate compilation warnings.
- ZSTD_
compress_ ⚠using Dict - Simple dictionary API
/
/*! ZSTD_compress_usingDict() :
Compression at an explicit compression level using a Dictionary.
A dictionary can be any arbitrary data segment (also called a prefix),
or a buffer with specified information (see zdict.h).
Note : This function loads the dictionary, resulting in significant startup delay.
It’s intended for a dictionary used only once.
Note 2 : When
dict == NULL || dictSize < 8
no dictionary is used. - ZSTD_
copyC ⚠Ctx - ZSTD_
copyD ⚠Ctx - ZSTD_
createC ⚠Ctx - ZSTD_
createC ⚠CtxParams - ZSTD_CCtx_params : Quick howto :
- ZSTD_
createC ⚠Ctx_ advanced - ZSTD_
createC ⚠Dict - ZSTD_createCDict() :
When compressing multiple messages or blocks using the same dictionary,
it’s recommended to digest the dictionary only once, since it’s a costly operation.
ZSTD_createCDict() will create a state from digesting a dictionary.
The resulting state can be used for future compression operations with very limited startup cost.
ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only.
@dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict.
Note 1 : Consider experimental function
ZSTD_createCDict_byReference()
if you prefer to not duplicate @dictBuffer content. Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer, in which case the only thing that it transports is the @compressionLevel. This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively, expecting a ZSTD_CDict parameter with any data, including those without a known dictionary. - ZSTD_
createC ⚠Dict_ advanced - ZSTD_
createC ⚠Dict_ advanced2 - ZSTD_
createC ⚠Dict_ byReference - ZSTD_createCDict_byReference() :
Create a digested dictionary for compression
Dictionary content is just referenced, not duplicated.
As a consequence,
dictBuffer
must outlive CDict, and its content must remain unmodified throughout the lifetime of CDict. note: equivalent to ZSTD_createCDict_advanced(), with dictLoadMethod==ZSTD_dlm_byRef - ZSTD_
createC ⚠Stream - ZSTD_
createC ⚠Stream_ advanced - ZSTD_
createD ⚠Ctx - ZSTD_
createD ⚠Ctx_ advanced - ZSTD_
createD ⚠Dict - ZSTD_createDDict() : Create a digested dictionary, ready to start decompression operation without startup delay. dictBuffer can be released after DDict creation, as its content is copied inside DDict.
- ZSTD_
createD ⚠Dict_ advanced - ZSTD_
createD ⚠Dict_ byReference - ZSTD_createDDict_byReference() : Create a digested dictionary, ready to start decompression operation without startup delay. Dictionary content is referenced, and therefore stays in dictBuffer. It is important that dictBuffer outlives DDict, it must remain read accessible throughout the lifetime of DDict
- ZSTD_
createD ⚠Stream - ZSTD_
createD ⚠Stream_ advanced - ZSTD_
create ⚠Thread Pool - ZSTD_
dParam_ ⚠getBounds - ZSTD_dParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains - an error status field, which must be tested using ZSTD_isError() - both lower and upper bounds, inclusive
- ZSTD_
decoding ⚠Buffer Size_ min - Buffer-less streaming decompression (synchronous mode)
- ZSTD_
decompress ⚠ - ZSTD_decompress() :
compressedSize
: must be the exact size of some number of compressed and/or skippable frames.dstCapacity
is an upper bound of originalSize to regenerate. If user cannot imply a maximum upper bound, it’s better to use streaming mode to decompress data. @return : the number of bytes decompressed intodst
(<=dstCapacity
), or an errorCode if it fails (which can be tested using ZSTD_isError()). - ZSTD_
decompress ⚠Begin - ZSTD_
decompress ⚠Begin_ usingD Dict - ZSTD_
decompress ⚠Begin_ using Dict - ZSTD_
decompress ⚠Block - ZSTD_
decompress ⚠Bound - ZSTD_decompressBound() :
src
should point to the start of a series of ZSTD encoded and/or skippable framessrcSize
must be the exact size of this series (i.e. there should be a frame boundary atsrc + srcSize
) @return : - upper-bound for the decompressed size of all data in all successive frames - if an error occurred: ZSTD_CONTENTSIZE_ERROR - ZSTD_
decompress ⚠Continue - ZSTD_
decompressD ⚠Ctx - ZSTD_decompressDCtx() : Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx. Compatible with sticky parameters (see below).
- ZSTD_
decompress ⚠Stream - ZSTD_decompressStream() :
Streaming decompression function.
Call repetitively to consume full input updating it as necessary.
Function will update both input and output
pos
fields exposing current state via these fields: - ZSTD_
decompress ⚠Stream_ simple Args - ZSTD_decompressStream_simpleArgs() : Same as ZSTD_decompressStream(), but using only integral types as arguments. This can be helpful for binders from dynamic languages which have troubles handling structures containing memory pointers.
- ZSTD_
decompress_ ⚠usingD Dict - ZSTD_decompress_usingDDict() : Decompression using a digested Dictionary. Recommended when same dictionary is used multiple times.
- ZSTD_
decompress_ ⚠using Dict - ZSTD_decompress_usingDict() :
Decompression using a known Dictionary.
Dictionary must be identical to the one used during compression.
Note : This function loads the dictionary, resulting in significant startup delay.
It’s intended for a dictionary used only once.
Note : When
dict == NULL || dictSize < 8
no dictionary is used. - ZSTD_
decompression ⚠Margin - ZSTD_decompressionMargin() : Zstd supports in-place decompression, where the input and output buffers overlap. In this case, the output buffer must be at least (Margin + Output_Size) bytes large, and the input buffer must be at the end of the output buffer.
- ZSTD_
defaultC ⚠Level - ZSTD_
endStream ⚠ - Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).
- ZSTD_
estimateC ⚠CtxSize - ZSTD_estimate*() : These functions make it possible to estimate memory usage of a future {D,C}Ctx, before its creation. This is useful in combination with ZSTD_initStatic(), which makes it possible to employ a static buffer for ZSTD_CCtx* state.
- ZSTD_
estimateC ⚠CtxSize_ usingC CtxParams - ZSTD_
estimateC ⚠CtxSize_ usingC Params - ZSTD_
estimateC ⚠Dict Size - ZSTD_estimate?DictSize() :
ZSTD_estimateCDictSize() will bet that src size is relatively “small”, and content is copied, like ZSTD_createCDict().
ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced().
Note : dictionaries created by reference (
ZSTD_dlm_byRef
) are logically smaller. - ZSTD_
estimateC ⚠Dict Size_ advanced - ZSTD_
estimateC ⚠Stream Size - ZSTD_estimateCStreamSize() : ZSTD_estimateCStreamSize() will provide a memory budget large enough for streaming compression using any compression level up to the max specified one. It will also consider src size to be arbitrarily “large”, which is a worst case scenario. If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation. ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_c_nbWorkers is >= 1. Note : CStream size estimation is only correct for single-threaded compression. ZSTD_estimateCStreamSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1. Note 2 : ZSTD_estimateCStreamSize* functions are not compatible with the Block-Level Sequence Producer API at this time. Size estimates assume that no external sequence producer is registered.
- ZSTD_
estimateC ⚠Stream Size_ usingC CtxParams - ZSTD_
estimateC ⚠Stream Size_ usingC Params - ZSTD_
estimateD ⚠CtxSize - ZSTD_
estimateD ⚠Dict Size - ZSTD_
estimateD ⚠Stream Size - ZSTD_
estimateD ⚠Stream Size_ from Frame - ZSTD_
find ⚠Decompressed Size - ZSTD_findDecompressedSize() :
src
should point to the start of a series of ZSTD encoded and/or skippable framessrcSize
must be the exact size of this series (i.e. there should be a frame boundary atsrc + srcSize
) @return : - decompressed size of all data in all successive frames - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN - if an error occurred: ZSTD_CONTENTSIZE_ERROR - ZSTD_
find ⚠Frame Compressed Size - ZSTD_findFrameCompressedSize() : Requires v1.4.0+
src
should point to the start of a ZSTD frame or skippable frame.srcSize
must be >= first frame size @return : the compressed size of the first frame starting atsrc
, suitable to pass assrcSize
toZSTD_decompress
or similar, or an error code if input is invalid - ZSTD_
flush ⚠Stream - Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).
- ZSTD_
frame ⚠Header Size - ZSTD_frameHeaderSize() : srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX. @return : size of the Frame Header, or an error code (if srcSize is too small)
- ZSTD_
freeC ⚠Ctx - ZSTD_
freeC ⚠CtxParams - ZSTD_
freeC ⚠Dict - ZSTD_freeCDict() : Function frees memory allocated by ZSTD_createCDict(). If a NULL pointer is passed, no operation is performed.
- ZSTD_
freeC ⚠Stream - ZSTD_
freeD ⚠Ctx - ZSTD_
freeD ⚠Dict - ZSTD_freeDDict() : Function frees memory allocated with ZSTD_createDDict() If a NULL pointer is passed, no operation is performed.
- ZSTD_
freeD ⚠Stream - ZSTD_
free ⚠Thread Pool - ZSTD_
generate ⚠Sequences - ZSTD_generateSequences() : WARNING: This function is meant for debugging and informational purposes ONLY! Its implementation is flawed, and it will be deleted in a future version. It is not guaranteed to succeed, as there are several cases where it will give up and fail. You should NOT use this function in production code.
- ZSTD_
getBlock ⚠Size - This API is deprecated in favor of the regular compression API. You can get the frame header down to 2 bytes by setting:
- ZSTD_
getC ⚠Params - ZSTD_getCParams() :
@return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize.
estimatedSrcSize
value is optional, select 0 if not known - ZSTD_
getDecompressed ⚠Size - ZSTD_getDecompressedSize() :
NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize().
Both functions work the same way, but ZSTD_getDecompressedSize() blends
“empty”, “unknown” and “error” results to the same return value (0),
while ZSTD_getFrameContentSize() gives them separate return values.
@return : decompressed size of
src
frame content if known and not empty, 0 otherwise. - ZSTD_
getDictID_ ⚠fromC Dict - ZSTD_getDictID_fromCDict() : Requires v1.5.0+
Provides the dictID of the dictionary loaded into
cdict
. If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. Non-conformant dictionaries can still be loaded, but as content-only dictionaries. - ZSTD_
getDictID_ ⚠fromD Dict - ZSTD_getDictID_fromDDict() : Requires v1.4.0+
Provides the dictID of the dictionary loaded into
ddict
. If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. Non-conformant dictionaries can still be loaded, but as content-only dictionaries. - ZSTD_
getDictID_ ⚠from Dict - ZSTD_getDictID_fromDict() : Requires v1.4.0+ Provides the dictID stored within dictionary. if @return == 0, the dictionary is not conformant with Zstandard specification. It can still be loaded, but as a content-only dictionary.
- ZSTD_
getDictID_ ⚠from Frame - ZSTD_getDictID_fromFrame() : Requires v1.4.0+
Provides the dictID required to decompressed the frame stored within
src
. If @return == 0, the dictID could not be decoded. This could for one of the following reasons : - ZSTD_
getError ⚠Code - ZSTD_getErrorCode() :
convert a
size_t
function result into aZSTD_ErrorCode
enum type, which can be used to compare with enum list published above - ZSTD_
getError ⚠Name - ZSTD_
getError ⚠String - ZSTD_
getFrame ⚠Content Size - ZSTD_
getFrame ⚠Header - ZSTD_getFrameHeader() :
decode Frame Header, or requires larger
srcSize
. @return : 0,zfhPtr
is correctly filled, >0,srcSize
is too small, value is wantedsrcSize
amount, or an error code, which can be tested using ZSTD_isError() - ZSTD_
getFrame ⚠Header_ advanced - ZSTD_getFrameHeader_advanced() : same as ZSTD_getFrameHeader(), with added capability to select a format (like ZSTD_f_zstd1_magicless)
- ZSTD_
getFrame ⚠Progression - ZSTD_
getParams ⚠ - ZSTD_getParams() :
same as ZSTD_getCParams(), but @return a full
ZSTD_parameters
object instead of sub-componentZSTD_compressionParameters
. All fields ofZSTD_frameParameters
are set to default : contentSize=1, checksum=0, noDictID=0 - ZSTD_
initC ⚠Stream - Equivalent to:
- ZSTD_
initC ⚠Stream_ advanced - ZSTD_initCStream_advanced() : This function is DEPRECATED, and is equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_setParams(zcs, params); ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);
- ZSTD_
initC ⚠Stream_ srcSize - ZSTD_initCStream_srcSize() : This function is DEPRECATED, and equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any) ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);
- ZSTD_
initC ⚠Stream_ usingC Dict - ZSTD_initCStream_usingCDict() : This function is DEPRECATED, and equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_refCDict(zcs, cdict);
- ZSTD_
initC ⚠Stream_ usingC Dict_ advanced - ZSTD_initCStream_usingCDict_advanced() : This function is DEPRECATED, and is equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_setFParams(zcs, fParams); ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); ZSTD_CCtx_refCDict(zcs, cdict);
- ZSTD_
initC ⚠Stream_ using Dict - ZSTD_initCStream_usingDict() : This function is DEPRECATED, and is equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);
- ZSTD_
initD ⚠Stream - ZSTD_initDStream() : Initialize/reset DStream state for new decompression operation. Call before new decompression operation using same DStream.
- ZSTD_
initD ⚠Stream_ usingD Dict - This function is deprecated, and is equivalent to:
- ZSTD_
initD ⚠Stream_ using Dict - This function is deprecated, and is equivalent to:
- ZSTD_
init ⚠StaticC Ctx - ZSTD_initStatic*() : Initialize an object using a pre-allocated fixed-size buffer. workspace: The memory area to emplace the object into. Provided pointer must be 8-bytes aligned. Buffer must outlive object. workspaceSize: Use ZSTD_estimate*Size() to determine how large workspace must be to support target scenario. @return : pointer to object (same address as workspace, just different type), or NULL if error (size too small, incorrect alignment, etc.) Note : zstd will never resize nor malloc() when using a static buffer. If the object requires more memory than available, zstd will just error out (typically ZSTD_error_memory_allocation). Note 2 : there is no corresponding “free” function. Since workspace is allocated externally, it must be freed externally too. Note 3 : cParams : use ZSTD_getCParams() to convert a compression level into its associated cParams. Limitation 1 : currently not compatible with internal dictionary creation, triggered by ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict(). Limitation 2 : static cctx currently not compatible with multi-threading. Limitation 3 : static dctx is incompatible with legacy support.
- ZSTD_
init ⚠StaticC Dict - ZSTD_
init ⚠StaticC Stream - ZSTD_
init ⚠StaticD Ctx - ZSTD_
init ⚠StaticD Dict - ZSTD_
init ⚠StaticD Stream - ZSTD_
insert ⚠Block - ZSTD_
isError ⚠ - ZSTD_
isFrame ⚠ - ZSTD_isFrame() :
Tells if the content of
buffer
starts with a valid Frame Identifier. Note : Frame Identifier is 4 bytes. Ifsize < 4
, @return will always be 0. Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled. Note 3 : Skippable Frame Identifiers are considered valid. - ZSTD_
isSkippable ⚠Frame - ZSTD_isSkippableFrame() :
Tells if the content of
buffer
starts with a valid Frame Identifier for a skippable frame. - ZSTD_
maxC ⚠Level - ZSTD_
merge ⚠Block Delimiters - ZSTD_mergeBlockDelimiters() : Given an array of ZSTD_Sequence, remove all sequences that represent block delimiters/last literals by merging them into the literals of the next sequence.
- ZSTD_
minC ⚠Level - ZSTD_
next ⚠Input Type - ZSTD_
next ⚠SrcSize ToDecompress - ZSTD_
read ⚠Skippable Frame - ZSTD_readSkippableFrame() : Retrieves a zstd skippable frame containing data given by src, and writes it to dst buffer.
- ZSTD_
register ⚠Sequence Producer - ZSTD_registerSequenceProducer() : Instruct zstd to use a block-level external sequence producer function.
- ZSTD_
resetC ⚠Stream - ZSTD_resetCStream() : This function is DEPRECATED, and is equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); Note: ZSTD_resetCStream() interprets pledgedSrcSize == 0 as ZSTD_CONTENTSIZE_UNKNOWN, but ZSTD_CCtx_setPledgedSrcSize() does not do the same, so ZSTD_CONTENTSIZE_UNKNOWN must be explicitly specified.
- ZSTD_
resetD ⚠Stream - This function is deprecated, and is equivalent to:
- ZSTD_
sequence ⚠Bound - ZSTD_sequenceBound() :
srcSize
: size of the input buffer @return : upper-bound for the number of sequences that can be generated from a buffer of srcSize bytes - ZSTD_
sizeof_ ⚠CCtx - ZSTD_sizeof_*() : Requires v1.4.0+ These functions give the current memory usage of selected object. Note that object memory usage can evolve (increase or decrease) over time.
- ZSTD_
sizeof_ ⚠CDict - ZSTD_
sizeof_ ⚠CStream - ZSTD_
sizeof_ ⚠DCtx - ZSTD_
sizeof_ ⚠DDict - ZSTD_
sizeof_ ⚠DStream - ZSTD_
toFlush ⚠Now - ZSTD_toFlushNow() : Tell how many bytes are ready to be flushed immediately. Useful for multithreading scenarios (nbWorkers >= 1). Probe the oldest active job, defined as oldest job not yet entirely flushed, and check its output buffer. @return : amount of data stored in oldest job and ready to be flushed immediately. if @return == 0, it means either :
- ZSTD_
version ⚠Number - ZSTD_versionNumber() : Return runtime library version, the value is (MAJOR100100 + MINOR*100 + RELEASE).
- ZSTD_
version ⚠String - ZSTD_versionString() : Return runtime library version, like “1.4.5”. Requires v1.3.0+.
- ZSTD_
write ⚠Skippable Frame - ZSTD_writeSkippableFrame() : Generates a zstd skippable frame containing data given by src, and writes it to dst buffer.
Type Aliases§
- ZSTD_
CCtx - Explicit context
- ZSTD_
CCtx_ params - ZSTD_
CDict - Bulk processing dictionary API
- ZSTD_
CStream - ZSTD_
DCtx - ZSTD_
DDict - ZSTD_
DStream - ZSTD_
alloc Function - Custom memory allocation : These prototypes make it possible to pass your own allocation/free functions. ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below. All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones.
- ZSTD_
free Function - ZSTD_
inBuffer - Streaming
- ZSTD_
outBuffer - ZSTD_
sequence Producer_ F - ZSTD_
thread Pool - Thread pool : These prototypes make it possible to share a thread pool among multiple compression contexts. This can limit resources for applications with multiple threads where each one uses a threaded compression mode (via ZSTD_c_nbWorkers parameter). ZSTD_createThreadPool creates a new thread pool with a given number of threads. Note that the lifetime of such pool must exist while being used. ZSTD_CCtx_refThreadPool assigns a thread pool to a context (use NULL argument value to use an internal thread pool). ZSTD_freeThreadPool frees a thread pool, accepts NULL pointer.