Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
zstd_v07.h File Reference
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  ZSTDv07_frameParams
 

Macros

#define ZSTDLIBv07_API
 
#define ZSTDv07_MAGICNUMBER   0xFD2FB527 /* v0.7 */
 

Typedefs

typedef struct ZSTDv07_DCtx_s ZSTDv07_DCtx
 
typedef struct ZSTDv07_DDict_s ZSTDv07_DDict
 
typedef struct ZBUFFv07_DCtx_s ZBUFFv07_DCtx
 

Functions

unsigned long long ZSTDv07_getDecompressedSize (const void *src, size_t srcSize)
 
ZSTDLIBv07_API size_t ZSTDv07_decompress (void *dst, size_t dstCapacity, const void *src, size_t compressedSize)
 
void ZSTDv07_findFrameSizeInfoLegacy (const void *src, size_t srcSize, size_t *cSize, unsigned long long *dBound)
 
ZSTDLIBv07_API unsigned ZSTDv07_isError (size_t code)
 
ZSTDLIBv07_API const char * ZSTDv07_getErrorName (size_t code)
 
ZSTDLIBv07_API ZSTDv07_DCtxZSTDv07_createDCtx (void)
 
ZSTDLIBv07_API size_t ZSTDv07_freeDCtx (ZSTDv07_DCtx *dctx)
 
