- size_t ZSTD_compress_advanced(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, const void* dict, size_t dictSize, ZSTD_parameters params)
- Brief:
This function compresses data using custom compression parameters specified in a
ZSTD_parametersstructure. It supports both single-threaded and multi-threaded compression.
Parameter
Direction
Description
cctxin, out
Explicit ZSTD compression context. When compressing many times, it is recommended to allocate the context just once and re-use it for each successive compression operation.
dstout
Destination buffer, compressed data is kept here, memory should be allocated already.
dstCapacityin
Size of buffer
dst(which must be already allocated).srcin
Source buffer, the data which you want to compress is copied/or pointed here.
srcSizein
Size of buffer
src.dictin
Dictionary buffer.
dictSizein
Size of the dictionary buffer.
paramsin
Compression parameters controlling compression level, window size, and strategy. These parameters must be initialized before calling the function.
- Returns:
Result
Description
Success
The number of bytes written into
dst(necessarily <= dstCapacity) on success.Failure
An error code on failure.