Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
zstd_decompress.c File Reference

Macros

#define ZSTD_HEAPMODE   1
 
#define ZSTD_LEGACY_SUPPORT   0
 
#define ZSTD_MAXWINDOWSIZE_DEFAULT   (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)
 
#define ZSTD_NO_FORWARD_PROGRESS_MAX   16
 
#define FSE_STATIC_LINKING_ONLY
 
#define DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT   4
 
#define DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT
 
#define DDICT_HASHSET_TABLE_BASE_SIZE   64
 
#define DDICT_HASHSET_RESIZE_FACTOR   2
 
#define CHECK_DBOUNDS(p, v)
 

Functions

size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx *dctx)
 
size_t ZSTD_estimateDCtxSize (void)
 
ZSTD_DCtxZSTD_initStaticDCtx (void *workspace, size_t workspaceSize)
 
ZSTD_DCtxZSTD_createDCtx_advanced (ZSTD_customMem customMem)
 
ZSTD_DCtxZSTD_createDCtx (void)
 
size_t ZSTD_freeDCtx (ZSTD_DCtx *dctx)
 
void ZSTD_copyDCtx (ZSTD_DCtx *dstDCtx, const ZSTD_DCtx *srcDCtx)
 
unsigned ZSTD_isFrame (const void *buffer, size_t size)
 
unsigned ZSTD_isSkippableFrame (const void *buffer, size_t size)
 
size_t ZSTD_frameHeaderSize (const void *src, size_t srcSize)
 
size_t ZSTD_getFrameHeader_advanced (ZSTD_frameHeader *zfhPtr, const void *src, size_t srcSize, ZSTD_format_e format)
 
size_t ZSTD_getFrameHeader (ZSTD_frameHeader *zfhPtr, const void *src, size_t srcSize)
 
unsigned long long ZSTD_getFrameContentSize (const void *src, size_t srcSize)
 
size_t ZSTD_readSkippableFrame (void *dst, size_t dstCapacity, unsigned *magicVariant, const void *src, size_t srcSize)
 
unsigned long long ZSTD_findDecompressedSize (const void *src, size_t srcSize)
 
unsigned long long ZSTD_getDecompressedSize (const void *src, size_t srcSize)
 
size_t ZSTD_findFrameCompressedSize (const void *src, size_t srcSize)
 
unsigned long long ZSTD_decompressBound (const void *src, size_t srcSize)
 
size_t ZSTD_decompressionMargin (void const *src, size_t srcSize)
 
size_t ZSTD_insertBlock (ZSTD_DCtx *dctx, const void *blockStart, size_t blockSize)
 
size_t ZSTD_decompress_usingDict (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const void *dict, size_t dictSize)
 
