Skip to main content

zstd_sys/mnt/build/debug/build/zstd-sys-191688bd0bbb2a8a/out/
bindings.rs

1/* automatically generated by rust-bindgen 0.72.1 */
2
3pub const ZSTD_VERSION_MAJOR: u32 = 1;
4pub const ZSTD_VERSION_MINOR: u32 = 5;
5pub const ZSTD_VERSION_RELEASE: u32 = 7;
6pub const ZSTD_VERSION_NUMBER: u32 = 10507;
7pub const ZSTD_CLEVEL_DEFAULT: u32 = 3;
8pub const ZSTD_MAGICNUMBER: u32 = 4247762216;
9pub const ZSTD_MAGIC_DICTIONARY: u32 = 3962610743;
10pub const ZSTD_MAGIC_SKIPPABLE_START: u32 = 407710288;
11pub const ZSTD_MAGIC_SKIPPABLE_MASK: u32 = 4294967280;
12pub const ZSTD_BLOCKSIZELOG_MAX: u32 = 17;
13pub const ZSTD_BLOCKSIZE_MAX: u32 = 131072;
14pub const ZSTD_CONTENTSIZE_UNKNOWN: i32 = -1;
15pub const ZSTD_CONTENTSIZE_ERROR: i32 = -2;
16pub type wchar_t = ::core::ffi::c_int;
17#[repr(u32)]
18#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19pub enum ZSTD_ErrorCode {
20    ZSTD_error_no_error = 0,
21    ZSTD_error_GENERIC = 1,
22    ZSTD_error_prefix_unknown = 10,
23    ZSTD_error_version_unsupported = 12,
24    ZSTD_error_frameParameter_unsupported = 14,
25    ZSTD_error_frameParameter_windowTooLarge = 16,
26    ZSTD_error_corruption_detected = 20,
27    ZSTD_error_checksum_wrong = 22,
28    ZSTD_error_literals_headerWrong = 24,
29    ZSTD_error_dictionary_corrupted = 30,
30    ZSTD_error_dictionary_wrong = 32,
31    ZSTD_error_dictionaryCreation_failed = 34,
32    ZSTD_error_parameter_unsupported = 40,
33    ZSTD_error_parameter_combination_unsupported = 41,
34    ZSTD_error_parameter_outOfBound = 42,
35    ZSTD_error_tableLog_tooLarge = 44,
36    ZSTD_error_maxSymbolValue_tooLarge = 46,
37    ZSTD_error_maxSymbolValue_tooSmall = 48,
38    ZSTD_error_cannotProduce_uncompressedBlock = 49,
39    ZSTD_error_stabilityCondition_notRespected = 50,
40    ZSTD_error_stage_wrong = 60,
41    ZSTD_error_init_missing = 62,
42    ZSTD_error_memory_allocation = 64,
43    ZSTD_error_workSpace_tooSmall = 66,
44    ZSTD_error_dstSize_tooSmall = 70,
45    ZSTD_error_srcSize_wrong = 72,
46    ZSTD_error_dstBuffer_null = 74,
47    ZSTD_error_noForwardProgress_destFull = 80,
48    ZSTD_error_noForwardProgress_inputEmpty = 82,
49    ZSTD_error_frameIndex_tooLarge = 100,
50    ZSTD_error_seekableIO = 102,
51    ZSTD_error_dstBuffer_wrong = 104,
52    ZSTD_error_srcBuffer_wrong = 105,
53    ZSTD_error_sequenceProducer_failed = 106,
54    ZSTD_error_externalSequences_invalid = 107,
55    ZSTD_error_maxCode = 120,
56}
57extern "C" {
58    pub fn ZSTD_getErrorString(code: ZSTD_ErrorCode) -> *const ::core::ffi::c_char;
59}
60extern "C" {
61    #[doc = " ZSTD_versionNumber() :\n  Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE)."]
62    pub fn ZSTD_versionNumber() -> ::core::ffi::c_uint;
63}
64extern "C" {
65    #[doc = " ZSTD_versionString() :\n  Return runtime library version, like \"1.4.5\". Requires v1.3.0+."]
66    pub fn ZSTD_versionString() -> *const ::core::ffi::c_char;
67}
68extern "C" {
69    #[doc = "  Simple Core API\n/\n/*! ZSTD_compress() :\n  Compresses `src` content as a single zstd compressed frame into already allocated `dst`.\n  NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have\n        enough space to successfully compress the data.\n  @return : compressed size written into `dst` (<= `dstCapacity),\n            or an error code if it fails (which can be tested using ZSTD_isError())."]
70    pub fn ZSTD_compress(
71        dst: *mut ::core::ffi::c_void,
72        dstCapacity: usize,
73        src: *const ::core::ffi::c_void,
74        srcSize: usize,
75        compressionLevel: ::core::ffi::c_int,
76    ) -> usize;
77}
78extern "C" {
79    #[doc = " ZSTD_decompress() :\n `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames.\n  Multiple compressed frames can be decompressed at once with this method.\n  The result will be the concatenation of all decompressed frames, back to back.\n `dstCapacity` is an upper bound of originalSize to regenerate.\n  First frame's decompressed size can be extracted using ZSTD_getFrameContentSize().\n  If maximum upper bound isn't known, prefer using streaming mode to decompress data.\n @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),\n           or an errorCode if it fails (which can be tested using ZSTD_isError())."]
80    pub fn ZSTD_decompress(
81        dst: *mut ::core::ffi::c_void,
82        dstCapacity: usize,
83        src: *const ::core::ffi::c_void,
84        compressedSize: usize,
85    ) -> usize;
86}
87extern "C" {
88    pub fn ZSTD_getFrameContentSize(
89        src: *const ::core::ffi::c_void,
90        srcSize: usize,
91    ) -> ::core::ffi::c_ulonglong;
92}
93extern "C" {
94    #[doc = " ZSTD_getDecompressedSize() (obsolete):\n  This function is now obsolete, in favor of ZSTD_getFrameContentSize().\n  Both functions work the same way, but ZSTD_getDecompressedSize() blends\n  \"empty\", \"unknown\" and \"error\" results to the same return value (0),\n  while ZSTD_getFrameContentSize() gives them separate return values.\n @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise."]
95    pub fn ZSTD_getDecompressedSize(
96        src: *const ::core::ffi::c_void,
97        srcSize: usize,
98    ) -> ::core::ffi::c_ulonglong;
99}
100extern "C" {
101    #[doc = " ZSTD_findFrameCompressedSize() : Requires v1.4.0+\n `src` should point to the start of a ZSTD frame or skippable frame.\n `srcSize` must be >= first frame size\n @return : the compressed size of the first frame starting at `src`,\n           suitable to pass as `srcSize` to `ZSTD_decompress` or similar,\n           or an error code if input is invalid\n  Note 1: this method is called _find*() because it's not enough to read the header,\n          it may have to scan through the frame's content, to reach its end.\n  Note 2: this method also works with Skippable Frames. In which case,\n          it returns the size of the complete skippable frame,\n          which is always equal to its content size + 8 bytes for headers."]
102    pub fn ZSTD_findFrameCompressedSize(src: *const ::core::ffi::c_void, srcSize: usize) -> usize;
103}
104extern "C" {
105    pub fn ZSTD_compressBound(srcSize: usize) -> usize;
106}
107extern "C" {
108    pub fn ZSTD_isError(result: usize) -> ::core::ffi::c_uint;
109}
110extern "C" {
111    pub fn ZSTD_getErrorCode(functionResult: usize) -> ZSTD_ErrorCode;
112}
113extern "C" {
114    pub fn ZSTD_getErrorName(result: usize) -> *const ::core::ffi::c_char;
115}
116extern "C" {
117    pub fn ZSTD_minCLevel() -> ::core::ffi::c_int;
118}
119extern "C" {
120    pub fn ZSTD_maxCLevel() -> ::core::ffi::c_int;
121}
122extern "C" {
123    pub fn ZSTD_defaultCLevel() -> ::core::ffi::c_int;
124}
125#[repr(C)]
126#[derive(Debug, Copy, Clone)]
127pub struct ZSTD_CCtx_s {
128    _unused: [u8; 0],
129}
130#[doc = "  Explicit context"]
131pub type ZSTD_CCtx = ZSTD_CCtx_s;
132extern "C" {
133    pub fn ZSTD_createCCtx() -> *mut ZSTD_CCtx;
134}
135extern "C" {
136    pub fn ZSTD_freeCCtx(cctx: *mut ZSTD_CCtx) -> usize;
137}
138extern "C" {
139    #[doc = " ZSTD_compressCCtx() :\n  Same as ZSTD_compress(), using an explicit ZSTD_CCtx.\n  Important : in order to mirror `ZSTD_compress()` behavior,\n  this function compresses at the requested compression level,\n  __ignoring any other advanced parameter__ .\n  If any advanced parameter was set using the advanced API,\n  they will all be reset. Only @compressionLevel remains."]
140    pub fn ZSTD_compressCCtx(
141        cctx: *mut ZSTD_CCtx,
142        dst: *mut ::core::ffi::c_void,
143        dstCapacity: usize,
144        src: *const ::core::ffi::c_void,
145        srcSize: usize,
146        compressionLevel: ::core::ffi::c_int,
147    ) -> usize;
148}
149#[repr(C)]
150#[derive(Debug, Copy, Clone)]
151pub struct ZSTD_DCtx_s {
152    _unused: [u8; 0],
153}
154pub type ZSTD_DCtx = ZSTD_DCtx_s;
155extern "C" {
156    pub fn ZSTD_createDCtx() -> *mut ZSTD_DCtx;
157}
158extern "C" {
159    pub fn ZSTD_freeDCtx(dctx: *mut ZSTD_DCtx) -> usize;
160}
161extern "C" {
162    #[doc = " ZSTD_decompressDCtx() :\n  Same as ZSTD_decompress(),\n  requires an allocated ZSTD_DCtx.\n  Compatible with sticky parameters (see below)."]
163    pub fn ZSTD_decompressDCtx(
164        dctx: *mut ZSTD_DCtx,
165        dst: *mut ::core::ffi::c_void,
166        dstCapacity: usize,
167        src: *const ::core::ffi::c_void,
168        srcSize: usize,
169    ) -> usize;
170}
171#[repr(u32)]
172#[doc = "  Advanced compression API (Requires v1.4.0+)"]
173#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
174pub enum ZSTD_strategy {
175    ZSTD_fast = 1,
176    ZSTD_dfast = 2,
177    ZSTD_greedy = 3,
178    ZSTD_lazy = 4,
179    ZSTD_lazy2 = 5,
180    ZSTD_btlazy2 = 6,
181    ZSTD_btopt = 7,
182    ZSTD_btultra = 8,
183    ZSTD_btultra2 = 9,
184}
185#[repr(u32)]
186#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
187pub enum ZSTD_cParameter {
188    ZSTD_c_compressionLevel = 100,
189    ZSTD_c_windowLog = 101,
190    ZSTD_c_hashLog = 102,
191    ZSTD_c_chainLog = 103,
192    ZSTD_c_searchLog = 104,
193    ZSTD_c_minMatch = 105,
194    ZSTD_c_targetLength = 106,
195    ZSTD_c_strategy = 107,
196    ZSTD_c_targetCBlockSize = 130,
197    ZSTD_c_enableLongDistanceMatching = 160,
198    ZSTD_c_ldmHashLog = 161,
199    ZSTD_c_ldmMinMatch = 162,
200    ZSTD_c_ldmBucketSizeLog = 163,
201    ZSTD_c_ldmHashRateLog = 164,
202    ZSTD_c_contentSizeFlag = 200,
203    ZSTD_c_checksumFlag = 201,
204    ZSTD_c_dictIDFlag = 202,
205    ZSTD_c_nbWorkers = 400,
206    ZSTD_c_jobSize = 401,
207    ZSTD_c_overlapLog = 402,
208    ZSTD_c_experimentalParam1 = 500,
209    ZSTD_c_experimentalParam2 = 10,
210    ZSTD_c_experimentalParam3 = 1000,
211    ZSTD_c_experimentalParam4 = 1001,
212    ZSTD_c_experimentalParam5 = 1002,
213    ZSTD_c_experimentalParam7 = 1004,
214    ZSTD_c_experimentalParam8 = 1005,
215    ZSTD_c_experimentalParam9 = 1006,
216    ZSTD_c_experimentalParam10 = 1007,
217    ZSTD_c_experimentalParam11 = 1008,
218    ZSTD_c_experimentalParam12 = 1009,
219    ZSTD_c_experimentalParam13 = 1010,
220    ZSTD_c_experimentalParam14 = 1011,
221    ZSTD_c_experimentalParam15 = 1012,
222    ZSTD_c_experimentalParam16 = 1013,
223    ZSTD_c_experimentalParam17 = 1014,
224    ZSTD_c_experimentalParam18 = 1015,
225    ZSTD_c_experimentalParam19 = 1016,
226    ZSTD_c_experimentalParam20 = 1017,
227}
228#[repr(C)]
229#[derive(Debug, Copy, Clone)]
230pub struct ZSTD_bounds {
231    pub error: usize,
232    pub lowerBound: ::core::ffi::c_int,
233    pub upperBound: ::core::ffi::c_int,
234}
235extern "C" {
236    #[doc = " ZSTD_cParam_getBounds() :\n  All parameters must belong to an interval with lower and upper bounds,\n  otherwise they will either trigger an error or be automatically clamped.\n @return : a structure, ZSTD_bounds, which contains\n         - an error status field, which must be tested using ZSTD_isError()\n         - lower and upper bounds, both inclusive"]
237    pub fn ZSTD_cParam_getBounds(cParam: ZSTD_cParameter) -> ZSTD_bounds;
238}
239extern "C" {
240    #[doc = " ZSTD_CCtx_setParameter() :\n  Set one compression parameter, selected by enum ZSTD_cParameter.\n  All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds().\n  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter).\n  Setting a parameter is generally only possible during frame initialization (before starting compression).\n  Exception : when using multi-threading mode (nbWorkers >= 1),\n              the following parameters can be updated _during_ compression (within same frame):\n              => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy.\n              new parameters will be active for next job only (after a flush()).\n @return : an error code (which can be tested using ZSTD_isError())."]
241    pub fn ZSTD_CCtx_setParameter(
242        cctx: *mut ZSTD_CCtx,
243        param: ZSTD_cParameter,
244        value: ::core::ffi::c_int,
245    ) -> usize;
246}
247extern "C" {
248    #[doc = " ZSTD_CCtx_setPledgedSrcSize() :\n  Total input data size to be compressed as a single frame.\n  Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag.\n  This value will also be controlled at end of frame, and trigger an error if not respected.\n @result : 0, or an error code (which can be tested with ZSTD_isError()).\n  Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame.\n           In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN.\n           ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame.\n  Note 2 : pledgedSrcSize is only valid once, for the next frame.\n           It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN.\n  Note 3 : Whenever all input data is provided and consumed in a single round,\n           for example with ZSTD_compress2(),\n           or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end),\n           this value is automatically overridden by srcSize instead."]
249    pub fn ZSTD_CCtx_setPledgedSrcSize(
250        cctx: *mut ZSTD_CCtx,
251        pledgedSrcSize: ::core::ffi::c_ulonglong,
252    ) -> usize;
253}
254#[repr(u32)]
255#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
256pub enum ZSTD_ResetDirective {
257    ZSTD_reset_session_only = 1,
258    ZSTD_reset_parameters = 2,
259    ZSTD_reset_session_and_parameters = 3,
260}
261extern "C" {
262    #[doc = " ZSTD_CCtx_reset() :\n  There are 2 different things that can be reset, independently or jointly :\n  - The session : will stop compressing current frame, and make CCtx ready to start a new one.\n                  Useful after an error, or to interrupt any ongoing compression.\n                  Any internal data not yet flushed is cancelled.\n                  Compression parameters and dictionary remain unchanged.\n                  They will be used to compress next frame.\n                  Resetting session never fails.\n  - The parameters : changes all parameters back to \"default\".\n                  This also removes any reference to any dictionary or external sequence producer.\n                  Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing)\n                  otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError())\n  - Both : similar to resetting the session, followed by resetting parameters."]
263    pub fn ZSTD_CCtx_reset(cctx: *mut ZSTD_CCtx, reset: ZSTD_ResetDirective) -> usize;
264}
265extern "C" {
266    #[doc = " ZSTD_compress2() :\n  Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API.\n  (note that this entry point doesn't even expose a compression level parameter).\n  ZSTD_compress2() always starts a new frame.\n  Should cctx hold data from a previously unfinished frame, everything about it is forgotten.\n  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n  - The function is always blocking, returns when compression is completed.\n  NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have\n        enough space to successfully compress the data, though it is possible it fails for other reasons.\n @return : compressed size written into `dst` (<= `dstCapacity),\n           or an error code if it fails (which can be tested using ZSTD_isError())."]
267    pub fn ZSTD_compress2(
268        cctx: *mut ZSTD_CCtx,
269        dst: *mut ::core::ffi::c_void,
270        dstCapacity: usize,
271        src: *const ::core::ffi::c_void,
272        srcSize: usize,
273    ) -> usize;
274}
275#[repr(u32)]
276#[doc = "  Advanced decompression API (Requires v1.4.0+)"]
277#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
278pub enum ZSTD_dParameter {
279    ZSTD_d_windowLogMax = 100,
280    ZSTD_d_experimentalParam1 = 1000,
281    ZSTD_d_experimentalParam2 = 1001,
282    ZSTD_d_experimentalParam3 = 1002,
283    ZSTD_d_experimentalParam4 = 1003,
284    ZSTD_d_experimentalParam5 = 1004,
285    ZSTD_d_experimentalParam6 = 1005,
286}
287extern "C" {
288    #[doc = " ZSTD_dParam_getBounds() :\n  All parameters must belong to an interval with lower and upper bounds,\n  otherwise they will either trigger an error or be automatically clamped.\n @return : a structure, ZSTD_bounds, which contains\n         - an error status field, which must be tested using ZSTD_isError()\n         - both lower and upper bounds, inclusive"]
289    pub fn ZSTD_dParam_getBounds(dParam: ZSTD_dParameter) -> ZSTD_bounds;
290}
291extern "C" {
292    #[doc = " ZSTD_DCtx_setParameter() :\n  Set one compression parameter, selected by enum ZSTD_dParameter.\n  All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds().\n  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter).\n  Setting a parameter is only possible during frame initialization (before starting decompression).\n @return : 0, or an error code (which can be tested using ZSTD_isError())."]
293    pub fn ZSTD_DCtx_setParameter(
294        dctx: *mut ZSTD_DCtx,
295        param: ZSTD_dParameter,
296        value: ::core::ffi::c_int,
297    ) -> usize;
298}
299extern "C" {
300    #[doc = " ZSTD_DCtx_reset() :\n  Return a DCtx to clean state.\n  Session and parameters can be reset jointly or separately.\n  Parameters can only be reset when no active frame is being decompressed.\n @return : 0, or an error code, which can be tested with ZSTD_isError()"]
301    pub fn ZSTD_DCtx_reset(dctx: *mut ZSTD_DCtx, reset: ZSTD_ResetDirective) -> usize;
302}
303#[doc = "  Streaming"]
304#[repr(C)]
305#[derive(Debug, Copy, Clone)]
306pub struct ZSTD_inBuffer_s {
307    #[doc = "< start of input buffer"]
308    pub src: *const ::core::ffi::c_void,
309    #[doc = "< size of input buffer"]
310    pub size: usize,
311    #[doc = "< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size"]
312    pub pos: usize,
313}
314#[doc = "  Streaming"]
315pub type ZSTD_inBuffer = ZSTD_inBuffer_s;
316#[repr(C)]
317#[derive(Debug, Copy, Clone)]
318pub struct ZSTD_outBuffer_s {
319    #[doc = "< start of output buffer"]
320    pub dst: *mut ::core::ffi::c_void,
321    #[doc = "< size of output buffer"]
322    pub size: usize,
323    #[doc = "< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size"]
324    pub pos: usize,
325}
326pub type ZSTD_outBuffer = ZSTD_outBuffer_s;
327pub type ZSTD_CStream = ZSTD_CCtx;
328extern "C" {
329    pub fn ZSTD_createCStream() -> *mut ZSTD_CStream;
330}
331extern "C" {
332    pub fn ZSTD_freeCStream(zcs: *mut ZSTD_CStream) -> usize;
333}
334#[repr(u32)]
335#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
336pub enum ZSTD_EndDirective {
337    ZSTD_e_continue = 0,
338    ZSTD_e_flush = 1,
339    ZSTD_e_end = 2,
340}
341extern "C" {
342    #[doc = " ZSTD_compressStream2() : Requires v1.4.0+\n  Behaves about the same as ZSTD_compressStream, with additional control on end directive.\n  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n  - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)\n  - output->pos must be <= dstCapacity, input->pos must be <= srcSize\n  - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit.\n  - endOp must be a valid directive\n  - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller.\n  - When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available,\n                                                  and then immediately returns, just indicating that there is some data remaining to be flushed.\n                                                  The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte.\n  - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking.\n  - @return provides a minimum amount of data remaining to be flushed from internal buffers\n            or an error code, which can be tested using ZSTD_isError().\n            if @return != 0, flush is not fully completed, there is still some data left within internal buffers.\n            This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers.\n            For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed.\n  - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),\n            only ZSTD_e_end or ZSTD_e_flush operations are allowed.\n            Before starting a new compression job, or changing compression parameters,\n            it is required to fully flush internal buffers.\n  - note: if an operation ends with an error, it may leave @cctx in an undefined state.\n          Therefore, it's UB to invoke ZSTD_compressStream2() of ZSTD_compressStream() on such a state.\n          In order to be re-employed after an error, a state must be reset,\n          which can be done explicitly (ZSTD_CCtx_reset()),\n          or is sometimes implied by methods starting a new compression job (ZSTD_initCStream(), ZSTD_compressCCtx())"]
343    pub fn ZSTD_compressStream2(
344        cctx: *mut ZSTD_CCtx,
345        output: *mut ZSTD_outBuffer,
346        input: *mut ZSTD_inBuffer,
347        endOp: ZSTD_EndDirective,
348    ) -> usize;
349}
350extern "C" {
351    pub fn ZSTD_CStreamInSize() -> usize;
352}
353extern "C" {
354    pub fn ZSTD_CStreamOutSize() -> usize;
355}
356extern "C" {
357    #[doc = " Equivalent to:\n\n     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n     ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)\n     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);\n\n Note that ZSTD_initCStream() clears any previously set dictionary. Use the new API\n to compress with a dictionary."]
358    pub fn ZSTD_initCStream(zcs: *mut ZSTD_CStream, compressionLevel: ::core::ffi::c_int) -> usize;
359}
360extern "C" {
361    #[doc = " Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).\n NOTE: The return value is different. ZSTD_compressStream() returns a hint for\n the next read size (if non-zero and not an error). ZSTD_compressStream2()\n returns the minimum nb of bytes left to flush (if non-zero and not an error)."]
362    pub fn ZSTD_compressStream(
363        zcs: *mut ZSTD_CStream,
364        output: *mut ZSTD_outBuffer,
365        input: *mut ZSTD_inBuffer,
366    ) -> usize;
367}
368extern "C" {
369    #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush)."]
370    pub fn ZSTD_flushStream(zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer) -> usize;
371}
372extern "C" {
373    #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end)."]
374    pub fn ZSTD_endStream(zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer) -> usize;
375}
376pub type ZSTD_DStream = ZSTD_DCtx;
377extern "C" {
378    pub fn ZSTD_createDStream() -> *mut ZSTD_DStream;
379}
380extern "C" {
381    pub fn ZSTD_freeDStream(zds: *mut ZSTD_DStream) -> usize;
382}
383extern "C" {
384    #[doc = " ZSTD_initDStream() :\n Initialize/reset DStream state for new decompression operation.\n Call before new decompression operation using same DStream.\n\n Note : This function is redundant with the advanced API and equivalent to:\n     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n     ZSTD_DCtx_refDDict(zds, NULL);"]
385    pub fn ZSTD_initDStream(zds: *mut ZSTD_DStream) -> usize;
386}
387extern "C" {
388    #[doc = " ZSTD_decompressStream() :\n Streaming decompression function.\n Call repetitively to consume full input updating it as necessary.\n Function will update both input and output `pos` fields exposing current state via these fields:\n - `input.pos < input.size`, some input remaining and caller should provide remaining input\n   on the next call.\n - `output.pos < output.size`, decoder flushed internal output buffer.\n - `output.pos == output.size`, unflushed data potentially present in the internal buffers,\n   check ZSTD_decompressStream() @return value,\n   if > 0, invoke it again to flush remaining data to output.\n Note : with no additional input, amount of data flushed <= ZSTD_BLOCKSIZE_MAX.\n\n @return : 0 when a frame is completely decoded and fully flushed,\n           or an error code, which can be tested using ZSTD_isError(),\n           or any other value > 0, which means there is some decoding or flushing to do to complete current frame.\n\n Note: when an operation returns with an error code, the @zds state may be left in undefined state.\n       It's UB to invoke `ZSTD_decompressStream()` on such a state.\n       In order to re-use such a state, it must be first reset,\n       which can be done explicitly (`ZSTD_DCtx_reset()`),\n       or is implied for operations starting some new decompression job (`ZSTD_initDStream`, `ZSTD_decompressDCtx()`, `ZSTD_decompress_usingDict()`)"]
389    pub fn ZSTD_decompressStream(
390        zds: *mut ZSTD_DStream,
391        output: *mut ZSTD_outBuffer,
392        input: *mut ZSTD_inBuffer,
393    ) -> usize;
394}
395extern "C" {
396    pub fn ZSTD_DStreamInSize() -> usize;
397}
398extern "C" {
399    pub fn ZSTD_DStreamOutSize() -> usize;
400}
401extern "C" {
402    #[doc = "  Simple dictionary API\n/\n/*! ZSTD_compress_usingDict() :\n  Compression at an explicit compression level using a Dictionary.\n  A dictionary can be any arbitrary data segment (also called a prefix),\n  or a buffer with specified information (see zdict.h).\n  Note : This function loads the dictionary, resulting in significant startup delay.\n         It's intended for a dictionary used only once.\n  Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used."]
403    pub fn ZSTD_compress_usingDict(
404        ctx: *mut ZSTD_CCtx,
405        dst: *mut ::core::ffi::c_void,
406        dstCapacity: usize,
407        src: *const ::core::ffi::c_void,
408        srcSize: usize,
409        dict: *const ::core::ffi::c_void,
410        dictSize: usize,
411        compressionLevel: ::core::ffi::c_int,
412    ) -> usize;
413}
414extern "C" {
415    #[doc = " ZSTD_decompress_usingDict() :\n  Decompression using a known Dictionary.\n  Dictionary must be identical to the one used during compression.\n  Note : This function loads the dictionary, resulting in significant startup delay.\n         It's intended for a dictionary used only once.\n  Note : When `dict == NULL || dictSize < 8` no dictionary is used."]
416    pub fn ZSTD_decompress_usingDict(
417        dctx: *mut ZSTD_DCtx,
418        dst: *mut ::core::ffi::c_void,
419        dstCapacity: usize,
420        src: *const ::core::ffi::c_void,
421        srcSize: usize,
422        dict: *const ::core::ffi::c_void,
423        dictSize: usize,
424    ) -> usize;
425}
426#[repr(C)]
427#[derive(Debug, Copy, Clone)]
428pub struct ZSTD_CDict_s {
429    _unused: [u8; 0],
430}
431#[doc = "  Bulk processing dictionary API"]
432pub type ZSTD_CDict = ZSTD_CDict_s;
433extern "C" {
434    #[doc = " ZSTD_createCDict() :\n  When compressing multiple messages or blocks using the same dictionary,\n  it's recommended to digest the dictionary only once, since it's a costly operation.\n  ZSTD_createCDict() will create a state from digesting a dictionary.\n  The resulting state can be used for future compression operations with very limited startup cost.\n  ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only.\n @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict.\n  Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content.\n  Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer,\n      in which case the only thing that it transports is the @compressionLevel.\n      This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively,\n      expecting a ZSTD_CDict parameter with any data, including those without a known dictionary."]
435    pub fn ZSTD_createCDict(
436        dictBuffer: *const ::core::ffi::c_void,
437        dictSize: usize,
438        compressionLevel: ::core::ffi::c_int,
439    ) -> *mut ZSTD_CDict;
440}
441extern "C" {
442    #[doc = " ZSTD_freeCDict() :\n  Function frees memory allocated by ZSTD_createCDict().\n  If a NULL pointer is passed, no operation is performed."]
443    pub fn ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize;
444}
445extern "C" {
446    #[doc = " ZSTD_compress_usingCDict() :\n  Compression using a digested Dictionary.\n  Recommended when same dictionary is used multiple times.\n  Note : compression level is _decided at dictionary creation time_,\n     and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)"]
447    pub fn ZSTD_compress_usingCDict(
448        cctx: *mut ZSTD_CCtx,
449        dst: *mut ::core::ffi::c_void,
450        dstCapacity: usize,
451        src: *const ::core::ffi::c_void,
452        srcSize: usize,
453        cdict: *const ZSTD_CDict,
454    ) -> usize;
455}
456#[repr(C)]
457#[derive(Debug, Copy, Clone)]
458pub struct ZSTD_DDict_s {
459    _unused: [u8; 0],
460}
461pub type ZSTD_DDict = ZSTD_DDict_s;
462extern "C" {
463    #[doc = " ZSTD_createDDict() :\n  Create a digested dictionary, ready to start decompression operation without startup delay.\n  dictBuffer can be released after DDict creation, as its content is copied inside DDict."]
464    pub fn ZSTD_createDDict(
465        dictBuffer: *const ::core::ffi::c_void,
466        dictSize: usize,
467    ) -> *mut ZSTD_DDict;
468}
469extern "C" {
470    #[doc = " ZSTD_freeDDict() :\n  Function frees memory allocated with ZSTD_createDDict()\n  If a NULL pointer is passed, no operation is performed."]
471    pub fn ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize;
472}
473extern "C" {
474    #[doc = " ZSTD_decompress_usingDDict() :\n  Decompression using a digested Dictionary.\n  Recommended when same dictionary is used multiple times."]
475    pub fn ZSTD_decompress_usingDDict(
476        dctx: *mut ZSTD_DCtx,
477        dst: *mut ::core::ffi::c_void,
478        dstCapacity: usize,
479        src: *const ::core::ffi::c_void,
480        srcSize: usize,
481        ddict: *const ZSTD_DDict,
482    ) -> usize;
483}
484extern "C" {
485    #[doc = " ZSTD_getDictID_fromDict() : Requires v1.4.0+\n  Provides the dictID stored within dictionary.\n  if @return == 0, the dictionary is not conformant with Zstandard specification.\n  It can still be loaded, but as a content-only dictionary."]
486    pub fn ZSTD_getDictID_fromDict(
487        dict: *const ::core::ffi::c_void,
488        dictSize: usize,
489    ) -> ::core::ffi::c_uint;
490}
491extern "C" {
492    #[doc = " ZSTD_getDictID_fromCDict() : Requires v1.5.0+\n  Provides the dictID of the dictionary loaded into `cdict`.\n  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n  Non-conformant dictionaries can still be loaded, but as content-only dictionaries."]
493    pub fn ZSTD_getDictID_fromCDict(cdict: *const ZSTD_CDict) -> ::core::ffi::c_uint;
494}
495extern "C" {
496    #[doc = " ZSTD_getDictID_fromDDict() : Requires v1.4.0+\n  Provides the dictID of the dictionary loaded into `ddict`.\n  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n  Non-conformant dictionaries can still be loaded, but as content-only dictionaries."]
497    pub fn ZSTD_getDictID_fromDDict(ddict: *const ZSTD_DDict) -> ::core::ffi::c_uint;
498}
499extern "C" {
500    #[doc = " ZSTD_getDictID_fromFrame() : Requires v1.4.0+\n  Provides the dictID required to decompressed the frame stored within `src`.\n  If @return == 0, the dictID could not be decoded.\n  This could for one of the following reasons :\n  - The frame does not require a dictionary to be decoded (most common case).\n  - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden piece of information.\n    Note : this use case also happens when using a non-conformant dictionary.\n  - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`).\n  - This is not a Zstandard frame.\n  When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code."]
501    pub fn ZSTD_getDictID_fromFrame(
502        src: *const ::core::ffi::c_void,
503        srcSize: usize,
504    ) -> ::core::ffi::c_uint;
505}
506extern "C" {
507    #[doc = " ZSTD_CCtx_loadDictionary() : Requires v1.4.0+\n  Create an internal CDict from `dict` buffer.\n  Decompression will have to use same dictionary.\n @result : 0, or an error code (which can be tested with ZSTD_isError()).\n  Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,\n           meaning \"return to no-dictionary mode\".\n  Note 1 : Dictionary is sticky, it will be used for all future compressed frames,\n           until parameters are reset, a new dictionary is loaded, or the dictionary\n           is explicitly invalidated by loading a NULL dictionary.\n  Note 2 : Loading a dictionary involves building tables.\n           It's also a CPU consuming operation, with non-negligible impact on latency.\n           Tables are dependent on compression parameters, and for this reason,\n           compression parameters can no longer be changed after loading a dictionary.\n  Note 3 :`dict` content will be copied internally.\n           Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead.\n           In such a case, dictionary buffer must outlive its users.\n  Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()\n           to precisely select how dictionary content must be interpreted.\n  Note 5 : This method does not benefit from LDM (long distance mode).\n           If you want to employ LDM on some large dictionary content,\n           prefer employing ZSTD_CCtx_refPrefix() described below."]
508    pub fn ZSTD_CCtx_loadDictionary(
509        cctx: *mut ZSTD_CCtx,
510        dict: *const ::core::ffi::c_void,
511        dictSize: usize,
512    ) -> usize;
513}
514extern "C" {
515    #[doc = " ZSTD_CCtx_refCDict() : Requires v1.4.0+\n  Reference a prepared dictionary, to be used for all future compressed frames.\n  Note that compression parameters are enforced from within CDict,\n  and supersede any compression parameter previously set within CCtx.\n  The parameters ignored are labelled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs.\n  The ignored parameters will be used again if the CCtx is returned to no-dictionary mode.\n  The dictionary will remain valid for future compressed frames using same CCtx.\n @result : 0, or an error code (which can be tested with ZSTD_isError()).\n  Special : Referencing a NULL CDict means \"return to no-dictionary mode\".\n  Note 1 : Currently, only one dictionary can be managed.\n           Referencing a new dictionary effectively \"discards\" any previous one.\n  Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx."]
516    pub fn ZSTD_CCtx_refCDict(cctx: *mut ZSTD_CCtx, cdict: *const ZSTD_CDict) -> usize;
517}
518extern "C" {
519    #[doc = " ZSTD_CCtx_refPrefix() : Requires v1.4.0+\n  Reference a prefix (single-usage dictionary) for next compressed frame.\n  A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end).\n  Decompression will need same prefix to properly regenerate data.\n  Compressing with a prefix is similar in outcome as performing a diff and compressing it,\n  but performs much faster, especially during decompression (compression speed is tunable with compression level).\n  This method is compatible with LDM (long distance mode).\n @result : 0, or an error code (which can be tested with ZSTD_isError()).\n  Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary\n  Note 1 : Prefix buffer is referenced. It **must** outlive compression.\n           Its content must remain unmodified during compression.\n  Note 2 : If the intention is to diff some large src data blob with some prior version of itself,\n           ensure that the window size is large enough to contain the entire source.\n           See ZSTD_c_windowLog.\n  Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters.\n           It's a CPU consuming operation, with non-negligible impact on latency.\n           If there is a need to use the same prefix multiple times, consider loadDictionary instead.\n  Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent).\n           Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation."]
520    pub fn ZSTD_CCtx_refPrefix(
521        cctx: *mut ZSTD_CCtx,
522        prefix: *const ::core::ffi::c_void,
523        prefixSize: usize,
524    ) -> usize;
525}
526extern "C" {
527    #[doc = " ZSTD_DCtx_loadDictionary() : Requires v1.4.0+\n  Create an internal DDict from dict buffer, to be used to decompress all future frames.\n  The dictionary remains valid for all future frames, until explicitly invalidated, or\n  a new dictionary is loaded.\n @result : 0, or an error code (which can be tested with ZSTD_isError()).\n  Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,\n            meaning \"return to no-dictionary mode\".\n  Note 1 : Loading a dictionary involves building tables,\n           which has a non-negligible impact on CPU usage and latency.\n           It's recommended to \"load once, use many times\", to amortize the cost\n  Note 2 :`dict` content will be copied internally, so `dict` can be released after loading.\n           Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead.\n  Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of\n           how dictionary content is loaded and interpreted."]
528    pub fn ZSTD_DCtx_loadDictionary(
529        dctx: *mut ZSTD_DCtx,
530        dict: *const ::core::ffi::c_void,
531        dictSize: usize,
532    ) -> usize;
533}
534extern "C" {
535    #[doc = " ZSTD_DCtx_refDDict() : Requires v1.4.0+\n  Reference a prepared dictionary, to be used to decompress next frames.\n  The dictionary remains active for decompression of future frames using same DCtx.\n\n  If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function\n  will store the DDict references in a table, and the DDict used for decompression\n  will be determined at decompression time, as per the dict ID in the frame.\n  The memory for the table is allocated on the first call to refDDict, and can be\n  freed with ZSTD_freeDCtx().\n\n  If called with ZSTD_d_refMultipleDDicts disabled (the default), only one dictionary\n  will be managed, and referencing a dictionary effectively \"discards\" any previous one.\n\n @result : 0, or an error code (which can be tested with ZSTD_isError()).\n  Special: referencing a NULL DDict means \"return to no-dictionary mode\".\n  Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx."]
536    pub fn ZSTD_DCtx_refDDict(dctx: *mut ZSTD_DCtx, ddict: *const ZSTD_DDict) -> usize;
537}
538extern "C" {
539    #[doc = " ZSTD_DCtx_refPrefix() : Requires v1.4.0+\n  Reference a prefix (single-usage dictionary) to decompress next frame.\n  This is the reverse operation of ZSTD_CCtx_refPrefix(),\n  and must use the same prefix as the one used during compression.\n  Prefix is **only used once**. Reference is discarded at end of frame.\n  End of frame is reached when ZSTD_decompressStream() returns 0.\n @result : 0, or an error code (which can be tested with ZSTD_isError()).\n  Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary\n  Note 2 : Prefix buffer is referenced. It **must** outlive decompression.\n           Prefix buffer must remain unmodified up to the end of frame,\n           reached when ZSTD_decompressStream() returns 0.\n  Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent).\n           Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section)\n  Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost.\n           A full dictionary is more costly, as it requires building tables."]
540    pub fn ZSTD_DCtx_refPrefix(
541        dctx: *mut ZSTD_DCtx,
542        prefix: *const ::core::ffi::c_void,
543        prefixSize: usize,
544    ) -> usize;
545}
546extern "C" {
547    #[doc = " ZSTD_sizeof_*() : Requires v1.4.0+\n  These functions give the _current_ memory usage of selected object.\n  Note that object memory usage can evolve (increase or decrease) over time."]
548    pub fn ZSTD_sizeof_CCtx(cctx: *const ZSTD_CCtx) -> usize;
549}
550extern "C" {
551    pub fn ZSTD_sizeof_DCtx(dctx: *const ZSTD_DCtx) -> usize;
552}
553extern "C" {
554    pub fn ZSTD_sizeof_CStream(zcs: *const ZSTD_CStream) -> usize;
555}
556extern "C" {
557    pub fn ZSTD_sizeof_DStream(zds: *const ZSTD_DStream) -> usize;
558}
559extern "C" {
560    pub fn ZSTD_sizeof_CDict(cdict: *const ZSTD_CDict) -> usize;
561}
562extern "C" {
563    pub fn ZSTD_sizeof_DDict(ddict: *const ZSTD_DDict) -> usize;
564}
565extern "C" {
566    #[doc = " ZDICT_trainFromBuffer():\n  Train a dictionary from an array of samples.\n  Redirect towards ZDICT_optimizeTrainFromBuffer_fastCover() single-threaded, with d=8, steps=4,\n  f=20, and accel=1.\n  Samples must be stored concatenated in a single flat buffer `samplesBuffer`,\n  supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order.\n  The resulting dictionary will be saved into `dictBuffer`.\n @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)\n          or an error code, which can be tested with ZDICT_isError().\n  Note:  Dictionary training will fail if there are not enough samples to construct a\n         dictionary, or if most of the samples are too small (< 8 bytes being the lower limit).\n         If dictionary training fails, you should use zstd without a dictionary, as the dictionary\n         would've been ineffective anyways. If you believe your samples would benefit from a dictionary\n         please open an issue with details, and we can look into it.\n  Note: ZDICT_trainFromBuffer()'s memory usage is about 6 MB.\n  Tips: In general, a reasonable dictionary has a size of ~ 100 KB.\n        It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`.\n        In general, it's recommended to provide a few thousands samples, though this can vary a lot.\n        It's recommended that total size of all samples be about ~x100 times the target size of dictionary."]
567    pub fn ZDICT_trainFromBuffer(
568        dictBuffer: *mut ::core::ffi::c_void,
569        dictBufferCapacity: usize,
570        samplesBuffer: *const ::core::ffi::c_void,
571        samplesSizes: *const usize,
572        nbSamples: ::core::ffi::c_uint,
573    ) -> usize;
574}
575#[repr(C)]
576#[derive(Debug, Copy, Clone)]
577pub struct ZDICT_params_t {
578    #[doc = "< optimize for a specific zstd compression level; 0 means default"]
579    pub compressionLevel: ::core::ffi::c_int,
580    #[doc = "< Write log to stderr; 0 = none (default); 1 = errors; 2 = progression; 3 = details; 4 = debug;"]
581    pub notificationLevel: ::core::ffi::c_uint,
582    #[doc = "< force dictID value; 0 means auto mode (32-bits random value)\n   NOTE: The zstd format reserves some dictionary IDs for future use.\n         You may use them in private settings, but be warned that they\n         may be used by zstd in a public dictionary registry in the future.\n         These dictionary IDs are:\n           - low range  : <= 32767\n           - high range : >= (2^31)"]
583    pub dictID: ::core::ffi::c_uint,
584}
585extern "C" {
586    #[doc = " ZDICT_finalizeDictionary():\n Given a custom content as a basis for dictionary, and a set of samples,\n finalize dictionary by adding headers and statistics according to the zstd\n dictionary format.\n\n Samples must be stored concatenated in a flat buffer `samplesBuffer`,\n supplied with an array of sizes `samplesSizes`, providing the size of each\n sample in order. The samples are used to construct the statistics, so they\n should be representative of what you will compress with this dictionary.\n\n The compression level can be set in `parameters`. You should pass the\n compression level you expect to use in production. The statistics for each\n compression level differ, so tuning the dictionary for the compression level\n can help quite a bit.\n\n You can set an explicit dictionary ID in `parameters`, or allow us to pick\n a random dictionary ID for you, but we can't guarantee no collisions.\n\n The dstDictBuffer and the dictContent may overlap, and the content will be\n appended to the end of the header. If the header + the content doesn't fit in\n maxDictSize the beginning of the content is truncated to make room, since it\n is presumed that the most profitable content is at the end of the dictionary,\n since that is the cheapest to reference.\n\n `maxDictSize` must be >= max(dictContentSize, ZDICT_DICTSIZE_MIN).\n\n @return: size of dictionary stored into `dstDictBuffer` (<= `maxDictSize`),\n          or an error code, which can be tested by ZDICT_isError().\n Note: ZDICT_finalizeDictionary() will push notifications into stderr if\n       instructed to, using notificationLevel>0.\n NOTE: This function currently may fail in several edge cases including:\n         * Not enough samples\n         * Samples are uncompressible\n         * Samples are all exactly the same"]
587    pub fn ZDICT_finalizeDictionary(
588        dstDictBuffer: *mut ::core::ffi::c_void,
589        maxDictSize: usize,
590        dictContent: *const ::core::ffi::c_void,
591        dictContentSize: usize,
592        samplesBuffer: *const ::core::ffi::c_void,
593        samplesSizes: *const usize,
594        nbSamples: ::core::ffi::c_uint,
595        parameters: ZDICT_params_t,
596    ) -> usize;
597}
598extern "C" {
599    pub fn ZDICT_getDictID(
600        dictBuffer: *const ::core::ffi::c_void,
601        dictSize: usize,
602    ) -> ::core::ffi::c_uint;
603}
604extern "C" {
605    pub fn ZDICT_getDictHeaderSize(
606        dictBuffer: *const ::core::ffi::c_void,
607        dictSize: usize,
608    ) -> usize;
609}
610extern "C" {
611    pub fn ZDICT_isError(errorCode: usize) -> ::core::ffi::c_uint;
612}
613extern "C" {
614    pub fn ZDICT_getErrorName(errorCode: usize) -> *const ::core::ffi::c_char;
615}