Lines Matching +full:pre +full:- +full:set
3 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
18 <li><a href="#Chapter8">Streaming compression - HowTo</a></li>
19 <li><a href="#Chapter9">Streaming decompression - HowTo</a></li>
30 <li><a href="#Chapter20">Buffer-less and synchronous inner streaming functions</a></li>
31 <li><a href="#Chapter21">Buffer-less streaming compression (synchronous mode)</a></li>
32 <li><a href="#Chapter22">Buffer-less streaming decompression (synchronous mode)</a></li>
36 <a name="Chapter1"></a><h2>Introduction</h2><pre>
38 real-time compression scenarios at zlib-level and better compression ratios.
39 The zstd compression library provides in-memory compression and decompression
43 which is currently 22. Levels >= 20, labeled `--ultra`, should be used with
49 - a single step (described as Simple API)
50 - a single step, reusing a context (described as Explicit context)
51 - unbounded multiple steps (described as Streaming compression)
55 - a single step (described as Simple dictionary API)
56 - a single step, reusing a dictionary (described as Bulk-processing
62 Advanced experimental APIs should never be used with a dynamically-linked
65 <BR></pre>
67 <a name="Chapter2"></a><h2>Version</h2><pre></pre>
69 <pre><b>unsigned ZSTD_versionNumber(void);
71 </p></pre><BR>
73 <pre><b>const char* ZSTD_versionString(void);
75 </p></pre><BR>
77 <a name="Chapter3"></a><h2>Simple API</h2><pre></pre>
79 <pre><b>size_t ZSTD_compress( void* dst, size_t dstCapacity,
86 </p></pre><BR>
88 <pre><b>size_t ZSTD_decompress( void* dst, size_t dstCapacity,
95 </p></pre><BR>
97 <pre><b>#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
98 #define ZSTD_CONTENTSIZE_ERROR (0ULL - 2)
103 @return : - decompressed size of `src` frame content, if known
104 - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined
105 … - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)
113 …note 3 : decompressed size is always present when compression is completed using single-pass funct…
115 note 4 : decompressed size can be very large (64-bits value),
120 Each application can set its own limits.
122 </p></pre><BR>
124 <pre><b>unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
130 </p></pre><BR>
132 <pre><b>size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
138 </p></pre><BR>
140 …nctions</h3><pre></pre><b><pre>#define ZSTD_COMPRESSBOUND(srcSize) ((srcSize) + ((srcSize)>>8) +…
141 …essBound(size_t srcSize); </b>/*!< maximum compressed size in worst case single-pass scenario */<b>
147 </pre></b><BR>
148 <a name="Chapter4"></a><h2>Explicit context</h2><pre></pre>
150 <h3>Compression context</h3><pre> When compressing many times,
152 and re-use it for each successive compression operation.
154 Note : re-using context is just a speed / resource optimization.
156 Note 2 : In multi-threaded environments,
159 </pre><b><pre>typedef struct ZSTD_CCtx_s ZSTD_CCtx;
162 </pre></b><BR>
163 <pre><b>size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx,
171 If any advanced parameter was set using the advanced API,
174 </p></pre><BR>
176 <h3>Decompression context</h3><pre> When decompressing many times,
178 and re-use it for each successive compression operation.
181 </pre><b><pre>typedef struct ZSTD_DCtx_s ZSTD_DCtx;
184 </pre></b><BR>
185 <pre><b>size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx,
192 </p></pre><BR>
194 <a name="Chapter5"></a><h2>Advanced compression API (Requires v1.4.0+)</h2><pre></pre>
196 <pre><b>typedef enum { ZSTD_fast=1,
208 </b></pre><BR>
209 <pre><b>typedef enum {
214 * See ZSTD_CCtx_refCDict() for more info (superseded-by-cdict). */
215 …ZSTD_c_compressionLevel=100, </b>/* Set compression parameters according to pre-defined cLevel tab…
221 … * Note 2 : setting a level does not automatically set all other compression parameters
223 * parameters which have not been manually set. The manually set
228 …ZSTD_c_windowLog=101, </b>/* Maximum allowed back-reference distance, expressed as power of 2.<…
229 * This will set a memory budget for streaming decompression,
242 ZSTD_c_chainLog=103, </b>/* Size of the multi-probe search table, as a power of 2.<b>
280 * except when expressly set to a different value.
287 * default: windowlog - 7.
298 … * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
299 … * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
309 …ZSTD_c_checksumFlag=201, </b>/* A 32-bits checksum of content is written at end of frame (default:…
312 </b>/* multi-threading parameters */<b>
313 …</b>/* These parameters are only active if multi-threading is enabled (compiled with build macro Z…
314 … * Otherwise, trying to set any other value than default (0) will be a no-op and return an error.
315 * In a situation where it's unknown if the linked library supports multi-threading or not,
325 … * Default value is `0`, aka "single-threaded mode" : no worker is spawned,
338 … * - 0 means "default" : value will be determined by the library, depending on strategy
339 * - 1 means "no overlap"
340 * - 9 means "full overlap", using a full window size.
382 </b></pre><BR>
383 <pre><b>typedef struct {
388 </b></pre><BR>
389 <pre><b>ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter cParam);
393 - an error status field, which must be tested using ZSTD_isError()
394 - lower and upper bounds, both inclusive
396 </p></pre><BR>
398 <pre><b>size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value);
399 </b><p> Set one compression parameter, selected by enum ZSTD_cParameter.
403 Exception : when using multi-threading mode (nbWorkers >= 1),
409 </p></pre><BR>
411 <pre><b>size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
426 </p></pre><BR>
428 <pre><b>typedef enum {
433 </b></pre><BR>
434 <pre><b>size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset);
436 - The session : will stop compressing current frame, and make CCtx ready to start a new one.
442 - The parameters : changes all parameters back to "default".
446 - Both : similar to resetting the session, followed by resetting parameters.
448 </p></pre><BR>
450 <pre><b>size_t ZSTD_compress2( ZSTD_CCtx* cctx,
453 </b><p> Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advan…
456 - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()
457 - The function is always blocking, returns when compression is completed.
462 </p></pre><BR>
464 <a name="Chapter6"></a><h2>Advanced decompression API (Requires v1.4.0+)</h2><pre></pre>
466 <pre><b>typedef enum {
471 …ameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.
491 </b></pre><BR>
492 <pre><b>ZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam);
496 - an error status field, which must be tested using ZSTD_isError()
497 - both lower and upper bounds, inclusive
499 </p></pre><BR>
501 <pre><b>size_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int value);
502 </b><p> Set one compression parameter, selected by enum ZSTD_dParameter.
508 </p></pre><BR>
510 <pre><b>size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset);
516 </p></pre><BR>
518 <a name="Chapter7"></a><h2>Streaming</h2><pre></pre>
520 <pre><b>typedef struct ZSTD_inBuffer_s {
525 </b></pre><BR>
526 <pre><b>typedef struct ZSTD_outBuffer_s {
531 </b></pre><BR>
532 <a name="Chapter8"></a><h2>Streaming compression - HowTo</h2><pre>
536 …It is recommended to re-use ZSTD_CStream since it will play nicer with system's memory, by re-usin…
543 it will re-use the same sticky parameters as previous compression session.
547 set more specific parameters, the pledged source size, or load a dictionary.
566 using ZSTD_compressStream2() with ZSTD_e_flush. `output->pos` will be updated.
567 …Note that, if `output->size` is too small, a single invocation with ZSTD_e_flush might not be enou…
590 <BR></pre>
592 <pre><b>typedef ZSTD_CCtx ZSTD_CStream; </b>/**< CCtx and CStream are now effectively same object …
593 </b></pre><BR>
594 <h3>ZSTD_CStream management functions</h3><pre></pre><b><pre>ZSTD_CStream* ZSTD_createCStream(void);
596 </pre></b><BR>
597 <h3>Streaming compression functions</h3><pre></pre><b><pre>typedef enum {
609 </pre></b><BR>
610 <pre><b>size_t ZSTD_compressStream2( ZSTD_CCtx* cctx,
615 - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()
616 …- Compression parameters cannot be changed once compression is started (save a list of exceptions …
617 - output->pos must be <= dstCapacity, input->pos must be <= srcSize
618 …- output->pos and input->pos will be updated. They are guaranteed to remain below their respective…
619 - endOp must be a valid directive
620 …- When nbWorkers==0 (default), function is blocking : it completes its job before returning to cal…
621 …- When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to …
624 …- Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, t…
625 - @return provides a minimum amount of data remaining to be flushed from internal buffers
630 - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),
635 </p></pre><BR>
637 <pre><b>size_t ZSTD_CStreamInSize(void); </b>/**< recommended size for input buffer */<b>
638 </b></pre><BR>
639 <pre><b>size_t ZSTD_CStreamOutSize(void); </b>/**< recommended size for output buffer. Guarantee …
640 </b></pre><BR>
641 <pre><b>size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
645 * the next read size (if non-zero and not an error). ZSTD_compressStream2()
646 * returns the minimum nb of bytes left to flush (if non-zero and not an error).
658 </p></pre><BR>
660 <a name="Chapter9"></a><h2>Streaming decompression - HowTo</h2><pre>
663 ZSTD_DStream objects can be re-used multiple times.
667 Alternatively, use advanced API to set specific properties.
684 <BR></pre>
686 <pre><b>typedef ZSTD_DCtx ZSTD_DStream; </b>/**< DCtx and DStream are now effectively same object …
687 </b></pre><BR>
688 <h3>ZSTD_DStream management functions</h3><pre></pre><b><pre>ZSTD_DStream* ZSTD_createDStream(void);
690 </pre></b><BR>
691 <h3>Streaming decompression functions</h3><pre></pre><b><pre></pre></b><BR>
692 <pre><b>size_t ZSTD_DStreamInSize(void); </b>/*!< recommended size for input buffer */<b>
693 </b></pre><BR>
694 <pre><b>size_t ZSTD_DStreamOutSize(void); </b>/*!< recommended size for output buffer. Guarantee …
695 </b></pre><BR>
696 <a name="Chapter10"></a><h2>Simple dictionary API</h2><pre></pre>
698 <pre><b>size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
709 </p></pre><BR>
711 <pre><b>size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
720 </p></pre><BR>
722 <a name="Chapter11"></a><h2>Bulk processing dictionary API</h2><pre></pre>
724 <pre><b>ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
730 …Dict can be created once and shared by multiple threads concurrently, since its usage is read-only.
737 </p></pre><BR>
739 <pre><b>size_t ZSTD_freeCDict(ZSTD_CDict* CDict);
742 </p></pre><BR>
744 <pre><b>size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
752 </p></pre><BR>
754 <pre><b>ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);
757 </p></pre><BR>
759 <pre><b>size_t ZSTD_freeDDict(ZSTD_DDict* ddict);
762 </p></pre><BR>
764 <pre><b>size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
770 </p></pre><BR>
772 <a name="Chapter12"></a><h2>Dictionary helper functions</h2><pre></pre>
774 <pre><b>unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);
777 It can still be loaded, but as a content-only dictionary.
778 </p></pre><BR>
780 <pre><b>unsigned ZSTD_getDictID_fromCDict(const ZSTD_CDict* cdict);
783 Non-conformant dictionaries can still be loaded, but as content-only dictionaries.
784 </p></pre><BR>
786 <pre><b>unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict);
789 Non-conformant dictionaries can still be loaded, but as content-only dictionaries.
790 </p></pre><BR>
792 <pre><b>unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);
796 - The frame does not require a dictionary to be decoded (most common case).
797 …- The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hid…
798 Note : this use case also happens when using a non-conformant dictionary.
799 …- `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if…
800 - This is not a Zstandard frame.
802 </p></pre><BR>
804 <a name="Chapter13"></a><h2>Advanced dictionary and prefix API (Requires v1.4.0+)</h2><pre>
808 ZSTD_reset_session_and_parameters. Prefixes are single-use.
809 <BR></pre>
811 <pre><b>size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
815 Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,
816 meaning "return to no-dictionary mode".
818 To return to "no-dictionary" situation, load a NULL dictionary (or reset parameters).
820 It's also a CPU consuming operation, with non-negligible impact on latency.
828 </p></pre><BR>
830 <pre><b>size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
833 and supersede any compression parameter previously set within CCtx.
834 The parameters ignored are labelled as "superseded-by-cdict" in the ZSTD_cParameter enum docs.
835 The ignored parameters will be used again if the CCtx is returned to no-dictionary mode.
838 Special : Referencing a NULL CDict means "return to no-dictionary mode".
842 </p></pre><BR>
844 <pre><b>size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx,
846 </b><p> Reference a prefix (single-usage dictionary) for next compressed frame.
859 It's a CPU consuming operation, with non-negligible impact on latency.
863 </p></pre><BR>
865 <pre><b>size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
870 Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,
871 meaning "return to no-dictionary mode".
873 which has a non-negligible impact on CPU usage and latency.
880 </p></pre><BR>
882 <pre><b>size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
895 Special: referencing a NULL DDict means "return to no-dictionary mode".
898 </p></pre><BR>
900 <pre><b>size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx,
902 </b><p> Reference a prefix (single-usage dictionary) to decompress next frame.
908 Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary
917 </p></pre><BR>
919 <pre><b>size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
927 </p></pre><BR>
929 <a name="Chapter14"></a><h2>experimental API (static linking only)</h2><pre>
936 <BR></pre>
938 <pre><b>typedef struct {
960 * rep == 1 --> offset == repeat_offset_1
961 * rep == 2 --> offset == repeat_offset_2
962 * rep == 3 --> offset == repeat_offset_3
964 * rep == 1 --> offset == repeat_offset_2
965 * rep == 2 --> offset == repeat_offset_3
966 * rep == 3 --> offset == repeat_offset_1 - 1
974 </b></pre><BR>
975 <pre><b>typedef struct {
984 </b></pre><BR>
985 <pre><b>typedef struct {
987 …int checksumFlag; </b>/**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame…
990 </b></pre><BR>
991 <pre><b>typedef struct {
995 </b></pre><BR>
996 <pre><b>typedef enum {
1001 </b></pre><BR>
1002 <pre><b>typedef enum {
1004 …ZSTD_dlm_byRef = 1 </b>/**< Reference dictionary content -- the dictionary buffer must outlive …
1006 </b></pre><BR>
1007 <pre><b>typedef enum {
1009 …ZSTD_f_zstd1_magicless = 1 </b>/* Variant of zstd frame format, without initial 4-bytes magic num…
1013 </b></pre><BR>
1014 <pre><b>typedef enum {
1019 </b></pre><BR>
1020 <pre><b>typedef enum {
1025 </b></pre><BR>
1026 <pre><b>typedef enum {
1034 * - The contents of the CDict can be copied into the working context. This
1036 * while operating on a single set of internal tables. This makes
1037 * the compression faster per-byte of input. However, the initial copy of
1042 * - The CDict's tables can be used in-place. In this model, compression is
1044 * tables. However, this model incurs no start-up cost (as long as the
1048 * - The CDict's tables are not used at all, and instead we use the working
1064 </b></pre><BR>
1065 <pre><b>typedef enum {
1073 </b></pre><BR>
1074 <pre><b>typedef enum {
1080 ZSTD_ps_enable = 1, </b>/* Force-enable the feature */<b>
1083 </b></pre><BR>
1084 <a name="Chapter15"></a><h2>Frame size functions</h2><pre></pre>
1086 <pre><b>ZSTDLIB_STATIC_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t src…
1090 @return : - decompressed size of all data in all successive frames
1091 - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN
1092 - if an error occurred: ZSTD_CONTENTSIZE_ERROR
1098 note 3 : decompressed size can be very large (64-bits value),
1103 Each application can set its own limits.
1107 </p></pre><BR>
1109 <pre><b>ZSTDLIB_STATIC_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize);
1113 @return : - upper-bound for the decompressed size of all data in all successive frames
1114 - if an error occurred: ZSTD_CONTENTSIZE_ERROR
1117 …note 2 : the upper-bound is exact when the decompressed size field is available in every ZSTD enc…
1119 …note 3 : when the decompressed size field isn't available, the upper-bound for that frame is calc…
1120 upper-bound = # blocks * min(128 KB, Window_Size)
1122 </p></pre><BR>
1124 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
1128 </p></pre><BR>
1130 <pre><b>typedef enum {
1134 </b></pre><BR>
1135 <pre><b></b><p> Generate sequences using ZSTD_compress2, given a source buffer.
1149 </p></pre><BR>
1151 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_mergeBlockDelimiters(ZSTD_Sequence* sequences, size_t seqsSi…
1162 </p></pre><BR>
1164 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_compressSequences(ZSTD_CCtx* const cctx, void* dst, size_t d…
1184 …- ZSTD_c_minMatch MUST be set as less than or equal to the smallest match generated by the match f…
1185 …- ZSTD_c_compressionLevel accordingly adjusts the strength of the entropy coder, as it would in ty…
1186 …- ZSTD_c_windowLog affects offset validation: this function will return an error at higher debug l…
1189 …Note: Repcodes are, as of now, always re-calculated within this function, so ZSTD_Sequence::rep is…
1194 </p></pre><BR>
1196 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_writeSkippableFrame(void* dst, size_t dstCapacity,
1200 Skippable frames begin with a a 4-byte magic number. There are 16 possible choices of magic number,
1206 …with a 4-byte unsigned int, or if the parameter magicVariant is greater than 15 (and therefore inv…
1210 </p></pre><BR>
1212 <pre><b>size_t ZSTD_readSkippableFrame(void* dst, size_t dstCapacity, unsigned* magicVariant,
1217 i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. This can be NULL if the caller is not interested
1224 </p></pre><BR>
1226 <pre><b>unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size);
1229 </p></pre><BR>
1231 <a name="Chapter16"></a><h2>Memory management</h2><pre></pre>
1233 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_estimateCCtxSize(int compressionLevel);
1244 Therefore, the estimation is only guaranteed for single-shot compressions, not streaming.
1256 Note 2 : only single-threaded compression is supported.
1259 </p></pre><BR>
1261 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_estimateCStreamSize(int compressionLevel);
1270 …ams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression …
1271 Note : CStream size estimation is only correct for single-threaded compression.
1278 </p></pre><BR>
1280 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
1287 </p></pre><BR>
1289 <pre><b>ZSTDLIB_STATIC_API ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
1291 </b><p> Initialize an object using a pre-allocated fixed-size buffer.
1293 Provided pointer *must be 8-bytes aligned*.
1308 Limitation 2 : static cctx currently not compatible with multi-threading.
1311 </p></pre><BR>
1313 <pre><b>ZSTDLIB_STATIC_API ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSi…
1314 </b></pre><BR>
1315 <pre><b>typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
1327 </p></pre><BR>
1329 <pre><b>typedef struct POOL_ctx_s ZSTD_threadPool;
1342 </p></pre><BR>
1344 <a name="Chapter17"></a><h2>Advanced compression functions</h2><pre></pre>
1346 <pre><b>ZSTDLIB_STATIC_API ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t …
1352 </p></pre><BR>
1354 <pre><b>ZSTDLIB_STATIC_API ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigne…
1357 </p></pre><BR>
1359 <pre><b>ZSTDLIB_STATIC_API ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long …
1360 </b><p> same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-comp…
1361 All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0
1362 </p></pre><BR>
1364 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_checkCParams(ZSTD_compressionParameters params);
1367 </p></pre><BR>
1369 <pre><b>ZSTDLIB_STATIC_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters…
1375 </p></pre><BR>
1377 <pre><b>ZSTD_DEPRECATED("use ZSTD_compress2")
1386 </p></pre><BR>
1388 <pre><b>ZSTD_DEPRECATED("use ZSTD_compress2 with ZSTD_CCtx_loadDictionary")
1397 </p></pre><BR>
1399 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void*…
1402 </p></pre><BR>
1404 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* di…
1408 </p></pre><BR>
1410 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* prefix,…
1413 </p></pre><BR>
1415 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtx_getParameter(const ZSTD_CCtx* cctx, ZSTD_cParameter par…
1420 </p></pre><BR>
1422 <pre><b>ZSTDLIB_STATIC_API ZSTD_CCtx_params* ZSTD_createCCtxParams(void);
1425 - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure
1426 - ZSTD_CCtxParams_setParameter() : Push parameters one by one into
1430 - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to
1434 - ZSTD_compressStream2() : Do compression using the CCtx.
1435 - ZSTD_freeCCtxParams() : Free the memory, accept NULL pointer.
1438 for static allocation of CCtx for single-threaded compression.
1440 </p></pre><BR>
1442 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_reset(ZSTD_CCtx_params* params);
1445 </p></pre><BR>
1447 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressio…
1451 </p></pre><BR>
1453 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_…
1457 </p></pre><BR>
1459 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* params, ZSTD_cPara…
1461 Set one compression parameter, selected by enum ZSTD_cParameter.
1467 </p></pre><BR>
1469 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_getParameter(const ZSTD_CCtx_params* params, ZSTD…
1474 </p></pre><BR>
1476 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_CCtx_setParametersUsingCCtxParams(
1478 </b><p> Apply a set of ZSTD_CCtx_params to the compression context.
1484 </p></pre><BR>
1486 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_compressStream2_simpleArgs (
1496 </p></pre><BR>
1498 <a name="Chapter18"></a><h2>Advanced decompression functions</h2><pre></pre>
1500 <pre><b>ZSTDLIB_STATIC_API unsigned ZSTD_isFrame(const void* buffer, size_t size);
1505 </p></pre><BR>
1507 <pre><b>ZSTDLIB_STATIC_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t …
1512 </p></pre><BR>
1514 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void*…
1519 </p></pre><BR>
1521 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* di…
1526 </p></pre><BR>
1528 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix,…
1531 </p></pre><BR>
1533 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize);
1536 …This parameter is only useful in streaming mode, since no internal buffer is allocated in single-p…
1540 </p></pre><BR>
1542 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, in…
1547 </p></pre><BR>
1549 <pre><b>ZSTD_DEPRECATED("use ZSTD_DCtx_setParameter() instead")
1553 This instruction is mandatory to decode data without a fully-formed header,
1556 </p></pre><BR>
1558 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_decompressStream_simpleArgs (
1567 </p></pre><BR>
1569 <a name="Chapter19"></a><h2>Advanced streaming functions</h2><pre> Warning : most of these functio…
1572 <BR></pre>
1574 <h3>Advanced Streaming compression functions</h3><pre></pre><b><pre></pre></b><BR>
1575 <pre><b>ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
1590 </p></pre><BR>
1592 <pre><b>ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
1607 </p></pre><BR>
1609 <pre><b>ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
1616 // Pseudocode: Set each zstd parameter and leave the rest as-is.
1628 </p></pre><BR>
1630 <pre><b>ZSTD_DEPRECATED("use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instru…
1639 </p></pre><BR>
1641 <pre><b>ZSTD_DEPRECATED("use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instru…
1648 // Pseudocode: Set each zstd frame parameter and leave the rest as-is.
1660 </p></pre><BR>
1662 <pre><b>ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
1672 This is typically useful to skip dictionary loading stage, since it will re-use it in-place.
1681 </p></pre><BR>
1683 <pre><b>typedef struct {
1691 </b></pre><BR>
1692 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx);
1705 </p></pre><BR>
1707 <h3>Advanced Streaming decompression functions</h3><pre></pre><b><pre></pre></b><BR>
1708 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, s…
1716 </p></pre><BR>
1718 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* …
1726 </p></pre><BR>
1728 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_resetDStream(ZSTD_DStream* zds);
1732 re-use decompression parameters from previous init; saves dictionary loading
1735 </p></pre><BR>
1737 <a name="Chapter20"></a><h2>Buffer-less and synchronous inner streaming functions</h2><pre>
1742 <BR></pre>
1744 <a name="Chapter21"></a><h2>Buffer-less streaming compression (synchronous mode)</h2><pre>
1747 ZSTD_CCtx object can be re-used multiple times within successive compression operations.
1755 - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only.
1756 - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks.
1757 …- Caller must ensure there is enough space in `dst` to store compressed data under worst case scen…
1760 …- ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to max…
1762 …- ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps.
1769 `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress again.
1770 <BR></pre>
1772 <h3>Buffer-less streaming compression functions</h3><pre></pre><b><pre>ZSTDLIB_STATIC_API size_t ZS…
1776 </pre></b><BR>
1777 <pre><b>size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD…
1778 </b></pre><BR>
1779 <a name="Chapter22"></a><h2>Buffer-less streaming decompression (synchronous mode)</h2><pre>
1782 A ZSTD_DCtx object can be re-used multiple times.
1793 such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`).
1797 Each application can set its own limits, depending on local restrictions.
1803 …or that previous contiguous segment is large enough to properly handle maximum back-reference dist…
1808 …which can @return an error code if required value is too large for current system (in 32-bits mode…
1818 as long as the encoder and decoder progress in "lock-step",
1840 Skippable frames allow integration of user-defined data into a flow of concatenated frames.
1843 a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F
1844 b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits
1845 c) Frame Content - any content (User Data) of length equal to Frame Size
1846 For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame.
1848 <BR></pre>
1850 <h3>Buffer-less streaming decompression functions</h3><pre></pre><b><pre>typedef enum { ZSTD_frame,…
1860 </pre></b><BR>
1861 <pre><b>ZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, si…
1871 </p></pre><BR>
1873 <pre><b>typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, …
1874 </b></pre><BR>
1875 <a name="Chapter23"></a><h2>Block level API</h2><pre></pre>
1877 <pre><b></b><p> Frame metadata cost is typically ~12 bytes, which can be non-negligible for very…
1881 - Compressing and decompressing require a context structure
1883 - It is necessary to init context before starting
1887 - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB
1891 …- When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero)…
1900 </p></pre><BR>
1902 <h3>Raw zstd block functions</h3><pre></pre><b><pre>ZSTDLIB_STATIC_API size_t ZSTD_getBlockSize (…
1905 …); </b>/**< insert uncompressed block into `dctx` history. Useful for multi-blocks decompression.…
1906 </pre></b><BR>