GenomicDataStream
A scalable interface between data and analysis
Loading...
Searching...
No Matches
zstd.h
Go to the documentation of this file.
1
9
10#ifndef ZSTD_H_235446
11#define ZSTD_H_235446
12
13#if defined (__cplusplus)
14extern "C" {
15#endif
16
17/*====== Dependency ======*/
18#include <stddef.h> /* size_t */
19
20
21/*====== Export for Windows ======*/
26#if defined(_WIN32) && defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
27# define ZSTDLIB_API __declspec(dllexport)
28#else
29# define ZSTDLIB_API
30#endif
31
32
33/*======= Version =======*/
34#define ZSTD_VERSION_MAJOR 1
35#define ZSTD_VERSION_MINOR 1
36#define ZSTD_VERSION_RELEASE 0
37
38#define ZSTD_LIB_VERSION ZSTD_VERSION_MAJOR.ZSTD_VERSION_MINOR.ZSTD_VERSION_RELEASE
39#define ZSTD_QUOTE(str) #str
40#define ZSTD_EXPAND_AND_QUOTE(str) ZSTD_QUOTE(str)
41#define ZSTD_VERSION_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_LIB_VERSION)
42
43#define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
45
46
47/* *************************************
48* Simple API
49***************************************/
55ZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity,
56 const void* src, size_t srcSize,
57 int compressionLevel);
58
65ZSTDLIB_API size_t ZSTD_decompress( void* dst, size_t dstCapacity,
66 const void* src, size_t compressedSize);
67
84ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
85
86
87/*====== Helper functions ======*/
89ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize);
90ZSTDLIB_API unsigned ZSTD_isError(size_t code);
91ZSTDLIB_API const char* ZSTD_getErrorName(size_t code);
92
93
94/*-*************************************
95* Explicit memory management
96***************************************/
98typedef struct ZSTD_CCtx_s ZSTD_CCtx;
101
104ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel);
105
107typedef struct ZSTD_DCtx_s ZSTD_DCtx;
110
113ZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
114
115
116/*-************************
117* Simple dictionary API
118***************************/
123 void* dst, size_t dstCapacity,
124 const void* src, size_t srcSize,
125 const void* dict,size_t dictSize,
126 int compressionLevel);
127
133 void* dst, size_t dstCapacity,
134 const void* src, size_t srcSize,
135 const void* dict,size_t dictSize);
136
137
138/*-**************************
139* Fast Dictionary API
140****************************/
144typedef struct ZSTD_CDict_s ZSTD_CDict;
145ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict(const void* dict, size_t dictSize, int compressionLevel);
147
153 void* dst, size_t dstCapacity,
154 const void* src, size_t srcSize,
155 const ZSTD_CDict* cdict);
156
160typedef struct ZSTD_DDict_s ZSTD_DDict;
161ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize);
163
168 void* dst, size_t dstCapacity,
169 const void* src, size_t srcSize,
170 const ZSTD_DDict* ddict);
171
172
173/*-**************************
174* Streaming
175****************************/
176
177typedef struct ZSTD_inBuffer_s {
178 const void* src;
179 size_t size;
180 size_t pos;
182
183typedef struct ZSTD_outBuffer_s {
184 void* dst;
185 size_t size;
186 size_t pos;
188
189
190/*====== streaming compression ======*/
191
192/*-***********************************************************************
193* Streaming compression - howto
194*
195* A ZSTD_CStream object is required to track streaming operation.
196* Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.
197* ZSTD_CStream objects can be reused multiple times on consecutive compression operations.
198*
199* Start by initializing ZSTD_CStream.
200* Use ZSTD_initCStream() to start a new compression operation.
201* Use ZSTD_initCStream_usingDict() for a compression which requires a dictionary.
202*
203* Use ZSTD_compressStream() repetitively to consume input stream.
204* The function will automatically update both `pos` fields.
205* Note that it may not consume the entire input, in which case `pos < size`,
206* and it's up to the caller to present again remaining data.
207* @return : a size hint, preferred nb of bytes to use as input for next function call
208* (it's just a hint, to help latency a little, any other value will work fine)
209* (note : the size hint is guaranteed to be <= ZSTD_CStreamInSize() )
210* or an error code, which can be tested using ZSTD_isError().
211*
212* At any moment, it's possible to flush whatever data remains within buffer, using ZSTD_flushStream().
213* `output->pos` will be updated.
214* Note some content might still be left within internal buffer if `output->size` is too small.
215* @return : nb of bytes still present within internal buffer (0 if it's empty)
216* or an error code, which can be tested using ZSTD_isError().
217*
218* ZSTD_endStream() instructs to finish a frame.
219* It will perform a flush and write frame epilogue.
220* The epilogue is required for decoders to consider a frame completed.
221* Similar to ZSTD_flushStream(), it may not be able to flush the full content if `output->size` is too small.
222* In which case, call again ZSTD_endStream() to complete the flush.
223* @return : nb of bytes still present within internal buffer (0 if it's empty)
224* or an error code, which can be tested using ZSTD_isError().
225*
226* *******************************************************************/
227
228typedef struct ZSTD_CStream_s ZSTD_CStream;
231
234
235ZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
239
240
241/*====== decompression ======*/
242
243/*-***************************************************************************
244* Streaming decompression howto
245*
246* A ZSTD_DStream object is required to track streaming operations.
247* Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.
248* ZSTD_DStream objects can be re-used multiple times.
249*
250* Use ZSTD_initDStream() to start a new decompression operation,
251* or ZSTD_initDStream_usingDict() if decompression requires a dictionary.
252* @return : recommended first input size
253*
254* Use ZSTD_decompressStream() repetitively to consume your input.
255* The function will update both `pos` fields.
256* If `input.pos < input.size`, some input has not been consumed.
257* It's up to the caller to present again remaining data.
258* If `output.pos < output.size`, decoder has flushed everything it could.
259* @return : 0 when a frame is completely decoded and fully flushed,
260* an error code, which can be tested using ZSTD_isError(),
261* any other value > 0, which means there is still some work to do to complete the frame.
262* The return value is a suggested next input size (just an hint, to help latency).
263* *******************************************************************************/
264
265typedef struct ZSTD_DStream_s ZSTD_DStream;
268
271
274
275
276
277#ifdef ZSTD_STATIC_LINKING_ONLY
278
279/* ====================================================================================
280 * The definitions in this section are considered experimental.
281 * They should never be used with a dynamic library, as they may change in the future.
282 * They are provided for advanced usages.
283 * Use them only in association with static linking.
284 * ==================================================================================== */
285
286/*--- Constants ---*/
287#define ZSTD_MAGICNUMBER 0xFD2FB528 /* v0.8 */
288#define ZSTD_MAGIC_SKIPPABLE_START 0x184D2A50U
289
290#define ZSTD_WINDOWLOG_MAX_32 25
291#define ZSTD_WINDOWLOG_MAX_64 27
292#define ZSTD_WINDOWLOG_MAX ((U32)(MEM_32bits() ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64))
293#define ZSTD_WINDOWLOG_MIN 10
294#define ZSTD_HASHLOG_MAX ZSTD_WINDOWLOG_MAX
295#define ZSTD_HASHLOG_MIN 6
296#define ZSTD_CHAINLOG_MAX (ZSTD_WINDOWLOG_MAX+1)
297#define ZSTD_CHAINLOG_MIN ZSTD_HASHLOG_MIN
298#define ZSTD_HASHLOG3_MAX 17
299#define ZSTD_SEARCHLOG_MAX (ZSTD_WINDOWLOG_MAX-1)
300#define ZSTD_SEARCHLOG_MIN 1
301#define ZSTD_SEARCHLENGTH_MAX 7 /* only for ZSTD_fast, other strategies are limited to 6 */
302#define ZSTD_SEARCHLENGTH_MIN 3 /* only for ZSTD_btopt, other strategies are limited to 4 */
303#define ZSTD_TARGETLENGTH_MIN 4
304#define ZSTD_TARGETLENGTH_MAX 999
305
306#define ZSTD_FRAMEHEADERSIZE_MAX 18 /* for static allocation */
307static const size_t ZSTD_frameHeaderSize_prefix = 5;
308static const size_t ZSTD_frameHeaderSize_min = 6;
309static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
310static const size_t ZSTD_skippableHeaderSize = 8; /* magic number + skippable frame length */
311
312
313/*--- Types ---*/
314typedef enum { ZSTD_fast, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2, ZSTD_btlazy2, ZSTD_btopt } ZSTD_strategy; /* from faster to stronger */
315
316typedef struct {
317 unsigned windowLog;
318 unsigned chainLog;
319 unsigned hashLog;
320 unsigned searchLog;
321 unsigned searchLength;
322 unsigned targetLength;
323 ZSTD_strategy strategy;
324} ZSTD_compressionParameters;
325
326typedef struct {
327 unsigned contentSizeFlag;
328 unsigned checksumFlag;
329 unsigned noDictIDFlag;
330} ZSTD_frameParameters;
331
332typedef struct {
333 ZSTD_compressionParameters cParams;
334 ZSTD_frameParameters fParams;
335} ZSTD_parameters;
336
337/* custom memory allocation functions */
338typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
339typedef void (*ZSTD_freeFunction) (void* opaque, void* address);
340typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
341
342
343/*-*************************************
344* Advanced compression functions
345***************************************/
349ZSTDLIB_API size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams);
350
353ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
354
357ZSTDLIB_API size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
358
361ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
362 ZSTD_parameters params, ZSTD_customMem customMem);
363
366ZSTDLIB_API size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
367
371ZSTDLIB_API ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long srcSize, size_t dictSize);
372
376ZSTDLIB_API ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long srcSize, size_t dictSize);
377
380ZSTDLIB_API size_t ZSTD_checkCParams(ZSTD_compressionParameters params);
381
385ZSTDLIB_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);
386
389ZSTDLIB_API size_t ZSTD_compress_advanced (ZSTD_CCtx* ctx,
390 void* dst, size_t dstCapacity,
391 const void* src, size_t srcSize,
392 const void* dict,size_t dictSize,
393 ZSTD_parameters params);
394
395
396/*--- Advanced Decompression functions ---*/
397
400ZSTDLIB_API size_t ZSTD_estimateDCtxSize(void);
401
404ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
405
408ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
409
412ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
413
414
415/* ******************************************************************
416* Advanced Streaming functions
417********************************************************************/
418
419/*====== compression ======*/
420
421ZSTDLIB_API ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
422ZSTDLIB_API size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel);
423ZSTDLIB_API size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
424 ZSTD_parameters params, unsigned long long pledgedSrcSize);
425ZSTDLIB_API size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
426ZSTDLIB_API size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
427
428
429/*====== decompression ======*/
430
431typedef enum { ZSTDdsp_maxWindowSize } ZSTD_DStreamParameter_e;
432
433ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
434ZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);
435ZSTDLIB_API size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
436ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds);
437ZSTDLIB_API size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
438
439
440/* ******************************************************************
441* Buffer-less and synchronous inner streaming functions
442********************************************************************/
443/* This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
444* But it's also a complex one, with many restrictions (documented below).
445* Prefer using normal streaming API for an easier experience */
446
447ZSTDLIB_API size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
448ZSTDLIB_API size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);
449ZSTDLIB_API size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize);
450ZSTDLIB_API size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize);
451
452ZSTDLIB_API size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
453ZSTDLIB_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
454
455/*
456 A ZSTD_CCtx object is required to track streaming operations.
457 Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.
458 ZSTD_CCtx object can be re-used multiple times within successive compression operations.
459
460 Start by initializing a context.
461 Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression,
462 or ZSTD_compressBegin_advanced(), for finer parameter control.
463 It's also possible to duplicate a reference context which has already been initialized, using ZSTD_copyCCtx()
464
465 Then, consume your input using ZSTD_compressContinue().
466 There are some important considerations to keep in mind when using this advanced function :
467 - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffer only.
468 - Interface is synchronous : input is consumed entirely and produce 1+ (or more) compressed blocks.
469 - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario.
470 Worst case evaluation is provided by ZSTD_compressBound().
471 ZSTD_compressContinue() doesn't guarantee recover after a failed compression.
472 - ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog).
473 It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks)
474 - ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps.
475 In which case, it will "discard" the relevant memory section from its history.
476
477 Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum.
478 It's possible to use a NULL,0 src content, in which case, it will write a final empty block to end the frame,
479 Without last block mark, frames will be considered unfinished (broken) by decoders.
480
481 You can then reuse `ZSTD_CCtx` (ZSTD_compressBegin()) to compress some new frame.
482*/
483
484typedef struct {
485 unsigned long long frameContentSize;
486 unsigned windowSize;
487 unsigned dictID;
488 unsigned checksumFlag;
489} ZSTD_frameParams;
490
491ZSTDLIB_API size_t ZSTD_getFrameParams(ZSTD_frameParams* fparamsPtr, const void* src, size_t srcSize);
492
493ZSTDLIB_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
494ZSTDLIB_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
495ZSTDLIB_API void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
496
497ZSTDLIB_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);
498ZSTDLIB_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
499
500typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
501ZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
502
503/*
504 Buffer-less streaming decompression (synchronous mode)
505
506 A ZSTD_DCtx object is required to track streaming operations.
507 Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
508 A ZSTD_DCtx object can be re-used multiple times.
509
510 First typical operation is to retrieve frame parameters, using ZSTD_getFrameParams().
511 It fills a ZSTD_frameParams structure which provide important information to correctly decode the frame,
512 such as the minimum rolling buffer size to allocate to decompress data (`windowSize`),
513 and the dictionary ID used.
514 (Note : content size is optional, it may not be present. 0 means : content size unknown).
515 Note that these values could be wrong, either because of data malformation, or because an attacker is spoofing deliberate false information.
516 As a consequence, check that values remain within valid application range, especially `windowSize`, before allocation.
517 Each application can set its own limit, depending on local restrictions. For extended interoperability, it is recommended to support at least 8 MB.
518 Frame parameters are extracted from the beginning of the compressed frame.
519 Data fragment must be large enough to ensure successful decoding, typically `ZSTD_frameHeaderSize_max` bytes.
520 @result : 0 : successful decoding, the `ZSTD_frameParams` structure is correctly filled.
521 >0 : `srcSize` is too small, please provide at least @result bytes on next attempt.
522 errorCode, which can be tested using ZSTD_isError().
523
524 Start decompression, with ZSTD_decompressBegin() or ZSTD_decompressBegin_usingDict().
525 Alternatively, you can copy a prepared context, using ZSTD_copyDCtx().
526
527 Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively.
528 ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue().
529 ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail.
530
531 @result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity).
532 It can be zero, which is not an error; it just means ZSTD_decompressContinue() has decoded some metadata item.
533 It can also be an error code, which can be tested with ZSTD_isError().
534
535 ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize`.
536 They should preferably be located contiguously, prior to current block.
537 Alternatively, a round buffer of sufficient size is also possible. Sufficient size is determined by frame parameters.
538 ZSTD_decompressContinue() is very sensitive to contiguity,
539 if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place,
540 or that previous contiguous segment is large enough to properly handle maximum back-reference.
541
542 A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero.
543 Context can then be reset to start a new decompression.
544
545 Note : it's possible to know if next input to present is a header or a block, using ZSTD_nextInputType().
546 This information is not required to properly decode a frame.
547
548 == Special case : skippable frames ==
549
550 Skippable frames allow integration of user-defined data into a flow of concatenated frames.
551 Skippable frames will be ignored (skipped) by a decompressor. The format of skippable frames is as follows :
552 a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F
553 b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits
554 c) Frame Content - any content (User Data) of length equal to Frame Size
555 For skippable frames ZSTD_decompressContinue() always returns 0.
556 For skippable frames ZSTD_getFrameParams() returns fparamsPtr->windowLog==0 what means that a frame is skippable.
557 It also returns Frame Size as fparamsPtr->frameContentSize.
558*/
559
560
561/* **************************************
562* Block functions
563****************************************/
586
587#define ZSTD_BLOCKSIZE_ABSOLUTEMAX (128 * 1024) /* define, for static allocation */
588ZSTDLIB_API size_t ZSTD_getBlockSizeMax(ZSTD_CCtx* cctx);
589ZSTDLIB_API size_t ZSTD_compressBlock (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
590ZSTDLIB_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
591ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);
592
593
594#endif /* ZSTD_STATIC_LINKING_ONLY */
595
596#if defined (__cplusplus)
597}
598#endif
599
600#endif /* ZSTD_H_235446 */
Definition zstd.h:177
const void * src
Definition zstd.h:178
size_t size
Definition zstd.h:179
size_t pos
Definition zstd.h:180
Definition zstd.h:183
size_t size
Definition zstd.h:185
size_t pos
Definition zstd.h:186
void * dst
Definition zstd.h:184
ZSTDLIB_API size_t ZSTD_decompress(void *dst, size_t dstCapacity, const void *src, size_t compressedSize)
ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void *src, size_t srcSize)
ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize)
ZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream *zcs, int compressionLevel)
ZSTDLIB_API size_t ZSTD_decompress_usingDDict(ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const ZSTD_DDict *ddict)
ZSTDLIB_API size_t ZSTD_compress(void *dst, size_t dstCapacity, const void *src, size_t srcSize, int compressionLevel)
struct ZSTD_inBuffer_s ZSTD_inBuffer
ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream *zds)
ZSTDLIB_API size_t ZSTD_CStreamInSize(void)
ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx *dctx)
ZSTDLIB_API size_t ZSTD_DStreamOutSize(void)
ZSTDLIB_API size_t ZSTD_DStreamInSize(void)
ZSTDLIB_API size_t ZSTD_compress_usingCDict(ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const ZSTD_CDict *cdict)
ZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream *zcs, ZSTD_outBuffer *output, ZSTD_inBuffer *input)
struct ZSTD_DStream_s ZSTD_DStream
Definition zstd.h:265
ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx *cctx)
ZSTDLIB_API size_t ZSTD_compress_usingDict(ZSTD_CCtx *ctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const void *dict, size_t dictSize, int compressionLevel)
ZSTDLIB_API ZSTD_DCtx * ZSTD_createDCtx(void)
ZSTDLIB_API size_t ZSTD_freeCDict(ZSTD_CDict *CDict)
ZSTDLIB_API ZSTD_CDict * ZSTD_createCDict(const void *dict, size_t dictSize, int compressionLevel)
ZSTDLIB_API size_t ZSTD_freeCStream(ZSTD_CStream *zcs)
struct ZSTD_outBuffer_s ZSTD_outBuffer
ZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inBuffer *input)
struct ZSTD_CDict_s ZSTD_CDict
Definition zstd.h:144
ZSTDLIB_API size_t ZSTD_freeDDict(ZSTD_DDict *ddict)
struct ZSTD_CCtx_s ZSTD_CCtx
Definition zstd.h:98
struct ZSTD_DCtx_s ZSTD_DCtx
Definition zstd.h:107
#define ZSTDLIB_API
Definition zstd.h:29
ZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream *zcs, ZSTD_outBuffer *output)
ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx *ctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, int compressionLevel)
ZSTDLIB_API const char * ZSTD_getErrorName(size_t code)
ZSTDLIB_API ZSTD_DStream * ZSTD_createDStream(void)
ZSTDLIB_API 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)
ZSTDLIB_API unsigned ZSTD_isError(size_t code)
ZSTDLIB_API ZSTD_CStream * ZSTD_createCStream(void)
ZSTDLIB_API size_t ZSTD_endStream(ZSTD_CStream *zcs, ZSTD_outBuffer *output)
ZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx *ctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
ZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream *zds)
ZSTDLIB_API ZSTD_DDict * ZSTD_createDDict(const void *dict, size_t dictSize)
ZSTDLIB_API unsigned ZSTD_versionNumber(void)
struct ZSTD_DDict_s ZSTD_DDict
Definition zstd.h:160
ZSTDLIB_API size_t ZSTD_CStreamOutSize(void)
struct ZSTD_CStream_s ZSTD_CStream
Definition zstd.h:228
ZSTDLIB_API ZSTD_CCtx * ZSTD_createCCtx(void)
ZSTDLIB_API int ZSTD_maxCLevel(void)