size_t ZSTD_decompressDCtx (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_decompress (void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_nextSrcSizeToDecompress (ZSTD_DCtx *dctx)
 
ZSTD_nextInputType_e ZSTD_nextInputType (ZSTD_DCtx *dctx)
 
size_t ZSTD_decompressContinue (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_loadDEntropy (ZSTD_entropyDTables_t *entropy, const void *const dict, size_t const dictSize)
 
size_t ZSTD_decompressBegin (ZSTD_DCtx *dctx)
 
size_t ZSTD_decompressBegin_usingDict (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_decompressBegin_usingDDict (ZSTD_DCtx *dctx, const ZSTD_DDict *ddict)
 
unsigned ZSTD_getDictID_fromDict (const void *dict, size_t dictSize)
 
unsigned ZSTD_getDictID_fromFrame (const void *src, size_t srcSize)
 
size_t ZSTD_decompress_usingDDict (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const ZSTD_DDict *ddict)
 
ZSTD_DStreamZSTD_createDStream (void)
 
ZSTD_DStreamZSTD_initStaticDStream (void *workspace, size_t workspaceSize)
 
ZSTD_DStreamZSTD_createDStream_advanced (ZSTD_customMem customMem)
 
size_t ZSTD_freeDStream (ZSTD_DStream *zds)
 
size_t ZSTD_DStreamInSize (void)
 
size_t ZSTD_DStreamOutSize (void)
 
size_t ZSTD_DCtx_loadDictionary_advanced (ZSTD_DCtx *dctx, const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType)
 
size_t ZSTD_DCtx_loadDictionary_byReference (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_DCtx_loadDictionary (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_DCtx_refPrefix_advanced (ZSTD_DCtx *dctx, const void *prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType)
 
size_t ZSTD_DCtx_refPrefix (ZSTD_DCtx *dctx, const void *prefix, size_t prefixSize)
 
size_t ZSTD_initDStream_usingDict (ZSTD_DStream *zds, const void *dict, size_t dictSize)
 
size_t ZSTD_initDStream (ZSTD_DStream *zds)
 
size_t ZSTD_initDStream_usingDDict (ZSTD_DStream *dctx, const ZSTD_DDict *ddict)
 
size_t ZSTD_resetDStream (ZSTD_DStream *dctx)
 
size_t ZSTD_DCtx_refDDict (ZSTD_DCtx *dctx, const ZSTD_DDict *ddict)
 
size_t ZSTD_DCtx_setMaxWindowSize (ZSTD_DCtx *dctx, size_t maxWindowSize)
 
size_t ZSTD_DCtx_setFormat (ZSTD_DCtx *dctx, ZSTD_format_e format)
 
ZSTD_bounds ZSTD_dParam_getBounds (ZSTD_dParameter dParam)
 
size_t ZSTD_DCtx_getParameter (ZSTD_DCtx *dctx, ZSTD_dParameter param, int *value)
 
size_t ZSTD_DCtx_setParameter (ZSTD_DCtx *dctx, ZSTD_dParameter dParam, int value)
 
size_t ZSTD_DCtx_reset (ZSTD_DCtx *dctx, ZSTD_ResetDirective reset)
 
size_t ZSTD_sizeof_DStream (const ZSTD_DStream *dctx)
 
size_t ZSTD_decodingBufferSize_min (unsigned long long windowSize, unsigned long long frameContentSize)
 
size_t ZSTD_estimateDStreamSize (size_t windowSize)
 
size_t ZSTD_estimateDStreamSize_fromFrame (const void *src, size_t srcSize)
 
size_t ZSTD_decompressStream (ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inBuffer *input)
 
size_t ZSTD_decompressStream_simpleArgs (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, size_t *dstPos, const void *src, size_t srcSize, size_t *srcPos)
 

Macro Definition Documentation

◆ CHECK_DBOUNDS

#define CHECK_DBOUNDS ( p,
v )
Value:
{ \
RETURN_ERROR_IF(!ZSTD_dParam_withinBounds(p, v), parameter_outOfBound, ""); \
}

◆ DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT

#define DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT   4

◆ DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT

#define DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT
Value:
3 /* These two constants represent SIZE_MULT/COUNT_MULT load factor without using a float.
* Currently, that means a 0.75 load factor.
* So, if count * COUNT_MULT / size * SIZE_MULT != 0, then we've exceeded
* the load factor of the ddict hash set.
*/

◆ DDICT_HASHSET_RESIZE_FACTOR

#define DDICT_HASHSET_RESIZE_FACTOR   2

◆ DDICT_HASHSET_TABLE_BASE_SIZE

#define DDICT_HASHSET_TABLE_BASE_SIZE   64

◆ FSE_STATIC_LINKING_ONLY

#define FSE_STATIC_LINKING_ONLY

◆ ZSTD_HEAPMODE

#define ZSTD_HEAPMODE   1

HEAPMODE : Select how default decompression function ZSTD_decompress() allocates its context, on stack (0), or into heap (1, default; requires malloc()). Note that functions with explicit context such as ZSTD_decompressDCtx() are unaffected.

◆ ZSTD_LEGACY_SUPPORT

#define ZSTD_LEGACY_SUPPORT   0

LEGACY_SUPPORT : if set to 1+, ZSTD_decompress() can decode older formats (v0.1+)

◆ ZSTD_MAXWINDOWSIZE_DEFAULT

#define ZSTD_MAXWINDOWSIZE_DEFAULT   (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)

MAXWINDOWSIZE_DEFAULT : maximum window size accepted by DStream by default. Frames requiring more memory will be rejected. It's possible to set a different limit using ZSTD_DCtx_setMaxWindowSize().

◆ ZSTD_NO_FORWARD_PROGRESS_MAX

#define ZSTD_NO_FORWARD_PROGRESS_MAX   16

NO_FORWARD_PROGRESS_MAX : maximum allowed nb of calls to ZSTD_decompressStream() without any forward progress (defined as: no byte read from input, and no byte flushed to output) before triggering an error.

Function Documentation

◆ ZSTD_copyDCtx()

void ZSTD_copyDCtx ( ZSTD_DCtx * dstDCtx,
const ZSTD_DCtx * srcDCtx )

◆ ZSTD_createDCtx()

ZSTD_DCtx * ZSTD_createDCtx ( void )

◆ ZSTD_createDCtx_advanced()

ZSTD_DCtx * ZSTD_createDCtx_advanced ( ZSTD_customMem customMem)

◆ ZSTD_createDStream()

ZSTD_DStream * ZSTD_createDStream ( void )

◆ ZSTD_createDStream_advanced()

ZSTD_DStream * ZSTD_createDStream_advanced ( ZSTD_customMem customMem)

◆ ZSTD_DCtx_getParameter()

size_t ZSTD_DCtx_getParameter ( ZSTD_DCtx * dctx,
ZSTD_dParameter param,
int * value )

◆ ZSTD_DCtx_loadDictionary()

size_t ZSTD_DCtx_loadDictionary ( ZSTD_DCtx * dctx,
const void * dict,
size_t dictSize )

ZSTD_DCtx_loadDictionary() : Requires v1.4.0+ Create an internal DDict from dict buffer, to be used to decompress next frames. The dictionary remains valid for all future frames, until explicitly invalidated.

Returns
: 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, so dict 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_loadDictionary_advanced()

size_t ZSTD_DCtx_loadDictionary_advanced ( ZSTD_DCtx * dctx,
const void * dict,
size_t dictSize,
ZSTD_dictLoadMethod_e dictLoadMethod,
ZSTD_dictContentType_e dictContentType )

◆ ZSTD_DCtx_loadDictionary_byReference()

size_t ZSTD_DCtx_loadDictionary_byReference ( ZSTD_DCtx * dctx,
const void * dict,
size_t dictSize )

◆ ZSTD_DCtx_refDDict()

size_t ZSTD_DCtx_refDDict ( ZSTD_DCtx * dctx,
const ZSTD_DDict * ddict )

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.

If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function will store the DDict references in a table, and the DDict used for decompression will be determined at decompression time, as per the dict ID in the frame. The memory for the table is allocated on the first call to refDDict, and can be freed with ZSTD_freeDCtx().

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : Currently, only one dictionary can be managed. Referencing a new dictionary effectively "discards" any previous one. Special: referencing a NULL DDict means "return to no-dictionary mode". Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.

◆ ZSTD_DCtx_refPrefix()

size_t ZSTD_DCtx_refPrefix ( ZSTD_DCtx * dctx,
const void * prefix,
size_t prefixSize )

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.

Returns
: 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()

size_t ZSTD_DCtx_refPrefix_advanced ( ZSTD_DCtx * dctx,
const void * prefix,
size_t prefixSize,
ZSTD_dictContentType_e dictContentType )

◆ ZSTD_DCtx_reset()

size_t ZSTD_DCtx_reset ( ZSTD_DCtx * dctx,
ZSTD_ResetDirective 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.

Returns
: 0, or an error code, which can be tested with ZSTD_isError()

◆ ZSTD_DCtx_setFormat()

size_t ZSTD_DCtx_setFormat ( ZSTD_DCtx * dctx,
ZSTD_format_e format )

◆ ZSTD_DCtx_setMaxWindowSize()

size_t ZSTD_DCtx_setMaxWindowSize ( ZSTD_DCtx * dctx,
size_t maxWindowSize )

◆ ZSTD_DCtx_setParameter()

size_t ZSTD_DCtx_setParameter ( ZSTD_DCtx * dctx,
ZSTD_dParameter param,
int value )

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).

Returns
: 0, or an error code (which can be tested using ZSTD_isError()).

◆ ZSTD_decodingBufferSize_min()

size_t ZSTD_decodingBufferSize_min ( unsigned long long windowSize,
unsigned long long frameContentSize )

◆ ZSTD_decompress()

size_t ZSTD_decompress ( void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

Zstandard decompression functions. dst must point to a space at least as large as the reconstructed output.

For the case where the decompression library hasn't been included we add a dummy function to fake the process and stop the buffers being optimised out.

◆ ZSTD_decompress_usingDDict()

size_t ZSTD_decompress_usingDDict ( ZSTD_DCtx * dctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
const ZSTD_DDict * ddict )

ZSTD_decompress_usingDDict() : Decompression using a pre-digested Dictionary Use dictionary without significant overhead.

◆ ZSTD_decompress_usingDict()

size_t ZSTD_decompress_usingDict ( ZSTD_DCtx * dctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
const void * dict,
size_t dictSize )

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_decompressBegin()

size_t ZSTD_decompressBegin ( ZSTD_DCtx * dctx)

◆ ZSTD_decompressBegin_usingDDict()

size_t ZSTD_decompressBegin_usingDDict ( ZSTD_DCtx * dctx,
const ZSTD_DDict * ddict )

◆ ZSTD_decompressBegin_usingDict()

size_t ZSTD_decompressBegin_usingDict ( ZSTD_DCtx * dctx,
const void * dict,
size_t dictSize )

◆ ZSTD_decompressBound()

unsigned long long ZSTD_decompressBound ( const void * src,
size_t srcSize )

ZSTD_decompressBound() : compatible with legacy mode src must point to the start of a ZSTD frame or a skippeable frame srcSize must be at least as large as the frame contained

Returns
: the maximum decompressed size of the compressed source

◆ ZSTD_decompressContinue()

size_t ZSTD_decompressContinue ( ZSTD_DCtx * dctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

ZSTD_decompressContinue() : srcSize : must be the exact nb of bytes expected (see ZSTD_nextSrcSizeToDecompress())

Returns
: nb of bytes generated into dst (necessarily <= `dstCapacity) or an error code, which can be tested using ZSTD_isError()

◆ ZSTD_decompressDCtx()

size_t ZSTD_decompressDCtx ( ZSTD_DCtx * dctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

ZSTD_decompressDCtx() : Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx. Compatible with sticky parameters.

◆ ZSTD_decompressionMargin()

size_t ZSTD_decompressionMargin ( void const * src,
size_t srcSize )

◆ ZSTD_decompressStream()

size_t ZSTD_decompressStream ( ZSTD_DStream * zds,
ZSTD_outBuffer * output,
ZSTD_inBuffer * input )

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:

  • input.pos < input.size, some input remaining and caller should provide remaining input on the next call.
  • output.pos < output.size, decoder finished and flushed all remaining buffers.
  • output.pos == output.size, potentially uncflushed data present in the internal buffers, call ZSTD_decompressStream() again to flush remaining data to output. Note : with no additional input, amount of data flushed <= ZSTD_BLOCKSIZE_MAX.
Returns
: 0 when a frame is completely decoded and fully flushed, or an error code, which can be tested using ZSTD_isError(), or any other value > 0, which means there is some decoding or flushing to do to complete current frame.

◆ ZSTD_decompressStream_simpleArgs()

size_t ZSTD_decompressStream_simpleArgs ( ZSTD_DCtx * dctx,
void * dst,
size_t dstCapacity,
size_t * dstPos,
const void * src,
size_t srcSize,
size_t * srcPos )

◆ ZSTD_dParam_getBounds()

ZSTD_bounds ZSTD_dParam_getBounds ( ZSTD_dParameter dParam)

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.

Returns
: a structure, ZSTD_bounds, which contains
  • an error status field, which must be tested using ZSTD_isError()
  • both lower and upper bounds, inclusive

◆ ZSTD_DStreamInSize()

size_t ZSTD_DStreamInSize ( void )

recommended size for input buffer

◆ ZSTD_DStreamOutSize()

size_t ZSTD_DStreamOutSize ( void )

recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances.

◆ ZSTD_estimateDCtxSize()

size_t ZSTD_estimateDCtxSize ( void )

◆ ZSTD_estimateDStreamSize()

size_t ZSTD_estimateDStreamSize ( size_t windowSize)

◆ ZSTD_estimateDStreamSize_fromFrame()

size_t ZSTD_estimateDStreamSize_fromFrame ( const void * src,
size_t srcSize )

◆ ZSTD_findDecompressedSize()

unsigned long long ZSTD_findDecompressedSize ( const void * src,
size_t srcSize )

ZSTD_findDecompressedSize() : srcSize must be the exact length of some number of ZSTD compressed and/or skippable frames note: compatible with legacy mode

Returns
: decompressed size of the frames contained

◆ ZSTD_findFrameCompressedSize()

size_t ZSTD_findFrameCompressedSize ( const void * src,
size_t srcSize )

ZSTD_findFrameCompressedSize() : See docs in zstd.h Note: compatible with legacy mode

◆ ZSTD_frameHeaderSize()

size_t ZSTD_frameHeaderSize ( const void * src,
size_t srcSize )

ZSTD_frameHeaderSize() : srcSize must be >= ZSTD_frameHeaderSize_prefix.

Returns
: size of the Frame Header, or an error code (if srcSize is too small)

◆ ZSTD_freeDCtx()

size_t ZSTD_freeDCtx ( ZSTD_DCtx * dctx)

◆ ZSTD_freeDStream()

size_t ZSTD_freeDStream ( ZSTD_DStream * zds)

◆ ZSTD_getDecompressedSize()

unsigned long long ZSTD_getDecompressedSize ( const void * src,
size_t srcSize )

ZSTD_getDecompressedSize() : compatible with legacy mode

Returns
: decompressed size if known, 0 otherwise note : 0 can mean any of the following :
  • frame content is empty
  • decompressed size field is not present in frame header
  • frame header unknown / not supported
  • frame header not complete (srcSize too small)

◆ ZSTD_getDictID_fromDict()

unsigned ZSTD_getDictID_fromDict ( const void * dict,
size_t dictSize )

ZSTD_getDictID_fromDict() : Provides the dictID stored within dictionary. if

Returns
== 0, the dictionary is not conformant with Zstandard specification. It can still be loaded, but as a content-only dictionary.

◆ ZSTD_getDictID_fromFrame()

unsigned ZSTD_getDictID_fromFrame ( const void * src,
size_t srcSize )

ZSTD_getDictID_fromFrame() : Provides the dictID required to decompress frame stored within src. If

Returns
== 0, the dictID could not be decoded. This could for one of the following reasons :
  • The frame does not require a dictionary (most common case).
  • The frame was built with dictID intentionally removed. Needed dictionary is a hidden piece of information. Note : this use case also happens when using a non-conformant dictionary.
  • srcSize is too small, and as a result, frame header could not be decoded. Note : possible if srcSize < ZSTD_FRAMEHEADERSIZE_MAX.
  • This is not a Zstandard frame. When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.

◆ ZSTD_getFrameContentSize()

unsigned long long ZSTD_getFrameContentSize ( const void * src,
size_t srcSize )

ZSTD_getFrameContentSize() : compatible with legacy mode

Returns
: decompressed size of the single frame pointed to be src if known, otherwise
  • ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined
  • ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)

◆ ZSTD_getFrameHeader()

size_t ZSTD_getFrameHeader ( ZSTD_frameHeader * zfhPtr,
const void * src,
size_t srcSize )

ZSTD_getFrameHeader() : decode Frame Header, or require larger srcSize. note : this function does not consume input, it only reads it.

Returns
: 0, zfhPtr is correctly filled, >0, srcSize is too small, value is wanted srcSize amount, or an error code, which can be tested using ZSTD_isError()

◆ ZSTD_getFrameHeader_advanced()

size_t ZSTD_getFrameHeader_advanced ( ZSTD_frameHeader * zfhPtr,
const void * src,
size_t srcSize,
ZSTD_format_e format )

ZSTD_getFrameHeader_advanced() : decode Frame Header, or require larger srcSize. note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless

Returns
: 0, zfhPtr is correctly filled, >0, srcSize is too small, value is wanted srcSize amount, or an error code, which can be tested using ZSTD_isError()

◆ ZSTD_initDStream()

size_t ZSTD_initDStream ( ZSTD_DStream * zds)

ZSTD_initDStream() : Initialize/reset DStream state for new decompression operation. Call before new decompression operation using same DStream.

Note : This function is redundant with the advanced API and equivalent to: ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); ZSTD_DCtx_refDDict(zds, NULL);

◆ ZSTD_initDStream_usingDDict()

size_t ZSTD_initDStream_usingDDict ( ZSTD_DStream * dctx,
const ZSTD_DDict * ddict )

◆ ZSTD_initDStream_usingDict()

size_t ZSTD_initDStream_usingDict ( ZSTD_DStream * zds,
const void * dict,
size_t dictSize )

◆ ZSTD_initStaticDCtx()

ZSTD_DCtx * ZSTD_initStaticDCtx ( void * workspace,
size_t workspaceSize )

◆ ZSTD_initStaticDStream()

ZSTD_DStream * ZSTD_initStaticDStream ( void * workspace,
size_t workspaceSize )

◆ ZSTD_insertBlock()

size_t ZSTD_insertBlock ( ZSTD_DCtx * dctx,
const void * blockStart,
size_t blockSize )

ZSTD_insertBlock() : insert src block into dctx history. Useful to track uncompressed blocks.

◆ ZSTD_isFrame()

unsigned ZSTD_isFrame ( const void * buffer,
size_t size )

ZSTD_isFrame() : Tells if the content of buffer starts with a valid Frame Identifier. Note : Frame Identifier is 4 bytes. If size < 4,

Returns
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_isSkippableFrame()

unsigned ZSTD_isSkippableFrame ( const void * buffer,
size_t size )

ZSTD_isSkippableFrame() : Tells if the content of buffer starts with a valid Frame Identifier for a skippable frame. Note : Frame Identifier is 4 bytes. If size < 4,

Returns
will always be 0.

◆ ZSTD_loadDEntropy()

size_t ZSTD_loadDEntropy ( ZSTD_entropyDTables_t * entropy,
const void *const dict,
size_t const dictSize )

ZSTD_loadDEntropy() : dict : must point at beginning of a valid zstd dictionary.

Returns
: size of entropy tables read

◆ ZSTD_nextInputType()

ZSTD_nextInputType_e ZSTD_nextInputType ( ZSTD_DCtx * dctx)

◆ ZSTD_nextSrcSizeToDecompress()

size_t ZSTD_nextSrcSizeToDecompress ( ZSTD_DCtx * dctx)

◆ ZSTD_readSkippableFrame()

size_t ZSTD_readSkippableFrame ( void * dst,
size_t dstCapacity,
unsigned * magicVariant,
const void * src,
size_t srcSize )

ZSTD_readSkippableFrame() : Retrieves content of a skippable frame, and writes it to dst buffer.

The parameter magicVariant will receive the magicVariant that was supplied when the frame was written, i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. This can be NULL if the caller is not interested in the magicVariant.

Returns an error if destination buffer is not large enough, or if this is not a valid skippable frame.

Returns
: number of bytes written or a ZSTD error.

◆ ZSTD_resetDStream()

size_t ZSTD_resetDStream ( ZSTD_DStream * dctx)

◆ ZSTD_sizeof_DCtx()

size_t ZSTD_sizeof_DCtx ( const ZSTD_DCtx * dctx)

◆ ZSTD_sizeof_DStream()

size_t ZSTD_sizeof_DStream ( const ZSTD_DStream * dctx)