ZSTDLIBv07_API size_t ZSTDv07_decompressDCtx (ZSTDv07_DCtx *ctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
ZSTDLIBv07_API size_t ZSTDv07_decompress_usingDict (ZSTDv07_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const void *dict, size_t dictSize)
 
ZSTDLIBv07_API ZSTDv07_DDictZSTDv07_createDDict (const void *dict, size_t dictSize)
 
ZSTDLIBv07_API size_t ZSTDv07_freeDDict (ZSTDv07_DDict *ddict)
 
ZSTDLIBv07_API size_t ZSTDv07_decompress_usingDDict (ZSTDv07_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const ZSTDv07_DDict *ddict)
 
ZSTDLIBv07_API size_t ZSTDv07_getFrameParams (ZSTDv07_frameParams *fparamsPtr, const void *src, size_t srcSize)
 
ZSTDLIBv07_API ZBUFFv07_DCtxZBUFFv07_createDCtx (void)
 
ZSTDLIBv07_API size_t ZBUFFv07_freeDCtx (ZBUFFv07_DCtx *dctx)
 
ZSTDLIBv07_API size_t ZBUFFv07_decompressInit (ZBUFFv07_DCtx *dctx)
 
ZSTDLIBv07_API size_t ZBUFFv07_decompressInitDictionary (ZBUFFv07_DCtx *dctx, const void *dict, size_t dictSize)
 
ZSTDLIBv07_API size_t ZBUFFv07_decompressContinue (ZBUFFv07_DCtx *dctx, void *dst, size_t *dstCapacityPtr, const void *src, size_t *srcSizePtr)
 
ZSTDLIBv07_API unsigned ZBUFFv07_isError (size_t errorCode)
 
ZSTDLIBv07_API const char * ZBUFFv07_getErrorName (size_t errorCode)
 
ZSTDLIBv07_API size_t ZBUFFv07_recommendedDInSize (void)
 
ZSTDLIBv07_API size_t ZBUFFv07_recommendedDOutSize (void)
 

Macro Definition Documentation

◆ ZSTDLIBv07_API

#define ZSTDLIBv07_API

ZSTDv07_DLL_EXPORT : Enable exporting of functions when building a Windows DLL

◆ ZSTDv07_MAGICNUMBER

#define ZSTDv07_MAGICNUMBER   0xFD2FB527 /* v0.7 */

Typedef Documentation

◆ ZBUFFv07_DCtx

◆ ZSTDv07_DCtx

typedef struct ZSTDv07_DCtx_s ZSTDv07_DCtx

Decompression context

◆ ZSTDv07_DDict

ZSTDv07_createDDict() : Create a digested dictionary, ready to start decompression operation without startup delay. dict can be released after creation

Function Documentation

◆ ZBUFFv07_createDCtx()

ZSTDLIBv07_API ZBUFFv07_DCtx * ZBUFFv07_createDCtx ( void )

◆ ZBUFFv07_decompressContinue()

ZSTDLIBv07_API size_t ZBUFFv07_decompressContinue ( ZBUFFv07_DCtx * dctx,
void * dst,
size_t * dstCapacityPtr,
const void * src,
size_t * srcSizePtr )

◆ ZBUFFv07_decompressInit()

ZSTDLIBv07_API size_t ZBUFFv07_decompressInit ( ZBUFFv07_DCtx * dctx)

◆ ZBUFFv07_decompressInitDictionary()

ZSTDLIBv07_API size_t ZBUFFv07_decompressInitDictionary ( ZBUFFv07_DCtx * dctx,
const void * dict,
size_t dictSize )

◆ ZBUFFv07_freeDCtx()

ZSTDLIBv07_API size_t ZBUFFv07_freeDCtx ( ZBUFFv07_DCtx * dctx)

◆ ZBUFFv07_getErrorName()

ZSTDLIBv07_API const char * ZBUFFv07_getErrorName ( size_t errorCode)

◆ ZBUFFv07_isError()

ZSTDLIBv07_API unsigned ZBUFFv07_isError ( size_t errorCode)

◆ ZBUFFv07_recommendedDInSize()

ZSTDLIBv07_API size_t ZBUFFv07_recommendedDInSize ( void )

Functions below provide recommended buffer sizes for Compression or Decompression operations. These sizes are just hints, they tend to offer better latency

◆ ZBUFFv07_recommendedDOutSize()

ZSTDLIBv07_API size_t ZBUFFv07_recommendedDOutSize ( void )

◆ ZSTDv07_createDCtx()

ZSTDLIBv07_API ZSTDv07_DCtx * ZSTDv07_createDCtx ( void )

◆ ZSTDv07_createDDict()

ZSTDLIBv07_API ZSTDv07_DDict * ZSTDv07_createDDict ( const void * dict,
size_t dictSize )

ZSTDv07_createDDict() : Create a digested dictionary, ready to start decompression without startup delay. dict can be released after ZSTDv07_DDict creation

◆ ZSTDv07_decompress()

ZSTDLIBv07_API size_t ZSTDv07_decompress ( void * dst,
size_t dstCapacity,
const void * src,
size_t compressedSize )

ZSTDv07_decompress() : compressedSize : must be exact size of compressed input, otherwise decompression will fail. dstCapacity must be equal or larger than originalSize.

Returns
: the number of bytes decompressed into dst (<= dstCapacity), or an errorCode if it fails (which can be tested using ZSTDv07_isError())

◆ ZSTDv07_decompress_usingDDict()

ZSTDLIBv07_API size_t ZSTDv07_decompress_usingDDict ( ZSTDv07_DCtx * dctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
const ZSTDv07_DDict * ddict )

ZSTDv07_decompress_usingDDict() : Decompression using a pre-digested Dictionary Faster startup than ZSTDv07_decompress_usingDict(), recommended when same dictionary is used multiple times.

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

◆ ZSTDv07_decompress_usingDict()

ZSTDLIBv07_API size_t ZSTDv07_decompress_usingDict ( ZSTDv07_DCtx * dctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
const void * dict,
size_t dictSize )

ZSTDv07_decompress_usingDict() : Decompression using a pre-defined Dictionary content (see dictBuilder). Dictionary must be identical to the one used during compression. Note : This function load the dictionary, resulting in a significant startup time

◆ ZSTDv07_decompressDCtx()

ZSTDLIBv07_API size_t ZSTDv07_decompressDCtx ( ZSTDv07_DCtx * ctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

ZSTDv07_decompressDCtx() : Same as ZSTDv07_decompress(), requires an allocated ZSTDv07_DCtx (see ZSTDv07_createDCtx())

◆ ZSTDv07_findFrameSizeInfoLegacy()

void ZSTDv07_findFrameSizeInfoLegacy ( const void * src,
size_t srcSize,
size_t * cSize,
unsigned long long * dBound )

ZSTDv07_findFrameSizeInfoLegacy() : get the source length and decompressed bound of a ZSTD frame compliant with v0.7.x format srcSize : The size of the 'src' buffer, at least as large as the frame pointed to by 'src' cSize (output parameter) : the number of bytes that would be read to decompress this frame or an error code if it fails (which can be tested using ZSTDv01_isError()) dBound (output parameter) : an upper-bound for the decompressed size of the data in the frame or ZSTD_CONTENTSIZE_ERROR if an error occurs

note : assumes cSize and dBound are not NULL.

◆ ZSTDv07_freeDCtx()

ZSTDLIBv07_API size_t ZSTDv07_freeDCtx ( ZSTDv07_DCtx * dctx)
Returns
: errorCode

◆ ZSTDv07_freeDDict()

ZSTDLIBv07_API size_t ZSTDv07_freeDDict ( ZSTDv07_DDict * ddict)

◆ ZSTDv07_getDecompressedSize()

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

ZSTDv07_getDecompressedSize() :

Returns
: decompressed size if known, 0 otherwise. note 1 : if 0, follow up with ZSTDv07_getFrameParams() to know precise failure cause. note 2 : decompressed size could be wrong or intentionally modified ! always ensure results fit within application's authorized limits

ZSTDv07_getDecompressedSize() : compatible with legacy mode

Returns
: decompressed size if known, 0 otherwise note : 0 can mean any of the following :
  • decompressed size is not provided within frame header
  • frame header unknown / not supported
  • frame header not completely provided (srcSize too small)

◆ ZSTDv07_getErrorName()

ZSTDLIBv07_API const char * ZSTDv07_getErrorName ( size_t code)

provides readable string from an error code

ZSTDv07_getErrorName() : provides error code string from function result (useful for debugging)

◆ ZSTDv07_getFrameParams()

ZSTDLIBv07_API size_t ZSTDv07_getFrameParams ( ZSTDv07_frameParams * fparamsPtr,
const void * src,
size_t srcSize )

doesn't consume input

ZSTDv07_getFrameParams() : decode Frame Header, or require larger srcSize.

Returns
: 0, fparamsPtr is correctly filled, >0, srcSize is too small, result is expected srcSize, or an error code, which can be tested using ZSTDv07_isError()

◆ ZSTDv07_isError()

ZSTDLIBv07_API unsigned ZSTDv07_isError ( size_t code)

tells if a size_t function result is an error code

ZSTDv07_isError() : tells if a return value is an error code