1 /*
2 This file is auto-generated from the public API of the zstd library.
3 It is released under the same BSD license.
4
5 BSD License
6
7 For Zstandard software
8
9 Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
10
11 Redistribution and use in source and binary forms, with or without modification,
12 are permitted provided that the following conditions are met:
13
14 * Redistributions of source code must retain the above copyright notice, this
15 list of conditions and the following disclaimer.
16
17 * Redistributions in binary form must reproduce the above copyright notice,
18 this list of conditions and the following disclaimer in the documentation
19 and/or other materials provided with the distribution.
20
21 * Neither the name Facebook nor the names of its contributors may be used to
22 endorse or promote products derived from this software without specific
23 prior written permission.
24
25 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
29 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
32 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36 /* automatically generated by rust-bindgen 0.56.0 */
37
38 pub const _LIBC_LIMITS_H_: u32 = 1;
39 pub const _FEATURES_H: u32 = 1;
40 pub const _DEFAULT_SOURCE: u32 = 1;
41 pub const __GLIBC_USE_ISOC2X: u32 = 0;
42 pub const __USE_ISOC11: u32 = 1;
43 pub const __USE_ISOC99: u32 = 1;
44 pub const __USE_ISOC95: u32 = 1;
45 pub const __USE_POSIX_IMPLICITLY: u32 = 1;
46 pub const _POSIX_SOURCE: u32 = 1;
47 pub const _POSIX_C_SOURCE: u32 = 200809;
48 pub const __USE_POSIX: u32 = 1;
49 pub const __USE_POSIX2: u32 = 1;
50 pub const __USE_POSIX199309: u32 = 1;
51 pub const __USE_POSIX199506: u32 = 1;
52 pub const __USE_XOPEN2K: u32 = 1;
53 pub const __USE_XOPEN2K8: u32 = 1;
54 pub const _ATFILE_SOURCE: u32 = 1;
55 pub const __USE_MISC: u32 = 1;
56 pub const __USE_ATFILE: u32 = 1;
57 pub const __USE_FORTIFY_LEVEL: u32 = 0;
58 pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
59 pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
60 pub const _STDC_PREDEF_H: u32 = 1;
61 pub const __STDC_IEC_559__: u32 = 1;
62 pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
63 pub const __STDC_ISO_10646__: u32 = 201706;
64 pub const __GNU_LIBRARY__: u32 = 6;
65 pub const __GLIBC__: u32 = 2;
66 pub const __GLIBC_MINOR__: u32 = 32;
67 pub const _SYS_CDEFS_H: u32 = 1;
68 pub const __glibc_c99_flexarr_available: u32 = 1;
69 pub const __WORDSIZE: u32 = 64;
70 pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
71 pub const __SYSCALL_WORDSIZE: u32 = 64;
72 pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
73 pub const __HAVE_GENERIC_SELECTION: u32 = 1;
74 pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
75 pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
76 pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
77 pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
78 pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
79 pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
80 pub const MB_LEN_MAX: u32 = 16;
81 pub const _BITS_POSIX1_LIM_H: u32 = 1;
82 pub const _POSIX_AIO_LISTIO_MAX: u32 = 2;
83 pub const _POSIX_AIO_MAX: u32 = 1;
84 pub const _POSIX_ARG_MAX: u32 = 4096;
85 pub const _POSIX_CHILD_MAX: u32 = 25;
86 pub const _POSIX_DELAYTIMER_MAX: u32 = 32;
87 pub const _POSIX_HOST_NAME_MAX: u32 = 255;
88 pub const _POSIX_LINK_MAX: u32 = 8;
89 pub const _POSIX_LOGIN_NAME_MAX: u32 = 9;
90 pub const _POSIX_MAX_CANON: u32 = 255;
91 pub const _POSIX_MAX_INPUT: u32 = 255;
92 pub const _POSIX_MQ_OPEN_MAX: u32 = 8;
93 pub const _POSIX_MQ_PRIO_MAX: u32 = 32;
94 pub const _POSIX_NAME_MAX: u32 = 14;
95 pub const _POSIX_NGROUPS_MAX: u32 = 8;
96 pub const _POSIX_OPEN_MAX: u32 = 20;
97 pub const _POSIX_PATH_MAX: u32 = 256;
98 pub const _POSIX_PIPE_BUF: u32 = 512;
99 pub const _POSIX_RE_DUP_MAX: u32 = 255;
100 pub const _POSIX_RTSIG_MAX: u32 = 8;
101 pub const _POSIX_SEM_NSEMS_MAX: u32 = 256;
102 pub const _POSIX_SEM_VALUE_MAX: u32 = 32767;
103 pub const _POSIX_SIGQUEUE_MAX: u32 = 32;
104 pub const _POSIX_SSIZE_MAX: u32 = 32767;
105 pub const _POSIX_STREAM_MAX: u32 = 8;
106 pub const _POSIX_SYMLINK_MAX: u32 = 255;
107 pub const _POSIX_SYMLOOP_MAX: u32 = 8;
108 pub const _POSIX_TIMER_MAX: u32 = 32;
109 pub const _POSIX_TTY_NAME_MAX: u32 = 9;
110 pub const _POSIX_TZNAME_MAX: u32 = 6;
111 pub const _POSIX_CLOCKRES_MIN: u32 = 20000000;
112 pub const NR_OPEN: u32 = 1024;
113 pub const NGROUPS_MAX: u32 = 65536;
114 pub const ARG_MAX: u32 = 131072;
115 pub const LINK_MAX: u32 = 127;
116 pub const MAX_CANON: u32 = 255;
117 pub const MAX_INPUT: u32 = 255;
118 pub const NAME_MAX: u32 = 255;
119 pub const PATH_MAX: u32 = 4096;
120 pub const PIPE_BUF: u32 = 4096;
121 pub const XATTR_NAME_MAX: u32 = 255;
122 pub const XATTR_SIZE_MAX: u32 = 65536;
123 pub const XATTR_LIST_MAX: u32 = 65536;
124 pub const RTSIG_MAX: u32 = 32;
125 pub const _POSIX_THREAD_KEYS_MAX: u32 = 128;
126 pub const PTHREAD_KEYS_MAX: u32 = 1024;
127 pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
128 pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
129 pub const _POSIX_THREAD_THREADS_MAX: u32 = 64;
130 pub const AIO_PRIO_DELTA_MAX: u32 = 20;
131 pub const PTHREAD_STACK_MIN: u32 = 16384;
132 pub const DELAYTIMER_MAX: u32 = 2147483647;
133 pub const TTY_NAME_MAX: u32 = 32;
134 pub const LOGIN_NAME_MAX: u32 = 256;
135 pub const HOST_NAME_MAX: u32 = 64;
136 pub const MQ_PRIO_MAX: u32 = 32768;
137 pub const SEM_VALUE_MAX: u32 = 2147483647;
138 pub const _BITS_POSIX2_LIM_H: u32 = 1;
139 pub const _POSIX2_BC_BASE_MAX: u32 = 99;
140 pub const _POSIX2_BC_DIM_MAX: u32 = 2048;
141 pub const _POSIX2_BC_SCALE_MAX: u32 = 99;
142 pub const _POSIX2_BC_STRING_MAX: u32 = 1000;
143 pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2;
144 pub const _POSIX2_EXPR_NEST_MAX: u32 = 32;
145 pub const _POSIX2_LINE_MAX: u32 = 2048;
146 pub const _POSIX2_RE_DUP_MAX: u32 = 255;
147 pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14;
148 pub const BC_BASE_MAX: u32 = 99;
149 pub const BC_DIM_MAX: u32 = 2048;
150 pub const BC_SCALE_MAX: u32 = 99;
151 pub const BC_STRING_MAX: u32 = 1000;
152 pub const COLL_WEIGHTS_MAX: u32 = 255;
153 pub const EXPR_NEST_MAX: u32 = 32;
154 pub const LINE_MAX: u32 = 2048;
155 pub const CHARCLASS_NAME_MAX: u32 = 2048;
156 pub const RE_DUP_MAX: u32 = 32767;
157 pub const ZSTD_VERSION_MAJOR: u32 = 1;
158 pub const ZSTD_VERSION_MINOR: u32 = 4;
159 pub const ZSTD_VERSION_RELEASE: u32 = 8;
160 pub const ZSTD_VERSION_NUMBER: u32 = 10408;
161 pub const ZSTD_CLEVEL_DEFAULT: u32 = 3;
162 pub const ZSTD_MAGICNUMBER: u32 = 4247762216;
163 pub const ZSTD_MAGIC_DICTIONARY: u32 = 3962610743;
164 pub const ZSTD_MAGIC_SKIPPABLE_START: u32 = 407710288;
165 pub const ZSTD_MAGIC_SKIPPABLE_MASK: u32 = 4294967280;
166 pub const ZSTD_BLOCKSIZELOG_MAX: u32 = 17;
167 pub const ZSTD_BLOCKSIZE_MAX: u32 = 131072;
168 pub const ZSTD_CONTENTSIZE_UNKNOWN: i32 = -1;
169 pub const ZSTD_CONTENTSIZE_ERROR: i32 = -2;
170 pub const ZSTD_FRAMEHEADERSIZE_MAX: u32 = 18;
171 pub const ZSTD_SKIPPABLEHEADERSIZE: u32 = 8;
172 pub const ZSTD_WINDOWLOG_MAX_32: u32 = 30;
173 pub const ZSTD_WINDOWLOG_MAX_64: u32 = 31;
174 pub const ZSTD_WINDOWLOG_MIN: u32 = 10;
175 pub const ZSTD_HASHLOG_MIN: u32 = 6;
176 pub const ZSTD_CHAINLOG_MAX_32: u32 = 29;
177 pub const ZSTD_CHAINLOG_MAX_64: u32 = 30;
178 pub const ZSTD_CHAINLOG_MIN: u32 = 6;
179 pub const ZSTD_SEARCHLOG_MIN: u32 = 1;
180 pub const ZSTD_MINMATCH_MAX: u32 = 7;
181 pub const ZSTD_MINMATCH_MIN: u32 = 3;
182 pub const ZSTD_TARGETLENGTH_MAX: u32 = 131072;
183 pub const ZSTD_TARGETLENGTH_MIN: u32 = 0;
184 pub const ZSTD_OVERLAPLOG_MIN: u32 = 0;
185 pub const ZSTD_OVERLAPLOG_MAX: u32 = 9;
186 pub const ZSTD_WINDOWLOG_LIMIT_DEFAULT: u32 = 27;
187 pub const ZSTD_LDM_HASHLOG_MIN: u32 = 6;
188 pub const ZSTD_LDM_MINMATCH_MIN: u32 = 4;
189 pub const ZSTD_LDM_MINMATCH_MAX: u32 = 4096;
190 pub const ZSTD_LDM_BUCKETSIZELOG_MIN: u32 = 1;
191 pub const ZSTD_LDM_BUCKETSIZELOG_MAX: u32 = 8;
192 pub const ZSTD_LDM_HASHRATELOG_MIN: u32 = 0;
193 pub const ZSTD_TARGETCBLOCKSIZE_MIN: u32 = 64;
194 pub const ZSTD_TARGETCBLOCKSIZE_MAX: u32 = 131072;
195 pub const ZSTD_SRCSIZEHINT_MIN: u32 = 0;
196 pub const ZSTD_HASHLOG3_MAX: u32 = 17;
197 pub const ZDICT_CONTENTSIZE_MIN: u32 = 128;
198 pub const ZDICT_DICTSIZE_MIN: u32 = 256;
199 pub const _STRING_H: u32 = 1;
200 pub const _BITS_TYPES_LOCALE_T_H: u32 = 1;
201 pub const _BITS_TYPES___LOCALE_T_H: u32 = 1;
202 pub const _STRINGS_H: u32 = 1;
203 pub const ZSTDMT_NBWORKERS_MAX: u32 = 200;
204 pub type wchar_t = ::std::os::raw::c_int;
205 extern "C" {
206 #[doc = " ZSTD_versionNumber() :"]
207 #[doc = " Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE)."]
ZSTD_versionNumber() -> ::std::os::raw::c_uint208 pub fn ZSTD_versionNumber() -> ::std::os::raw::c_uint;
209 }
210 extern "C" {
211 #[doc = " ZSTD_versionString() :"]
212 #[doc = " Return runtime library version, like \"1.4.5\". Requires v1.3.0+."]
ZSTD_versionString() -> *const ::std::os::raw::c_char213 pub fn ZSTD_versionString() -> *const ::std::os::raw::c_char;
214 }
215 extern "C" {
216 #[doc = " Simple API"]
217 #[doc = " Compresses `src` content as a single zstd compressed frame into already allocated `dst`."]
218 #[doc = " Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`."]
219 #[doc = " @return : compressed size written into `dst` (<= `dstCapacity),"]
220 #[doc = " or an error code if it fails (which can be tested using ZSTD_isError())."]
ZSTD_compress( dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize221 pub fn ZSTD_compress(
222 dst: *mut ::core::ffi::c_void,
223 dstCapacity: usize,
224 src: *const ::core::ffi::c_void,
225 srcSize: usize,
226 compressionLevel: ::std::os::raw::c_int,
227 ) -> usize;
228 }
229 extern "C" {
230 #[doc = " ZSTD_decompress() :"]
231 #[doc = " `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames."]
232 #[doc = " `dstCapacity` is an upper bound of originalSize to regenerate."]
233 #[doc = " If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data."]
234 #[doc = " @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),"]
235 #[doc = " or an errorCode if it fails (which can be tested using ZSTD_isError())."]
ZSTD_decompress( dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, compressedSize: usize, ) -> usize236 pub fn ZSTD_decompress(
237 dst: *mut ::core::ffi::c_void,
238 dstCapacity: usize,
239 src: *const ::core::ffi::c_void,
240 compressedSize: usize,
241 ) -> usize;
242 }
243 extern "C" {
ZSTD_getFrameContentSize( src: *const ::core::ffi::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong244 pub fn ZSTD_getFrameContentSize(
245 src: *const ::core::ffi::c_void,
246 srcSize: usize,
247 ) -> ::std::os::raw::c_ulonglong;
248 }
249 extern "C" {
250 #[doc = " ZSTD_getDecompressedSize() :"]
251 #[doc = " NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize()."]
252 #[doc = " Both functions work the same way, but ZSTD_getDecompressedSize() blends"]
253 #[doc = " \"empty\", \"unknown\" and \"error\" results to the same return value (0),"]
254 #[doc = " while ZSTD_getFrameContentSize() gives them separate return values."]
255 #[doc = " @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise."]
ZSTD_getDecompressedSize( src: *const ::core::ffi::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong256 pub fn ZSTD_getDecompressedSize(
257 src: *const ::core::ffi::c_void,
258 srcSize: usize,
259 ) -> ::std::os::raw::c_ulonglong;
260 }
261 extern "C" {
262 #[doc = " ZSTD_findFrameCompressedSize() :"]
263 #[doc = " `src` should point to the start of a ZSTD frame or skippable frame."]
264 #[doc = " `srcSize` must be >= first frame size"]
265 #[doc = " @return : the compressed size of the first frame starting at `src`,"]
266 #[doc = " suitable to pass as `srcSize` to `ZSTD_decompress` or similar,"]
267 #[doc = " or an error code if input is invalid"]
ZSTD_findFrameCompressedSize( src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize268 pub fn ZSTD_findFrameCompressedSize(
269 src: *const ::core::ffi::c_void,
270 srcSize: usize,
271 ) -> usize;
272 }
273 extern "C" {
ZSTD_compressBound(srcSize: usize) -> usize274 pub fn ZSTD_compressBound(srcSize: usize) -> usize;
275 }
276 extern "C" {
ZSTD_isError(code: usize) -> ::std::os::raw::c_uint277 pub fn ZSTD_isError(code: usize) -> ::std::os::raw::c_uint;
278 }
279 extern "C" {
ZSTD_getErrorName(code: usize) -> *const ::std::os::raw::c_char280 pub fn ZSTD_getErrorName(code: usize) -> *const ::std::os::raw::c_char;
281 }
282 extern "C" {
ZSTD_minCLevel() -> ::std::os::raw::c_int283 pub fn ZSTD_minCLevel() -> ::std::os::raw::c_int;
284 }
285 extern "C" {
ZSTD_maxCLevel() -> ::std::os::raw::c_int286 pub fn ZSTD_maxCLevel() -> ::std::os::raw::c_int;
287 }
288 #[repr(C)]
289 #[derive(Debug, Copy, Clone)]
290 pub struct ZSTD_CCtx_s {
291 _unused: [u8; 0],
292 }
293 #[doc = " Explicit context"]
294 pub type ZSTD_CCtx = ZSTD_CCtx_s;
295 extern "C" {
ZSTD_createCCtx() -> *mut ZSTD_CCtx296 pub fn ZSTD_createCCtx() -> *mut ZSTD_CCtx;
297 }
298 extern "C" {
ZSTD_freeCCtx(cctx: *mut ZSTD_CCtx) -> usize299 pub fn ZSTD_freeCCtx(cctx: *mut ZSTD_CCtx) -> usize;
300 }
301 extern "C" {
302 #[doc = " ZSTD_compressCCtx() :"]
303 #[doc = " Same as ZSTD_compress(), using an explicit ZSTD_CCtx."]
304 #[doc = " Important : in order to behave similarly to `ZSTD_compress()`,"]
305 #[doc = " this function compresses at requested compression level,"]
306 #[doc = " __ignoring any other parameter__ ."]
307 #[doc = " If any advanced parameter was set using the advanced API,"]
308 #[doc = " they will all be reset. Only `compressionLevel` remains."]
ZSTD_compressCCtx( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize309 pub fn ZSTD_compressCCtx(
310 cctx: *mut ZSTD_CCtx,
311 dst: *mut ::core::ffi::c_void,
312 dstCapacity: usize,
313 src: *const ::core::ffi::c_void,
314 srcSize: usize,
315 compressionLevel: ::std::os::raw::c_int,
316 ) -> usize;
317 }
318 #[repr(C)]
319 #[derive(Debug, Copy, Clone)]
320 pub struct ZSTD_DCtx_s {
321 _unused: [u8; 0],
322 }
323 pub type ZSTD_DCtx = ZSTD_DCtx_s;
324 extern "C" {
ZSTD_createDCtx() -> *mut ZSTD_DCtx325 pub fn ZSTD_createDCtx() -> *mut ZSTD_DCtx;
326 }
327 extern "C" {
ZSTD_freeDCtx(dctx: *mut ZSTD_DCtx) -> usize328 pub fn ZSTD_freeDCtx(dctx: *mut ZSTD_DCtx) -> usize;
329 }
330 extern "C" {
331 #[doc = " ZSTD_decompressDCtx() :"]
332 #[doc = " Same as ZSTD_decompress(),"]
333 #[doc = " requires an allocated ZSTD_DCtx."]
334 #[doc = " Compatible with sticky parameters."]
ZSTD_decompressDCtx( dctx: *mut ZSTD_DCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize335 pub fn ZSTD_decompressDCtx(
336 dctx: *mut ZSTD_DCtx,
337 dst: *mut ::core::ffi::c_void,
338 dstCapacity: usize,
339 src: *const ::core::ffi::c_void,
340 srcSize: usize,
341 ) -> usize;
342 }
343 #[repr(u32)]
344 #[doc = " Advanced compression API"]
345 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
346 pub enum ZSTD_strategy {
347 ZSTD_fast = 1,
348 ZSTD_dfast = 2,
349 ZSTD_greedy = 3,
350 ZSTD_lazy = 4,
351 ZSTD_lazy2 = 5,
352 ZSTD_btlazy2 = 6,
353 ZSTD_btopt = 7,
354 ZSTD_btultra = 8,
355 ZSTD_btultra2 = 9,
356 }
357 #[repr(u32)]
358 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
359 pub enum ZSTD_cParameter {
360 ZSTD_c_compressionLevel = 100,
361 ZSTD_c_windowLog = 101,
362 ZSTD_c_hashLog = 102,
363 ZSTD_c_chainLog = 103,
364 ZSTD_c_searchLog = 104,
365 ZSTD_c_minMatch = 105,
366 ZSTD_c_targetLength = 106,
367 ZSTD_c_strategy = 107,
368 ZSTD_c_enableLongDistanceMatching = 160,
369 ZSTD_c_ldmHashLog = 161,
370 ZSTD_c_ldmMinMatch = 162,
371 ZSTD_c_ldmBucketSizeLog = 163,
372 ZSTD_c_ldmHashRateLog = 164,
373 ZSTD_c_contentSizeFlag = 200,
374 ZSTD_c_checksumFlag = 201,
375 ZSTD_c_dictIDFlag = 202,
376 ZSTD_c_nbWorkers = 400,
377 ZSTD_c_jobSize = 401,
378 ZSTD_c_overlapLog = 402,
379 ZSTD_c_experimentalParam1 = 500,
380 ZSTD_c_experimentalParam2 = 10,
381 ZSTD_c_experimentalParam3 = 1000,
382 ZSTD_c_experimentalParam4 = 1001,
383 ZSTD_c_experimentalParam5 = 1002,
384 ZSTD_c_experimentalParam6 = 1003,
385 ZSTD_c_experimentalParam7 = 1004,
386 ZSTD_c_experimentalParam8 = 1005,
387 ZSTD_c_experimentalParam9 = 1006,
388 ZSTD_c_experimentalParam10 = 1007,
389 ZSTD_c_experimentalParam11 = 1008,
390 ZSTD_c_experimentalParam12 = 1009,
391 }
392 #[repr(C)]
393 #[derive(Debug, Copy, Clone)]
394 pub struct ZSTD_bounds {
395 pub error: usize,
396 pub lowerBound: ::std::os::raw::c_int,
397 pub upperBound: ::std::os::raw::c_int,
398 }
399 #[test]
bindgen_test_layout_ZSTD_bounds()400 fn bindgen_test_layout_ZSTD_bounds() {
401 assert_eq!(
402 ::core::mem::size_of::<ZSTD_bounds>(),
403 16usize,
404 concat!("Size of: ", stringify!(ZSTD_bounds))
405 );
406 assert_eq!(
407 ::core::mem::align_of::<ZSTD_bounds>(),
408 8usize,
409 concat!("Alignment of ", stringify!(ZSTD_bounds))
410 );
411 assert_eq!(
412 unsafe {
413 &(*(::core::ptr::null::<ZSTD_bounds>())).error as *const _ as usize
414 },
415 0usize,
416 concat!(
417 "Offset of field: ",
418 stringify!(ZSTD_bounds),
419 "::",
420 stringify!(error)
421 )
422 );
423 assert_eq!(
424 unsafe {
425 &(*(::core::ptr::null::<ZSTD_bounds>())).lowerBound as *const _
426 as usize
427 },
428 8usize,
429 concat!(
430 "Offset of field: ",
431 stringify!(ZSTD_bounds),
432 "::",
433 stringify!(lowerBound)
434 )
435 );
436 assert_eq!(
437 unsafe {
438 &(*(::core::ptr::null::<ZSTD_bounds>())).upperBound as *const _
439 as usize
440 },
441 12usize,
442 concat!(
443 "Offset of field: ",
444 stringify!(ZSTD_bounds),
445 "::",
446 stringify!(upperBound)
447 )
448 );
449 }
450 extern "C" {
451 #[doc = " ZSTD_cParam_getBounds() :"]
452 #[doc = " All parameters must belong to an interval with lower and upper bounds,"]
453 #[doc = " otherwise they will either trigger an error or be automatically clamped."]
454 #[doc = " @return : a structure, ZSTD_bounds, which contains"]
455 #[doc = " - an error status field, which must be tested using ZSTD_isError()"]
456 #[doc = " - lower and upper bounds, both inclusive"]
ZSTD_cParam_getBounds(cParam: ZSTD_cParameter) -> ZSTD_bounds457 pub fn ZSTD_cParam_getBounds(cParam: ZSTD_cParameter) -> ZSTD_bounds;
458 }
459 extern "C" {
460 #[doc = " ZSTD_CCtx_setParameter() :"]
461 #[doc = " Set one compression parameter, selected by enum ZSTD_cParameter."]
462 #[doc = " All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds()."]
463 #[doc = " Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter)."]
464 #[doc = " Setting a parameter is generally only possible during frame initialization (before starting compression)."]
465 #[doc = " Exception : when using multi-threading mode (nbWorkers >= 1),"]
466 #[doc = " the following parameters can be updated _during_ compression (within same frame):"]
467 #[doc = " => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy."]
468 #[doc = " new parameters will be active for next job only (after a flush())."]
469 #[doc = " @return : an error code (which can be tested using ZSTD_isError())."]
ZSTD_CCtx_setParameter( cctx: *mut ZSTD_CCtx, param: ZSTD_cParameter, value: ::std::os::raw::c_int, ) -> usize470 pub fn ZSTD_CCtx_setParameter(
471 cctx: *mut ZSTD_CCtx,
472 param: ZSTD_cParameter,
473 value: ::std::os::raw::c_int,
474 ) -> usize;
475 }
476 extern "C" {
477 #[doc = " ZSTD_CCtx_setPledgedSrcSize() :"]
478 #[doc = " Total input data size to be compressed as a single frame."]
479 #[doc = " Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag."]
480 #[doc = " This value will also be controlled at end of frame, and trigger an error if not respected."]
481 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
482 #[doc = " Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame."]
483 #[doc = " In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN."]
484 #[doc = " ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame."]
485 #[doc = " Note 2 : pledgedSrcSize is only valid once, for the next frame."]
486 #[doc = " It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN."]
487 #[doc = " Note 3 : Whenever all input data is provided and consumed in a single round,"]
488 #[doc = " for example with ZSTD_compress2(),"]
489 #[doc = " or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end),"]
490 #[doc = " this value is automatically overridden by srcSize instead."]
ZSTD_CCtx_setPledgedSrcSize( cctx: *mut ZSTD_CCtx, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize491 pub fn ZSTD_CCtx_setPledgedSrcSize(
492 cctx: *mut ZSTD_CCtx,
493 pledgedSrcSize: ::std::os::raw::c_ulonglong,
494 ) -> usize;
495 }
496 #[repr(u32)]
497 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
498 pub enum ZSTD_ResetDirective {
499 ZSTD_reset_session_only = 1,
500 ZSTD_reset_parameters = 2,
501 ZSTD_reset_session_and_parameters = 3,
502 }
503 extern "C" {
504 #[doc = " ZSTD_CCtx_reset() :"]
505 #[doc = " There are 2 different things that can be reset, independently or jointly :"]
506 #[doc = " - The session : will stop compressing current frame, and make CCtx ready to start a new one."]
507 #[doc = " Useful after an error, or to interrupt any ongoing compression."]
508 #[doc = " Any internal data not yet flushed is cancelled."]
509 #[doc = " Compression parameters and dictionary remain unchanged."]
510 #[doc = " They will be used to compress next frame."]
511 #[doc = " Resetting session never fails."]
512 #[doc = " - The parameters : changes all parameters back to \"default\"."]
513 #[doc = " This removes any reference to any dictionary too."]
514 #[doc = " Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing)"]
515 #[doc = " otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError())"]
516 #[doc = " - Both : similar to resetting the session, followed by resetting parameters."]
ZSTD_CCtx_reset( cctx: *mut ZSTD_CCtx, reset: ZSTD_ResetDirective, ) -> usize517 pub fn ZSTD_CCtx_reset(
518 cctx: *mut ZSTD_CCtx,
519 reset: ZSTD_ResetDirective,
520 ) -> usize;
521 }
522 extern "C" {
523 #[doc = " ZSTD_compress2() :"]
524 #[doc = " Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API."]
525 #[doc = " ZSTD_compress2() always starts a new frame."]
526 #[doc = " Should cctx hold data from a previously unfinished frame, everything about it is forgotten."]
527 #[doc = " - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()"]
528 #[doc = " - The function is always blocking, returns when compression is completed."]
529 #[doc = " Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`."]
530 #[doc = " @return : compressed size written into `dst` (<= `dstCapacity),"]
531 #[doc = " or an error code if it fails (which can be tested using ZSTD_isError())."]
ZSTD_compress2( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize532 pub fn ZSTD_compress2(
533 cctx: *mut ZSTD_CCtx,
534 dst: *mut ::core::ffi::c_void,
535 dstCapacity: usize,
536 src: *const ::core::ffi::c_void,
537 srcSize: usize,
538 ) -> usize;
539 }
540 #[repr(u32)]
541 #[doc = " Advanced decompression API"]
542 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
543 pub enum ZSTD_dParameter {
544 ZSTD_d_windowLogMax = 100,
545 ZSTD_d_experimentalParam1 = 1000,
546 ZSTD_d_experimentalParam2 = 1001,
547 ZSTD_d_experimentalParam3 = 1002,
548 }
549 extern "C" {
550 #[doc = " ZSTD_dParam_getBounds() :"]
551 #[doc = " All parameters must belong to an interval with lower and upper bounds,"]
552 #[doc = " otherwise they will either trigger an error or be automatically clamped."]
553 #[doc = " @return : a structure, ZSTD_bounds, which contains"]
554 #[doc = " - an error status field, which must be tested using ZSTD_isError()"]
555 #[doc = " - both lower and upper bounds, inclusive"]
ZSTD_dParam_getBounds(dParam: ZSTD_dParameter) -> ZSTD_bounds556 pub fn ZSTD_dParam_getBounds(dParam: ZSTD_dParameter) -> ZSTD_bounds;
557 }
558 extern "C" {
559 #[doc = " ZSTD_DCtx_setParameter() :"]
560 #[doc = " Set one compression parameter, selected by enum ZSTD_dParameter."]
561 #[doc = " All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds()."]
562 #[doc = " Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter)."]
563 #[doc = " Setting a parameter is only possible during frame initialization (before starting decompression)."]
564 #[doc = " @return : 0, or an error code (which can be tested using ZSTD_isError())."]
ZSTD_DCtx_setParameter( dctx: *mut ZSTD_DCtx, param: ZSTD_dParameter, value: ::std::os::raw::c_int, ) -> usize565 pub fn ZSTD_DCtx_setParameter(
566 dctx: *mut ZSTD_DCtx,
567 param: ZSTD_dParameter,
568 value: ::std::os::raw::c_int,
569 ) -> usize;
570 }
571 extern "C" {
572 #[doc = " ZSTD_DCtx_reset() :"]
573 #[doc = " Return a DCtx to clean state."]
574 #[doc = " Session and parameters can be reset jointly or separately."]
575 #[doc = " Parameters can only be reset when no active frame is being decompressed."]
576 #[doc = " @return : 0, or an error code, which can be tested with ZSTD_isError()"]
ZSTD_DCtx_reset( dctx: *mut ZSTD_DCtx, reset: ZSTD_ResetDirective, ) -> usize577 pub fn ZSTD_DCtx_reset(
578 dctx: *mut ZSTD_DCtx,
579 reset: ZSTD_ResetDirective,
580 ) -> usize;
581 }
582 #[doc = " Streaming"]
583 #[repr(C)]
584 #[derive(Debug, Copy, Clone)]
585 pub struct ZSTD_inBuffer_s {
586 #[doc = "< start of input buffer"]
587 pub src: *const ::core::ffi::c_void,
588 #[doc = "< size of input buffer"]
589 pub size: usize,
590 #[doc = "< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size"]
591 pub pos: usize,
592 }
593 #[test]
bindgen_test_layout_ZSTD_inBuffer_s()594 fn bindgen_test_layout_ZSTD_inBuffer_s() {
595 assert_eq!(
596 ::core::mem::size_of::<ZSTD_inBuffer_s>(),
597 24usize,
598 concat!("Size of: ", stringify!(ZSTD_inBuffer_s))
599 );
600 assert_eq!(
601 ::core::mem::align_of::<ZSTD_inBuffer_s>(),
602 8usize,
603 concat!("Alignment of ", stringify!(ZSTD_inBuffer_s))
604 );
605 assert_eq!(
606 unsafe {
607 &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).src as *const _
608 as usize
609 },
610 0usize,
611 concat!(
612 "Offset of field: ",
613 stringify!(ZSTD_inBuffer_s),
614 "::",
615 stringify!(src)
616 )
617 );
618 assert_eq!(
619 unsafe {
620 &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).size as *const _
621 as usize
622 },
623 8usize,
624 concat!(
625 "Offset of field: ",
626 stringify!(ZSTD_inBuffer_s),
627 "::",
628 stringify!(size)
629 )
630 );
631 assert_eq!(
632 unsafe {
633 &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).pos as *const _
634 as usize
635 },
636 16usize,
637 concat!(
638 "Offset of field: ",
639 stringify!(ZSTD_inBuffer_s),
640 "::",
641 stringify!(pos)
642 )
643 );
644 }
645 #[doc = " Streaming"]
646 pub type ZSTD_inBuffer = ZSTD_inBuffer_s;
647 #[repr(C)]
648 #[derive(Debug, Copy, Clone)]
649 pub struct ZSTD_outBuffer_s {
650 #[doc = "< start of output buffer"]
651 pub dst: *mut ::core::ffi::c_void,
652 #[doc = "< size of output buffer"]
653 pub size: usize,
654 #[doc = "< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size"]
655 pub pos: usize,
656 }
657 #[test]
bindgen_test_layout_ZSTD_outBuffer_s()658 fn bindgen_test_layout_ZSTD_outBuffer_s() {
659 assert_eq!(
660 ::core::mem::size_of::<ZSTD_outBuffer_s>(),
661 24usize,
662 concat!("Size of: ", stringify!(ZSTD_outBuffer_s))
663 );
664 assert_eq!(
665 ::core::mem::align_of::<ZSTD_outBuffer_s>(),
666 8usize,
667 concat!("Alignment of ", stringify!(ZSTD_outBuffer_s))
668 );
669 assert_eq!(
670 unsafe {
671 &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).dst as *const _
672 as usize
673 },
674 0usize,
675 concat!(
676 "Offset of field: ",
677 stringify!(ZSTD_outBuffer_s),
678 "::",
679 stringify!(dst)
680 )
681 );
682 assert_eq!(
683 unsafe {
684 &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).size as *const _
685 as usize
686 },
687 8usize,
688 concat!(
689 "Offset of field: ",
690 stringify!(ZSTD_outBuffer_s),
691 "::",
692 stringify!(size)
693 )
694 );
695 assert_eq!(
696 unsafe {
697 &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).pos as *const _
698 as usize
699 },
700 16usize,
701 concat!(
702 "Offset of field: ",
703 stringify!(ZSTD_outBuffer_s),
704 "::",
705 stringify!(pos)
706 )
707 );
708 }
709 pub type ZSTD_outBuffer = ZSTD_outBuffer_s;
710 pub type ZSTD_CStream = ZSTD_CCtx;
711 extern "C" {
ZSTD_createCStream() -> *mut ZSTD_CStream712 pub fn ZSTD_createCStream() -> *mut ZSTD_CStream;
713 }
714 extern "C" {
ZSTD_freeCStream(zcs: *mut ZSTD_CStream) -> usize715 pub fn ZSTD_freeCStream(zcs: *mut ZSTD_CStream) -> usize;
716 }
717 #[repr(u32)]
718 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
719 pub enum ZSTD_EndDirective {
720 ZSTD_e_continue = 0,
721 ZSTD_e_flush = 1,
722 ZSTD_e_end = 2,
723 }
724 extern "C" {
725 #[doc = " ZSTD_compressStream2() :"]
726 #[doc = " Behaves about the same as ZSTD_compressStream, with additional control on end directive."]
727 #[doc = " - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()"]
728 #[doc = " - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)"]
729 #[doc = " - output->pos must be <= dstCapacity, input->pos must be <= srcSize"]
730 #[doc = " - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit."]
731 #[doc = " - endOp must be a valid directive"]
732 #[doc = " - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller."]
733 #[doc = " - 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,"]
734 #[doc = " and then immediately returns, just indicating that there is some data remaining to be flushed."]
735 #[doc = " The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte."]
736 #[doc = " - 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."]
737 #[doc = " - @return provides a minimum amount of data remaining to be flushed from internal buffers"]
738 #[doc = " or an error code, which can be tested using ZSTD_isError()."]
739 #[doc = " if @return != 0, flush is not fully completed, there is still some data left within internal buffers."]
740 #[doc = " This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers."]
741 #[doc = " For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed."]
742 #[doc = " - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),"]
743 #[doc = " only ZSTD_e_end or ZSTD_e_flush operations are allowed."]
744 #[doc = " Before starting a new compression job, or changing compression parameters,"]
745 #[doc = " it is required to fully flush internal buffers."]
ZSTD_compressStream2( cctx: *mut ZSTD_CCtx, output: *mut ZSTD_outBuffer, input: *mut ZSTD_inBuffer, endOp: ZSTD_EndDirective, ) -> usize746 pub fn ZSTD_compressStream2(
747 cctx: *mut ZSTD_CCtx,
748 output: *mut ZSTD_outBuffer,
749 input: *mut ZSTD_inBuffer,
750 endOp: ZSTD_EndDirective,
751 ) -> usize;
752 }
753 extern "C" {
ZSTD_CStreamInSize() -> usize754 pub fn ZSTD_CStreamInSize() -> usize;
755 }
756 extern "C" {
ZSTD_CStreamOutSize() -> usize757 pub fn ZSTD_CStreamOutSize() -> usize;
758 }
759 extern "C" {
760 #[doc = " Equivalent to:"]
761 #[doc = ""]
762 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
763 #[doc = " ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)"]
764 #[doc = " ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
ZSTD_initCStream( zcs: *mut ZSTD_CStream, compressionLevel: ::std::os::raw::c_int, ) -> usize765 pub fn ZSTD_initCStream(
766 zcs: *mut ZSTD_CStream,
767 compressionLevel: ::std::os::raw::c_int,
768 ) -> usize;
769 }
770 extern "C" {
771 #[doc = " Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue)."]
772 #[doc = " NOTE: The return value is different. ZSTD_compressStream() returns a hint for"]
773 #[doc = " the next read size (if non-zero and not an error). ZSTD_compressStream2()"]
774 #[doc = " returns the minimum nb of bytes left to flush (if non-zero and not an error)."]
ZSTD_compressStream( zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer, input: *mut ZSTD_inBuffer, ) -> usize775 pub fn ZSTD_compressStream(
776 zcs: *mut ZSTD_CStream,
777 output: *mut ZSTD_outBuffer,
778 input: *mut ZSTD_inBuffer,
779 ) -> usize;
780 }
781 extern "C" {
782 #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush)."]
ZSTD_flushStream( zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer, ) -> usize783 pub fn ZSTD_flushStream(
784 zcs: *mut ZSTD_CStream,
785 output: *mut ZSTD_outBuffer,
786 ) -> usize;
787 }
788 extern "C" {
789 #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end)."]
ZSTD_endStream( zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer, ) -> usize790 pub fn ZSTD_endStream(
791 zcs: *mut ZSTD_CStream,
792 output: *mut ZSTD_outBuffer,
793 ) -> usize;
794 }
795 pub type ZSTD_DStream = ZSTD_DCtx;
796 extern "C" {
ZSTD_createDStream() -> *mut ZSTD_DStream797 pub fn ZSTD_createDStream() -> *mut ZSTD_DStream;
798 }
799 extern "C" {
ZSTD_freeDStream(zds: *mut ZSTD_DStream) -> usize800 pub fn ZSTD_freeDStream(zds: *mut ZSTD_DStream) -> usize;
801 }
802 extern "C" {
ZSTD_initDStream(zds: *mut ZSTD_DStream) -> usize803 pub fn ZSTD_initDStream(zds: *mut ZSTD_DStream) -> usize;
804 }
805 extern "C" {
ZSTD_decompressStream( zds: *mut ZSTD_DStream, output: *mut ZSTD_outBuffer, input: *mut ZSTD_inBuffer, ) -> usize806 pub fn ZSTD_decompressStream(
807 zds: *mut ZSTD_DStream,
808 output: *mut ZSTD_outBuffer,
809 input: *mut ZSTD_inBuffer,
810 ) -> usize;
811 }
812 extern "C" {
ZSTD_DStreamInSize() -> usize813 pub fn ZSTD_DStreamInSize() -> usize;
814 }
815 extern "C" {
ZSTD_DStreamOutSize() -> usize816 pub fn ZSTD_DStreamOutSize() -> usize;
817 }
818 extern "C" {
819 #[doc = " Simple dictionary API"]
820 #[doc = " Compression at an explicit compression level using a Dictionary."]
821 #[doc = " A dictionary can be any arbitrary data segment (also called a prefix),"]
822 #[doc = " or a buffer with specified information (see dictBuilder/zdict.h)."]
823 #[doc = " Note : This function loads the dictionary, resulting in significant startup delay."]
824 #[doc = " It's intended for a dictionary used only once."]
825 #[doc = " Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used."]
ZSTD_compress_usingDict( ctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, dict: *const ::core::ffi::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize826 pub fn ZSTD_compress_usingDict(
827 ctx: *mut ZSTD_CCtx,
828 dst: *mut ::core::ffi::c_void,
829 dstCapacity: usize,
830 src: *const ::core::ffi::c_void,
831 srcSize: usize,
832 dict: *const ::core::ffi::c_void,
833 dictSize: usize,
834 compressionLevel: ::std::os::raw::c_int,
835 ) -> usize;
836 }
837 extern "C" {
838 #[doc = " ZSTD_decompress_usingDict() :"]
839 #[doc = " Decompression using a known Dictionary."]
840 #[doc = " Dictionary must be identical to the one used during compression."]
841 #[doc = " Note : This function loads the dictionary, resulting in significant startup delay."]
842 #[doc = " It's intended for a dictionary used only once."]
843 #[doc = " Note : When `dict == NULL || dictSize < 8` no dictionary is used."]
ZSTD_decompress_usingDict( dctx: *mut ZSTD_DCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, dict: *const ::core::ffi::c_void, dictSize: usize, ) -> usize844 pub fn ZSTD_decompress_usingDict(
845 dctx: *mut ZSTD_DCtx,
846 dst: *mut ::core::ffi::c_void,
847 dstCapacity: usize,
848 src: *const ::core::ffi::c_void,
849 srcSize: usize,
850 dict: *const ::core::ffi::c_void,
851 dictSize: usize,
852 ) -> usize;
853 }
854 #[repr(C)]
855 #[derive(Debug, Copy, Clone)]
856 pub struct ZSTD_CDict_s {
857 _unused: [u8; 0],
858 }
859 #[doc = " Bulk processing dictionary API"]
860 pub type ZSTD_CDict = ZSTD_CDict_s;
861 extern "C" {
862 #[doc = " ZSTD_createCDict() :"]
863 #[doc = " When compressing multiple messages or blocks using the same dictionary,"]
864 #[doc = " it's recommended to digest the dictionary only once, since it's a costly operation."]
865 #[doc = " ZSTD_createCDict() will create a state from digesting a dictionary."]
866 #[doc = " The resulting state can be used for future compression operations with very limited startup cost."]
867 #[doc = " ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only."]
868 #[doc = " @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict."]
869 #[doc = " Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content."]
870 #[doc = " Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer,"]
871 #[doc = " in which case the only thing that it transports is the @compressionLevel."]
872 #[doc = " This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively,"]
873 #[doc = " expecting a ZSTD_CDict parameter with any data, including those without a known dictionary."]
ZSTD_createCDict( dictBuffer: *const ::core::ffi::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> *mut ZSTD_CDict874 pub fn ZSTD_createCDict(
875 dictBuffer: *const ::core::ffi::c_void,
876 dictSize: usize,
877 compressionLevel: ::std::os::raw::c_int,
878 ) -> *mut ZSTD_CDict;
879 }
880 extern "C" {
881 #[doc = " ZSTD_freeCDict() :"]
882 #[doc = " Function frees memory allocated by ZSTD_createCDict()."]
ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize883 pub fn ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize;
884 }
885 extern "C" {
886 #[doc = " ZSTD_compress_usingCDict() :"]
887 #[doc = " Compression using a digested Dictionary."]
888 #[doc = " Recommended when same dictionary is used multiple times."]
889 #[doc = " Note : compression level is _decided at dictionary creation time_,"]
890 #[doc = " and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)"]
ZSTD_compress_usingCDict( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, cdict: *const ZSTD_CDict, ) -> usize891 pub fn ZSTD_compress_usingCDict(
892 cctx: *mut ZSTD_CCtx,
893 dst: *mut ::core::ffi::c_void,
894 dstCapacity: usize,
895 src: *const ::core::ffi::c_void,
896 srcSize: usize,
897 cdict: *const ZSTD_CDict,
898 ) -> usize;
899 }
900 #[repr(C)]
901 #[derive(Debug, Copy, Clone)]
902 pub struct ZSTD_DDict_s {
903 _unused: [u8; 0],
904 }
905 pub type ZSTD_DDict = ZSTD_DDict_s;
906 extern "C" {
907 #[doc = " ZSTD_createDDict() :"]
908 #[doc = " Create a digested dictionary, ready to start decompression operation without startup delay."]
909 #[doc = " dictBuffer can be released after DDict creation, as its content is copied inside DDict."]
ZSTD_createDDict( dictBuffer: *const ::core::ffi::c_void, dictSize: usize, ) -> *mut ZSTD_DDict910 pub fn ZSTD_createDDict(
911 dictBuffer: *const ::core::ffi::c_void,
912 dictSize: usize,
913 ) -> *mut ZSTD_DDict;
914 }
915 extern "C" {
916 #[doc = " ZSTD_freeDDict() :"]
917 #[doc = " Function frees memory allocated with ZSTD_createDDict()"]
ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize918 pub fn ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize;
919 }
920 extern "C" {
921 #[doc = " ZSTD_decompress_usingDDict() :"]
922 #[doc = " Decompression using a digested Dictionary."]
923 #[doc = " Recommended when same dictionary is used multiple times."]
ZSTD_decompress_usingDDict( dctx: *mut ZSTD_DCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ddict: *const ZSTD_DDict, ) -> usize924 pub fn ZSTD_decompress_usingDDict(
925 dctx: *mut ZSTD_DCtx,
926 dst: *mut ::core::ffi::c_void,
927 dstCapacity: usize,
928 src: *const ::core::ffi::c_void,
929 srcSize: usize,
930 ddict: *const ZSTD_DDict,
931 ) -> usize;
932 }
933 extern "C" {
934 #[doc = " ZSTD_getDictID_fromDict() :"]
935 #[doc = " Provides the dictID stored within dictionary."]
936 #[doc = " if @return == 0, the dictionary is not conformant with Zstandard specification."]
937 #[doc = " It can still be loaded, but as a content-only dictionary."]
ZSTD_getDictID_fromDict( dict: *const ::core::ffi::c_void, dictSize: usize, ) -> ::std::os::raw::c_uint938 pub fn ZSTD_getDictID_fromDict(
939 dict: *const ::core::ffi::c_void,
940 dictSize: usize,
941 ) -> ::std::os::raw::c_uint;
942 }
943 extern "C" {
944 #[doc = " ZSTD_getDictID_fromDDict() :"]
945 #[doc = " Provides the dictID of the dictionary loaded into `ddict`."]
946 #[doc = " If @return == 0, the dictionary is not conformant to Zstandard specification, or empty."]
947 #[doc = " Non-conformant dictionaries can still be loaded, but as content-only dictionaries."]
ZSTD_getDictID_fromDDict( ddict: *const ZSTD_DDict, ) -> ::std::os::raw::c_uint948 pub fn ZSTD_getDictID_fromDDict(
949 ddict: *const ZSTD_DDict,
950 ) -> ::std::os::raw::c_uint;
951 }
952 extern "C" {
953 #[doc = " ZSTD_getDictID_fromFrame() :"]
954 #[doc = " Provides the dictID required to decompressed the frame stored within `src`."]
955 #[doc = " If @return == 0, the dictID could not be decoded."]
956 #[doc = " This could for one of the following reasons :"]
957 #[doc = " - The frame does not require a dictionary to be decoded (most common case)."]
958 #[doc = " - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden information."]
959 #[doc = " Note : this use case also happens when using a non-conformant dictionary."]
960 #[doc = " - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`)."]
961 #[doc = " - This is not a Zstandard frame."]
962 #[doc = " When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code."]
ZSTD_getDictID_fromFrame( src: *const ::core::ffi::c_void, srcSize: usize, ) -> ::std::os::raw::c_uint963 pub fn ZSTD_getDictID_fromFrame(
964 src: *const ::core::ffi::c_void,
965 srcSize: usize,
966 ) -> ::std::os::raw::c_uint;
967 }
968 extern "C" {
969 #[doc = " ZSTD_CCtx_loadDictionary() :"]
970 #[doc = " Create an internal CDict from `dict` buffer."]
971 #[doc = " Decompression will have to use same dictionary."]
972 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
973 #[doc = " Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,"]
974 #[doc = " meaning \"return to no-dictionary mode\"."]
975 #[doc = " Note 1 : Dictionary is sticky, it will be used for all future compressed frames."]
976 #[doc = " To return to \"no-dictionary\" situation, load a NULL dictionary (or reset parameters)."]
977 #[doc = " Note 2 : Loading a dictionary involves building tables."]
978 #[doc = " It's also a CPU consuming operation, with non-negligible impact on latency."]
979 #[doc = " Tables are dependent on compression parameters, and for this reason,"]
980 #[doc = " compression parameters can no longer be changed after loading a dictionary."]
981 #[doc = " Note 3 :`dict` content will be copied internally."]
982 #[doc = " Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead."]
983 #[doc = " In such a case, dictionary buffer must outlive its users."]
984 #[doc = " Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()"]
985 #[doc = " to precisely select how dictionary content must be interpreted."]
ZSTD_CCtx_loadDictionary( cctx: *mut ZSTD_CCtx, dict: *const ::core::ffi::c_void, dictSize: usize, ) -> usize986 pub fn ZSTD_CCtx_loadDictionary(
987 cctx: *mut ZSTD_CCtx,
988 dict: *const ::core::ffi::c_void,
989 dictSize: usize,
990 ) -> usize;
991 }
992 extern "C" {
993 #[doc = " ZSTD_CCtx_refCDict() :"]
994 #[doc = " Reference a prepared dictionary, to be used for all next compressed frames."]
995 #[doc = " Note that compression parameters are enforced from within CDict,"]
996 #[doc = " and supersede any compression parameter previously set within CCtx."]
997 #[doc = " The parameters ignored are labled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs."]
998 #[doc = " The ignored parameters will be used again if the CCtx is returned to no-dictionary mode."]
999 #[doc = " The dictionary will remain valid for future compressed frames using same CCtx."]
1000 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
1001 #[doc = " Special : Referencing a NULL CDict means \"return to no-dictionary mode\"."]
1002 #[doc = " Note 1 : Currently, only one dictionary can be managed."]
1003 #[doc = " Referencing a new dictionary effectively \"discards\" any previous one."]
1004 #[doc = " Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx."]
ZSTD_CCtx_refCDict( cctx: *mut ZSTD_CCtx, cdict: *const ZSTD_CDict, ) -> usize1005 pub fn ZSTD_CCtx_refCDict(
1006 cctx: *mut ZSTD_CCtx,
1007 cdict: *const ZSTD_CDict,
1008 ) -> usize;
1009 }
1010 extern "C" {
1011 #[doc = " ZSTD_CCtx_refPrefix() :"]
1012 #[doc = " Reference a prefix (single-usage dictionary) for next compressed frame."]
1013 #[doc = " A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end)."]
1014 #[doc = " Decompression will need same prefix to properly regenerate data."]
1015 #[doc = " Compressing with a prefix is similar in outcome as performing a diff and compressing it,"]
1016 #[doc = " but performs much faster, especially during decompression (compression speed is tunable with compression level)."]
1017 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
1018 #[doc = " Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary"]
1019 #[doc = " Note 1 : Prefix buffer is referenced. It **must** outlive compression."]
1020 #[doc = " Its content must remain unmodified during compression."]
1021 #[doc = " Note 2 : If the intention is to diff some large src data blob with some prior version of itself,"]
1022 #[doc = " ensure that the window size is large enough to contain the entire source."]
1023 #[doc = " See ZSTD_c_windowLog."]
1024 #[doc = " Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters."]
1025 #[doc = " It's a CPU consuming operation, with non-negligible impact on latency."]
1026 #[doc = " If there is a need to use the same prefix multiple times, consider loadDictionary instead."]
1027 #[doc = " Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent)."]
1028 #[doc = " Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation."]
ZSTD_CCtx_refPrefix( cctx: *mut ZSTD_CCtx, prefix: *const ::core::ffi::c_void, prefixSize: usize, ) -> usize1029 pub fn ZSTD_CCtx_refPrefix(
1030 cctx: *mut ZSTD_CCtx,
1031 prefix: *const ::core::ffi::c_void,
1032 prefixSize: usize,
1033 ) -> usize;
1034 }
1035 extern "C" {
1036 #[doc = " ZSTD_DCtx_loadDictionary() :"]
1037 #[doc = " Create an internal DDict from dict buffer,"]
1038 #[doc = " to be used to decompress next frames."]
1039 #[doc = " The dictionary remains valid for all future frames, until explicitly invalidated."]
1040 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
1041 #[doc = " Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,"]
1042 #[doc = " meaning \"return to no-dictionary mode\"."]
1043 #[doc = " Note 1 : Loading a dictionary involves building tables,"]
1044 #[doc = " which has a non-negligible impact on CPU usage and latency."]
1045 #[doc = " It's recommended to \"load once, use many times\", to amortize the cost"]
1046 #[doc = " Note 2 :`dict` content will be copied internally, so `dict` can be released after loading."]
1047 #[doc = " Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead."]
1048 #[doc = " Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of"]
1049 #[doc = " how dictionary content is loaded and interpreted."]
ZSTD_DCtx_loadDictionary( dctx: *mut ZSTD_DCtx, dict: *const ::core::ffi::c_void, dictSize: usize, ) -> usize1050 pub fn ZSTD_DCtx_loadDictionary(
1051 dctx: *mut ZSTD_DCtx,
1052 dict: *const ::core::ffi::c_void,
1053 dictSize: usize,
1054 ) -> usize;
1055 }
1056 extern "C" {
1057 #[doc = " ZSTD_DCtx_refDDict() :"]
1058 #[doc = " Reference a prepared dictionary, to be used to decompress next frames."]
1059 #[doc = " The dictionary remains active for decompression of future frames using same DCtx."]
1060 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
1061 #[doc = " Note 1 : Currently, only one dictionary can be managed."]
1062 #[doc = " Referencing a new dictionary effectively \"discards\" any previous one."]
1063 #[doc = " Special: referencing a NULL DDict means \"return to no-dictionary mode\"."]
1064 #[doc = " Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx."]
ZSTD_DCtx_refDDict( dctx: *mut ZSTD_DCtx, ddict: *const ZSTD_DDict, ) -> usize1065 pub fn ZSTD_DCtx_refDDict(
1066 dctx: *mut ZSTD_DCtx,
1067 ddict: *const ZSTD_DDict,
1068 ) -> usize;
1069 }
1070 extern "C" {
1071 #[doc = " ZSTD_DCtx_refPrefix() :"]
1072 #[doc = " Reference a prefix (single-usage dictionary) to decompress next frame."]
1073 #[doc = " This is the reverse operation of ZSTD_CCtx_refPrefix(),"]
1074 #[doc = " and must use the same prefix as the one used during compression."]
1075 #[doc = " Prefix is **only used once**. Reference is discarded at end of frame."]
1076 #[doc = " End of frame is reached when ZSTD_decompressStream() returns 0."]
1077 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
1078 #[doc = " Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary"]
1079 #[doc = " Note 2 : Prefix buffer is referenced. It **must** outlive decompression."]
1080 #[doc = " Prefix buffer must remain unmodified up to the end of frame,"]
1081 #[doc = " reached when ZSTD_decompressStream() returns 0."]
1082 #[doc = " Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent)."]
1083 #[doc = " Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section)"]
1084 #[doc = " Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost."]
1085 #[doc = " A full dictionary is more costly, as it requires building tables."]
ZSTD_DCtx_refPrefix( dctx: *mut ZSTD_DCtx, prefix: *const ::core::ffi::c_void, prefixSize: usize, ) -> usize1086 pub fn ZSTD_DCtx_refPrefix(
1087 dctx: *mut ZSTD_DCtx,
1088 prefix: *const ::core::ffi::c_void,
1089 prefixSize: usize,
1090 ) -> usize;
1091 }
1092 extern "C" {
1093 #[doc = " ZSTD_sizeof_*() :"]
1094 #[doc = " These functions give the _current_ memory usage of selected object."]
1095 #[doc = " Note that object memory usage can evolve (increase or decrease) over time."]
ZSTD_sizeof_CCtx(cctx: *const ZSTD_CCtx) -> usize1096 pub fn ZSTD_sizeof_CCtx(cctx: *const ZSTD_CCtx) -> usize;
1097 }
1098 extern "C" {
ZSTD_sizeof_DCtx(dctx: *const ZSTD_DCtx) -> usize1099 pub fn ZSTD_sizeof_DCtx(dctx: *const ZSTD_DCtx) -> usize;
1100 }
1101 extern "C" {
ZSTD_sizeof_CStream(zcs: *const ZSTD_CStream) -> usize1102 pub fn ZSTD_sizeof_CStream(zcs: *const ZSTD_CStream) -> usize;
1103 }
1104 extern "C" {
ZSTD_sizeof_DStream(zds: *const ZSTD_DStream) -> usize1105 pub fn ZSTD_sizeof_DStream(zds: *const ZSTD_DStream) -> usize;
1106 }
1107 extern "C" {
ZSTD_sizeof_CDict(cdict: *const ZSTD_CDict) -> usize1108 pub fn ZSTD_sizeof_CDict(cdict: *const ZSTD_CDict) -> usize;
1109 }
1110 extern "C" {
ZSTD_sizeof_DDict(ddict: *const ZSTD_DDict) -> usize1111 pub fn ZSTD_sizeof_DDict(ddict: *const ZSTD_DDict) -> usize;
1112 }
1113 #[repr(C)]
1114 #[derive(Debug, Copy, Clone)]
1115 pub struct ZSTD_CCtx_params_s {
1116 _unused: [u8; 0],
1117 }
1118 pub type ZSTD_CCtx_params = ZSTD_CCtx_params_s;
1119 #[repr(C)]
1120 #[derive(Debug, Copy, Clone)]
1121 pub struct ZSTD_Sequence {
1122 pub offset: ::std::os::raw::c_uint,
1123 pub litLength: ::std::os::raw::c_uint,
1124 pub matchLength: ::std::os::raw::c_uint,
1125 pub rep: ::std::os::raw::c_uint,
1126 }
1127 #[test]
bindgen_test_layout_ZSTD_Sequence()1128 fn bindgen_test_layout_ZSTD_Sequence() {
1129 assert_eq!(
1130 ::core::mem::size_of::<ZSTD_Sequence>(),
1131 16usize,
1132 concat!("Size of: ", stringify!(ZSTD_Sequence))
1133 );
1134 assert_eq!(
1135 ::core::mem::align_of::<ZSTD_Sequence>(),
1136 4usize,
1137 concat!("Alignment of ", stringify!(ZSTD_Sequence))
1138 );
1139 assert_eq!(
1140 unsafe {
1141 &(*(::core::ptr::null::<ZSTD_Sequence>())).offset as *const _
1142 as usize
1143 },
1144 0usize,
1145 concat!(
1146 "Offset of field: ",
1147 stringify!(ZSTD_Sequence),
1148 "::",
1149 stringify!(offset)
1150 )
1151 );
1152 assert_eq!(
1153 unsafe {
1154 &(*(::core::ptr::null::<ZSTD_Sequence>())).litLength as *const _
1155 as usize
1156 },
1157 4usize,
1158 concat!(
1159 "Offset of field: ",
1160 stringify!(ZSTD_Sequence),
1161 "::",
1162 stringify!(litLength)
1163 )
1164 );
1165 assert_eq!(
1166 unsafe {
1167 &(*(::core::ptr::null::<ZSTD_Sequence>())).matchLength as *const _
1168 as usize
1169 },
1170 8usize,
1171 concat!(
1172 "Offset of field: ",
1173 stringify!(ZSTD_Sequence),
1174 "::",
1175 stringify!(matchLength)
1176 )
1177 );
1178 assert_eq!(
1179 unsafe {
1180 &(*(::core::ptr::null::<ZSTD_Sequence>())).rep as *const _ as usize
1181 },
1182 12usize,
1183 concat!(
1184 "Offset of field: ",
1185 stringify!(ZSTD_Sequence),
1186 "::",
1187 stringify!(rep)
1188 )
1189 );
1190 }
1191 #[repr(C)]
1192 #[derive(Debug, Copy, Clone)]
1193 pub struct ZSTD_compressionParameters {
1194 #[doc = "< largest match distance : larger == more compression, more memory needed during decompression"]
1195 pub windowLog: ::std::os::raw::c_uint,
1196 #[doc = "< fully searched segment : larger == more compression, slower, more memory (useless for fast)"]
1197 pub chainLog: ::std::os::raw::c_uint,
1198 #[doc = "< dispatch table : larger == faster, more memory"]
1199 pub hashLog: ::std::os::raw::c_uint,
1200 #[doc = "< nb of searches : larger == more compression, slower"]
1201 pub searchLog: ::std::os::raw::c_uint,
1202 #[doc = "< match length searched : larger == faster decompression, sometimes less compression"]
1203 pub minMatch: ::std::os::raw::c_uint,
1204 #[doc = "< acceptable match size for optimal parser (only) : larger == more compression, slower"]
1205 pub targetLength: ::std::os::raw::c_uint,
1206 #[doc = "< see ZSTD_strategy definition above"]
1207 pub strategy: ZSTD_strategy,
1208 }
1209 #[test]
bindgen_test_layout_ZSTD_compressionParameters()1210 fn bindgen_test_layout_ZSTD_compressionParameters() {
1211 assert_eq!(
1212 ::core::mem::size_of::<ZSTD_compressionParameters>(),
1213 28usize,
1214 concat!("Size of: ", stringify!(ZSTD_compressionParameters))
1215 );
1216 assert_eq!(
1217 ::core::mem::align_of::<ZSTD_compressionParameters>(),
1218 4usize,
1219 concat!("Alignment of ", stringify!(ZSTD_compressionParameters))
1220 );
1221 assert_eq!(
1222 unsafe {
1223 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).windowLog
1224 as *const _ as usize
1225 },
1226 0usize,
1227 concat!(
1228 "Offset of field: ",
1229 stringify!(ZSTD_compressionParameters),
1230 "::",
1231 stringify!(windowLog)
1232 )
1233 );
1234 assert_eq!(
1235 unsafe {
1236 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).chainLog
1237 as *const _ as usize
1238 },
1239 4usize,
1240 concat!(
1241 "Offset of field: ",
1242 stringify!(ZSTD_compressionParameters),
1243 "::",
1244 stringify!(chainLog)
1245 )
1246 );
1247 assert_eq!(
1248 unsafe {
1249 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).hashLog
1250 as *const _ as usize
1251 },
1252 8usize,
1253 concat!(
1254 "Offset of field: ",
1255 stringify!(ZSTD_compressionParameters),
1256 "::",
1257 stringify!(hashLog)
1258 )
1259 );
1260 assert_eq!(
1261 unsafe {
1262 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).searchLog
1263 as *const _ as usize
1264 },
1265 12usize,
1266 concat!(
1267 "Offset of field: ",
1268 stringify!(ZSTD_compressionParameters),
1269 "::",
1270 stringify!(searchLog)
1271 )
1272 );
1273 assert_eq!(
1274 unsafe {
1275 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).minMatch
1276 as *const _ as usize
1277 },
1278 16usize,
1279 concat!(
1280 "Offset of field: ",
1281 stringify!(ZSTD_compressionParameters),
1282 "::",
1283 stringify!(minMatch)
1284 )
1285 );
1286 assert_eq!(
1287 unsafe {
1288 &(*(::core::ptr::null::<ZSTD_compressionParameters>()))
1289 .targetLength as *const _ as usize
1290 },
1291 20usize,
1292 concat!(
1293 "Offset of field: ",
1294 stringify!(ZSTD_compressionParameters),
1295 "::",
1296 stringify!(targetLength)
1297 )
1298 );
1299 assert_eq!(
1300 unsafe {
1301 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).strategy
1302 as *const _ as usize
1303 },
1304 24usize,
1305 concat!(
1306 "Offset of field: ",
1307 stringify!(ZSTD_compressionParameters),
1308 "::",
1309 stringify!(strategy)
1310 )
1311 );
1312 }
1313 #[repr(C)]
1314 #[derive(Debug, Copy, Clone)]
1315 pub struct ZSTD_frameParameters {
1316 #[doc = "< 1: content size will be in frame header (when known)"]
1317 pub contentSizeFlag: ::std::os::raw::c_int,
1318 #[doc = "< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection"]
1319 pub checksumFlag: ::std::os::raw::c_int,
1320 #[doc = "< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression)"]
1321 pub noDictIDFlag: ::std::os::raw::c_int,
1322 }
1323 #[test]
bindgen_test_layout_ZSTD_frameParameters()1324 fn bindgen_test_layout_ZSTD_frameParameters() {
1325 assert_eq!(
1326 ::core::mem::size_of::<ZSTD_frameParameters>(),
1327 12usize,
1328 concat!("Size of: ", stringify!(ZSTD_frameParameters))
1329 );
1330 assert_eq!(
1331 ::core::mem::align_of::<ZSTD_frameParameters>(),
1332 4usize,
1333 concat!("Alignment of ", stringify!(ZSTD_frameParameters))
1334 );
1335 assert_eq!(
1336 unsafe {
1337 &(*(::core::ptr::null::<ZSTD_frameParameters>())).contentSizeFlag
1338 as *const _ as usize
1339 },
1340 0usize,
1341 concat!(
1342 "Offset of field: ",
1343 stringify!(ZSTD_frameParameters),
1344 "::",
1345 stringify!(contentSizeFlag)
1346 )
1347 );
1348 assert_eq!(
1349 unsafe {
1350 &(*(::core::ptr::null::<ZSTD_frameParameters>())).checksumFlag
1351 as *const _ as usize
1352 },
1353 4usize,
1354 concat!(
1355 "Offset of field: ",
1356 stringify!(ZSTD_frameParameters),
1357 "::",
1358 stringify!(checksumFlag)
1359 )
1360 );
1361 assert_eq!(
1362 unsafe {
1363 &(*(::core::ptr::null::<ZSTD_frameParameters>())).noDictIDFlag
1364 as *const _ as usize
1365 },
1366 8usize,
1367 concat!(
1368 "Offset of field: ",
1369 stringify!(ZSTD_frameParameters),
1370 "::",
1371 stringify!(noDictIDFlag)
1372 )
1373 );
1374 }
1375 #[repr(C)]
1376 #[derive(Debug, Copy, Clone)]
1377 pub struct ZSTD_parameters {
1378 pub cParams: ZSTD_compressionParameters,
1379 pub fParams: ZSTD_frameParameters,
1380 }
1381 #[test]
bindgen_test_layout_ZSTD_parameters()1382 fn bindgen_test_layout_ZSTD_parameters() {
1383 assert_eq!(
1384 ::core::mem::size_of::<ZSTD_parameters>(),
1385 40usize,
1386 concat!("Size of: ", stringify!(ZSTD_parameters))
1387 );
1388 assert_eq!(
1389 ::core::mem::align_of::<ZSTD_parameters>(),
1390 4usize,
1391 concat!("Alignment of ", stringify!(ZSTD_parameters))
1392 );
1393 assert_eq!(
1394 unsafe {
1395 &(*(::core::ptr::null::<ZSTD_parameters>())).cParams as *const _
1396 as usize
1397 },
1398 0usize,
1399 concat!(
1400 "Offset of field: ",
1401 stringify!(ZSTD_parameters),
1402 "::",
1403 stringify!(cParams)
1404 )
1405 );
1406 assert_eq!(
1407 unsafe {
1408 &(*(::core::ptr::null::<ZSTD_parameters>())).fParams as *const _
1409 as usize
1410 },
1411 28usize,
1412 concat!(
1413 "Offset of field: ",
1414 stringify!(ZSTD_parameters),
1415 "::",
1416 stringify!(fParams)
1417 )
1418 );
1419 }
1420 #[repr(u32)]
1421 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1422 pub enum ZSTD_dictContentType_e {
1423 ZSTD_dct_auto = 0,
1424 ZSTD_dct_rawContent = 1,
1425 ZSTD_dct_fullDict = 2,
1426 }
1427 #[repr(u32)]
1428 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1429 pub enum ZSTD_dictLoadMethod_e {
1430 #[doc = "< Copy dictionary content internally"]
1431 ZSTD_dlm_byCopy = 0,
1432 #[doc = "< Reference dictionary content -- the dictionary buffer must outlive its users."]
1433 ZSTD_dlm_byRef = 1,
1434 }
1435 #[repr(u32)]
1436 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1437 pub enum ZSTD_format_e {
1438 ZSTD_f_zstd1 = 0,
1439 ZSTD_f_zstd1_magicless = 1,
1440 }
1441 #[repr(u32)]
1442 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1443 pub enum ZSTD_forceIgnoreChecksum_e {
1444 ZSTD_d_validateChecksum = 0,
1445 ZSTD_d_ignoreChecksum = 1,
1446 }
1447 #[repr(u32)]
1448 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1449 pub enum ZSTD_dictAttachPref_e {
1450 ZSTD_dictDefaultAttach = 0,
1451 ZSTD_dictForceAttach = 1,
1452 ZSTD_dictForceCopy = 2,
1453 ZSTD_dictForceLoad = 3,
1454 }
1455 #[repr(u32)]
1456 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1457 pub enum ZSTD_literalCompressionMode_e {
1458 #[doc = "< Automatically determine the compression mode based on the compression level."]
1459 #[doc = " Negative compression levels will be uncompressed, and positive compression"]
1460 #[doc = " levels will be compressed."]
1461 ZSTD_lcm_auto = 0,
1462 #[doc = "< Always attempt Huffman compression. Uncompressed literals will still be"]
1463 #[doc = " emitted if Huffman compression is not profitable."]
1464 ZSTD_lcm_huffman = 1,
1465 #[doc = "< Always emit uncompressed literals."]
1466 ZSTD_lcm_uncompressed = 2,
1467 }
1468 extern "C" {
1469 #[doc = " ZSTD_findDecompressedSize() :"]
1470 #[doc = " `src` should point to the start of a series of ZSTD encoded and/or skippable frames"]
1471 #[doc = " `srcSize` must be the _exact_ size of this series"]
1472 #[doc = " (i.e. there should be a frame boundary at `src + srcSize`)"]
1473 #[doc = " @return : - decompressed size of all data in all successive frames"]
1474 #[doc = " - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN"]
1475 #[doc = " - if an error occurred: ZSTD_CONTENTSIZE_ERROR"]
1476 #[doc = ""]
1477 #[doc = " note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode."]
1478 #[doc = " When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size."]
1479 #[doc = " In which case, it's necessary to use streaming mode to decompress data."]
1480 #[doc = " note 2 : decompressed size is always present when compression is done with ZSTD_compress()"]
1481 #[doc = " note 3 : decompressed size can be very large (64-bits value),"]
1482 #[doc = " potentially larger than what local system can handle as a single memory segment."]
1483 #[doc = " In which case, it's necessary to use streaming mode to decompress data."]
1484 #[doc = " note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified."]
1485 #[doc = " Always ensure result fits within application's authorized limits."]
1486 #[doc = " Each application can set its own limits."]
1487 #[doc = " note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to"]
1488 #[doc = " read each contained frame header. This is fast as most of the data is skipped,"]
1489 #[doc = " however it does mean that all frame data must be present and valid."]
ZSTD_findDecompressedSize( src: *const ::core::ffi::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong1490 pub fn ZSTD_findDecompressedSize(
1491 src: *const ::core::ffi::c_void,
1492 srcSize: usize,
1493 ) -> ::std::os::raw::c_ulonglong;
1494 }
1495 extern "C" {
1496 #[doc = " ZSTD_decompressBound() :"]
1497 #[doc = " `src` should point to the start of a series of ZSTD encoded and/or skippable frames"]
1498 #[doc = " `srcSize` must be the _exact_ size of this series"]
1499 #[doc = " (i.e. there should be a frame boundary at `src + srcSize`)"]
1500 #[doc = " @return : - upper-bound for the decompressed size of all data in all successive frames"]
1501 #[doc = " - if an error occured: ZSTD_CONTENTSIZE_ERROR"]
1502 #[doc = ""]
1503 #[doc = " note 1 : an error can occur if `src` contains an invalid or incorrectly formatted frame."]
1504 #[doc = " note 2 : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`."]
1505 #[doc = " in this case, `ZSTD_findDecompressedSize` and `ZSTD_decompressBound` return the same value."]
1506 #[doc = " note 3 : when the decompressed size field isn't available, the upper-bound for that frame is calculated by:"]
1507 #[doc = " upper-bound = # blocks * min(128 KB, Window_Size)"]
ZSTD_decompressBound( src: *const ::core::ffi::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong1508 pub fn ZSTD_decompressBound(
1509 src: *const ::core::ffi::c_void,
1510 srcSize: usize,
1511 ) -> ::std::os::raw::c_ulonglong;
1512 }
1513 extern "C" {
1514 #[doc = " ZSTD_frameHeaderSize() :"]
1515 #[doc = " srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX."]
1516 #[doc = " @return : size of the Frame Header,"]
1517 #[doc = " or an error code (if srcSize is too small)"]
ZSTD_frameHeaderSize( src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize1518 pub fn ZSTD_frameHeaderSize(
1519 src: *const ::core::ffi::c_void,
1520 srcSize: usize,
1521 ) -> usize;
1522 }
1523 #[repr(u32)]
1524 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1525 pub enum ZSTD_sequenceFormat_e {
1526 ZSTD_sf_noBlockDelimiters = 0,
1527 ZSTD_sf_explicitBlockDelimiters = 1,
1528 }
1529 extern "C" {
1530 #[doc = " ZSTD_generateSequences() :"]
1531 #[doc = " Generate sequences using ZSTD_compress2, given a source buffer."]
1532 #[doc = ""]
1533 #[doc = " Each block will end with a dummy sequence"]
1534 #[doc = " with offset == 0, matchLength == 0, and litLength == length of last literals."]
1535 #[doc = " litLength may be == 0, and if so, then the sequence of (of: 0 ml: 0 ll: 0)"]
1536 #[doc = " simply acts as a block delimiter."]
1537 #[doc = ""]
1538 #[doc = " zc can be used to insert custom compression params."]
1539 #[doc = " This function invokes ZSTD_compress2"]
1540 #[doc = ""]
1541 #[doc = " The output of this function can be fed into ZSTD_compressSequences() with CCtx"]
1542 #[doc = " setting of ZSTD_c_blockDelimiters as ZSTD_sf_explicitBlockDelimiters"]
1543 #[doc = " @return : number of sequences generated"]
ZSTD_generateSequences( zc: *mut ZSTD_CCtx, outSeqs: *mut ZSTD_Sequence, outSeqsSize: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize1544 pub fn ZSTD_generateSequences(
1545 zc: *mut ZSTD_CCtx,
1546 outSeqs: *mut ZSTD_Sequence,
1547 outSeqsSize: usize,
1548 src: *const ::core::ffi::c_void,
1549 srcSize: usize,
1550 ) -> usize;
1551 }
1552 extern "C" {
1553 #[doc = " ZSTD_mergeBlockDelimiters() :"]
1554 #[doc = " Given an array of ZSTD_Sequence, remove all sequences that represent block delimiters/last literals"]
1555 #[doc = " by merging them into into the literals of the next sequence."]
1556 #[doc = ""]
1557 #[doc = " As such, the final generated result has no explicit representation of block boundaries,"]
1558 #[doc = " and the final last literals segment is not represented in the sequences."]
1559 #[doc = ""]
1560 #[doc = " The output of this function can be fed into ZSTD_compressSequences() with CCtx"]
1561 #[doc = " setting of ZSTD_c_blockDelimiters as ZSTD_sf_noBlockDelimiters"]
1562 #[doc = " @return : number of sequences left after merging"]
ZSTD_mergeBlockDelimiters( sequences: *mut ZSTD_Sequence, seqsSize: usize, ) -> usize1563 pub fn ZSTD_mergeBlockDelimiters(
1564 sequences: *mut ZSTD_Sequence,
1565 seqsSize: usize,
1566 ) -> usize;
1567 }
1568 extern "C" {
1569 #[doc = " ZSTD_compressSequences() :"]
1570 #[doc = " Compress an array of ZSTD_Sequence, generated from the original source buffer, into dst."]
1571 #[doc = " If a dictionary is included, then the cctx should reference the dict. (see: ZSTD_CCtx_refCDict(), ZSTD_CCtx_loadDictionary(), etc.)"]
1572 #[doc = " The entire source is compressed into a single frame."]
1573 #[doc = ""]
1574 #[doc = " The compression behavior changes based on cctx params. In particular:"]
1575 #[doc = " If ZSTD_c_blockDelimiters == ZSTD_sf_noBlockDelimiters, the array of ZSTD_Sequence is expected to contain"]
1576 #[doc = " no block delimiters (defined in ZSTD_Sequence). Block boundaries are roughly determined based on"]
1577 #[doc = " the block size derived from the cctx, and sequences may be split. This is the default setting."]
1578 #[doc = ""]
1579 #[doc = " If ZSTD_c_blockDelimiters == ZSTD_sf_explicitBlockDelimiters, the array of ZSTD_Sequence is expected to contain"]
1580 #[doc = " block delimiters (defined in ZSTD_Sequence). Behavior is undefined if no block delimiters are provided."]
1581 #[doc = ""]
1582 #[doc = " If ZSTD_c_validateSequences == 0, this function will blindly accept the sequences provided. Invalid sequences cause undefined"]
1583 #[doc = " behavior. If ZSTD_c_validateSequences == 1, then if sequence is invalid (see doc/zstd_compression_format.md for"]
1584 #[doc = " specifics regarding offset/matchlength requirements) then the function will bail out and return an error."]
1585 #[doc = ""]
1586 #[doc = " In addition to the two adjustable experimental params, there are other important cctx params."]
1587 #[doc = " - ZSTD_c_minMatch MUST be set as less than or equal to the smallest match generated by the match finder. It has a minimum value of ZSTD_MINMATCH_MIN."]
1588 #[doc = " - ZSTD_c_compressionLevel accordingly adjusts the strength of the entropy coder, as it would in typical compression."]
1589 #[doc = " - ZSTD_c_windowLog affects offset validation: this function will return an error at higher debug levels if a provided offset"]
1590 #[doc = " is larger than what the spec allows for a given window log and dictionary (if present). See: doc/zstd_compression_format.md"]
1591 #[doc = ""]
1592 #[doc = " Note: Repcodes are, as of now, always re-calculated within this function, so ZSTD_Sequence::rep is unused."]
1593 #[doc = " Note 2: Once we integrate ability to ingest repcodes, the explicit block delims mode must respect those repcodes exactly,"]
1594 #[doc = " and cannot emit an RLE block that disagrees with the repcode history"]
1595 #[doc = " @return : final compressed size or a ZSTD error."]
ZSTD_compressSequences( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstSize: usize, inSeqs: *const ZSTD_Sequence, inSeqsSize: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize1596 pub fn ZSTD_compressSequences(
1597 cctx: *mut ZSTD_CCtx,
1598 dst: *mut ::core::ffi::c_void,
1599 dstSize: usize,
1600 inSeqs: *const ZSTD_Sequence,
1601 inSeqsSize: usize,
1602 src: *const ::core::ffi::c_void,
1603 srcSize: usize,
1604 ) -> usize;
1605 }
1606 extern "C" {
1607 #[doc = " ZSTD_estimate*() :"]
1608 #[doc = " These functions make it possible to estimate memory usage"]
1609 #[doc = " of a future {D,C}Ctx, before its creation."]
1610 #[doc = ""]
1611 #[doc = " ZSTD_estimateCCtxSize() will provide a memory budget large enough"]
1612 #[doc = " for any compression level up to selected one."]
1613 #[doc = " Note : Unlike ZSTD_estimateCStreamSize*(), this estimate"]
1614 #[doc = " does not include space for a window buffer."]
1615 #[doc = " Therefore, the estimation is only guaranteed for single-shot compressions, not streaming."]
1616 #[doc = " The estimate will assume the input may be arbitrarily large,"]
1617 #[doc = " which is the worst case."]
1618 #[doc = ""]
1619 #[doc = " When srcSize can be bound by a known and rather \"small\" value,"]
1620 #[doc = " this fact can be used to provide a tighter estimation"]
1621 #[doc = " because the CCtx compression context will need less memory."]
1622 #[doc = " This tighter estimation can be provided by more advanced functions"]
1623 #[doc = " ZSTD_estimateCCtxSize_usingCParams(), which can be used in tandem with ZSTD_getCParams(),"]
1624 #[doc = " and ZSTD_estimateCCtxSize_usingCCtxParams(), which can be used in tandem with ZSTD_CCtxParams_setParameter()."]
1625 #[doc = " Both can be used to estimate memory using custom compression parameters and arbitrary srcSize limits."]
1626 #[doc = ""]
1627 #[doc = " Note 2 : only single-threaded compression is supported."]
1628 #[doc = " ZSTD_estimateCCtxSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1."]
ZSTD_estimateCCtxSize( compressionLevel: ::std::os::raw::c_int, ) -> usize1629 pub fn ZSTD_estimateCCtxSize(
1630 compressionLevel: ::std::os::raw::c_int,
1631 ) -> usize;
1632 }
1633 extern "C" {
ZSTD_estimateCCtxSize_usingCParams( cParams: ZSTD_compressionParameters, ) -> usize1634 pub fn ZSTD_estimateCCtxSize_usingCParams(
1635 cParams: ZSTD_compressionParameters,
1636 ) -> usize;
1637 }
1638 extern "C" {
ZSTD_estimateCCtxSize_usingCCtxParams( params: *const ZSTD_CCtx_params, ) -> usize1639 pub fn ZSTD_estimateCCtxSize_usingCCtxParams(
1640 params: *const ZSTD_CCtx_params,
1641 ) -> usize;
1642 }
1643 extern "C" {
ZSTD_estimateDCtxSize() -> usize1644 pub fn ZSTD_estimateDCtxSize() -> usize;
1645 }
1646 extern "C" {
1647 #[doc = " ZSTD_estimateCStreamSize() :"]
1648 #[doc = " ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one."]
1649 #[doc = " It will also consider src size to be arbitrarily \"large\", which is worst case."]
1650 #[doc = " If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation."]
1651 #[doc = " ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel."]
1652 #[doc = " ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_c_nbWorkers is >= 1."]
1653 #[doc = " Note : CStream size estimation is only correct for single-threaded compression."]
1654 #[doc = " ZSTD_DStream memory budget depends on window Size."]
1655 #[doc = " This information can be passed manually, using ZSTD_estimateDStreamSize,"]
1656 #[doc = " or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame();"]
1657 #[doc = " Note : if streaming is init with function ZSTD_init?Stream_usingDict(),"]
1658 #[doc = " an internal ?Dict will be created, which additional size is not estimated here."]
1659 #[doc = " In this case, get total size by adding ZSTD_estimate?DictSize"]
ZSTD_estimateCStreamSize( compressionLevel: ::std::os::raw::c_int, ) -> usize1660 pub fn ZSTD_estimateCStreamSize(
1661 compressionLevel: ::std::os::raw::c_int,
1662 ) -> usize;
1663 }
1664 extern "C" {
ZSTD_estimateCStreamSize_usingCParams( cParams: ZSTD_compressionParameters, ) -> usize1665 pub fn ZSTD_estimateCStreamSize_usingCParams(
1666 cParams: ZSTD_compressionParameters,
1667 ) -> usize;
1668 }
1669 extern "C" {
ZSTD_estimateCStreamSize_usingCCtxParams( params: *const ZSTD_CCtx_params, ) -> usize1670 pub fn ZSTD_estimateCStreamSize_usingCCtxParams(
1671 params: *const ZSTD_CCtx_params,
1672 ) -> usize;
1673 }
1674 extern "C" {
ZSTD_estimateDStreamSize(windowSize: usize) -> usize1675 pub fn ZSTD_estimateDStreamSize(windowSize: usize) -> usize;
1676 }
1677 extern "C" {
ZSTD_estimateDStreamSize_fromFrame( src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize1678 pub fn ZSTD_estimateDStreamSize_fromFrame(
1679 src: *const ::core::ffi::c_void,
1680 srcSize: usize,
1681 ) -> usize;
1682 }
1683 extern "C" {
1684 #[doc = " ZSTD_estimate?DictSize() :"]
1685 #[doc = " ZSTD_estimateCDictSize() will bet that src size is relatively \"small\", and content is copied, like ZSTD_createCDict()."]
1686 #[doc = " ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced()."]
1687 #[doc = " Note : dictionaries created by reference (`ZSTD_dlm_byRef`) are logically smaller."]
ZSTD_estimateCDictSize( dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize1688 pub fn ZSTD_estimateCDictSize(
1689 dictSize: usize,
1690 compressionLevel: ::std::os::raw::c_int,
1691 ) -> usize;
1692 }
1693 extern "C" {
ZSTD_estimateCDictSize_advanced( dictSize: usize, cParams: ZSTD_compressionParameters, dictLoadMethod: ZSTD_dictLoadMethod_e, ) -> usize1694 pub fn ZSTD_estimateCDictSize_advanced(
1695 dictSize: usize,
1696 cParams: ZSTD_compressionParameters,
1697 dictLoadMethod: ZSTD_dictLoadMethod_e,
1698 ) -> usize;
1699 }
1700 extern "C" {
ZSTD_estimateDDictSize( dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, ) -> usize1701 pub fn ZSTD_estimateDDictSize(
1702 dictSize: usize,
1703 dictLoadMethod: ZSTD_dictLoadMethod_e,
1704 ) -> usize;
1705 }
1706 extern "C" {
1707 #[doc = " ZSTD_initStatic*() :"]
1708 #[doc = " Initialize an object using a pre-allocated fixed-size buffer."]
1709 #[doc = " workspace: The memory area to emplace the object into."]
1710 #[doc = " Provided pointer *must be 8-bytes aligned*."]
1711 #[doc = " Buffer must outlive object."]
1712 #[doc = " workspaceSize: Use ZSTD_estimate*Size() to determine"]
1713 #[doc = " how large workspace must be to support target scenario."]
1714 #[doc = " @return : pointer to object (same address as workspace, just different type),"]
1715 #[doc = " or NULL if error (size too small, incorrect alignment, etc.)"]
1716 #[doc = " Note : zstd will never resize nor malloc() when using a static buffer."]
1717 #[doc = " If the object requires more memory than available,"]
1718 #[doc = " zstd will just error out (typically ZSTD_error_memory_allocation)."]
1719 #[doc = " Note 2 : there is no corresponding \"free\" function."]
1720 #[doc = " Since workspace is allocated externally, it must be freed externally too."]
1721 #[doc = " Note 3 : cParams : use ZSTD_getCParams() to convert a compression level"]
1722 #[doc = " into its associated cParams."]
1723 #[doc = " Limitation 1 : currently not compatible with internal dictionary creation, triggered by"]
1724 #[doc = " ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict()."]
1725 #[doc = " Limitation 2 : static cctx currently not compatible with multi-threading."]
1726 #[doc = " Limitation 3 : static dctx is incompatible with legacy support."]
ZSTD_initStaticCCtx( workspace: *mut ::core::ffi::c_void, workspaceSize: usize, ) -> *mut ZSTD_CCtx1727 pub fn ZSTD_initStaticCCtx(
1728 workspace: *mut ::core::ffi::c_void,
1729 workspaceSize: usize,
1730 ) -> *mut ZSTD_CCtx;
1731 }
1732 extern "C" {
ZSTD_initStaticCStream( workspace: *mut ::core::ffi::c_void, workspaceSize: usize, ) -> *mut ZSTD_CStream1733 pub fn ZSTD_initStaticCStream(
1734 workspace: *mut ::core::ffi::c_void,
1735 workspaceSize: usize,
1736 ) -> *mut ZSTD_CStream;
1737 }
1738 extern "C" {
ZSTD_initStaticDCtx( workspace: *mut ::core::ffi::c_void, workspaceSize: usize, ) -> *mut ZSTD_DCtx1739 pub fn ZSTD_initStaticDCtx(
1740 workspace: *mut ::core::ffi::c_void,
1741 workspaceSize: usize,
1742 ) -> *mut ZSTD_DCtx;
1743 }
1744 extern "C" {
ZSTD_initStaticDStream( workspace: *mut ::core::ffi::c_void, workspaceSize: usize, ) -> *mut ZSTD_DStream1745 pub fn ZSTD_initStaticDStream(
1746 workspace: *mut ::core::ffi::c_void,
1747 workspaceSize: usize,
1748 ) -> *mut ZSTD_DStream;
1749 }
1750 extern "C" {
ZSTD_initStaticCDict( workspace: *mut ::core::ffi::c_void, workspaceSize: usize, dict: *const ::core::ffi::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, cParams: ZSTD_compressionParameters, ) -> *const ZSTD_CDict1751 pub fn ZSTD_initStaticCDict(
1752 workspace: *mut ::core::ffi::c_void,
1753 workspaceSize: usize,
1754 dict: *const ::core::ffi::c_void,
1755 dictSize: usize,
1756 dictLoadMethod: ZSTD_dictLoadMethod_e,
1757 dictContentType: ZSTD_dictContentType_e,
1758 cParams: ZSTD_compressionParameters,
1759 ) -> *const ZSTD_CDict;
1760 }
1761 extern "C" {
ZSTD_initStaticDDict( workspace: *mut ::core::ffi::c_void, workspaceSize: usize, dict: *const ::core::ffi::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, ) -> *const ZSTD_DDict1762 pub fn ZSTD_initStaticDDict(
1763 workspace: *mut ::core::ffi::c_void,
1764 workspaceSize: usize,
1765 dict: *const ::core::ffi::c_void,
1766 dictSize: usize,
1767 dictLoadMethod: ZSTD_dictLoadMethod_e,
1768 dictContentType: ZSTD_dictContentType_e,
1769 ) -> *const ZSTD_DDict;
1770 }
1771 #[doc = " Custom memory allocation :"]
1772 #[doc = " These prototypes make it possible to pass your own allocation/free functions."]
1773 #[doc = " ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below."]
1774 #[doc = " All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones."]
1775 pub type ZSTD_allocFunction = ::core::option::Option<
1776 unsafe extern "C" fn(
1777 opaque: *mut ::core::ffi::c_void,
1778 size: usize,
1779 ) -> *mut ::core::ffi::c_void,
1780 >;
1781 pub type ZSTD_freeFunction = ::core::option::Option<
1782 unsafe extern "C" fn(
1783 opaque: *mut ::core::ffi::c_void,
1784 address: *mut ::core::ffi::c_void,
1785 ),
1786 >;
1787 #[repr(C)]
1788 #[derive(Debug, Copy, Clone)]
1789 pub struct ZSTD_customMem {
1790 pub customAlloc: ZSTD_allocFunction,
1791 pub customFree: ZSTD_freeFunction,
1792 pub opaque: *mut ::core::ffi::c_void,
1793 }
1794 #[test]
bindgen_test_layout_ZSTD_customMem()1795 fn bindgen_test_layout_ZSTD_customMem() {
1796 assert_eq!(
1797 ::core::mem::size_of::<ZSTD_customMem>(),
1798 24usize,
1799 concat!("Size of: ", stringify!(ZSTD_customMem))
1800 );
1801 assert_eq!(
1802 ::core::mem::align_of::<ZSTD_customMem>(),
1803 8usize,
1804 concat!("Alignment of ", stringify!(ZSTD_customMem))
1805 );
1806 assert_eq!(
1807 unsafe {
1808 &(*(::core::ptr::null::<ZSTD_customMem>())).customAlloc as *const _
1809 as usize
1810 },
1811 0usize,
1812 concat!(
1813 "Offset of field: ",
1814 stringify!(ZSTD_customMem),
1815 "::",
1816 stringify!(customAlloc)
1817 )
1818 );
1819 assert_eq!(
1820 unsafe {
1821 &(*(::core::ptr::null::<ZSTD_customMem>())).customFree as *const _
1822 as usize
1823 },
1824 8usize,
1825 concat!(
1826 "Offset of field: ",
1827 stringify!(ZSTD_customMem),
1828 "::",
1829 stringify!(customFree)
1830 )
1831 );
1832 assert_eq!(
1833 unsafe {
1834 &(*(::core::ptr::null::<ZSTD_customMem>())).opaque as *const _
1835 as usize
1836 },
1837 16usize,
1838 concat!(
1839 "Offset of field: ",
1840 stringify!(ZSTD_customMem),
1841 "::",
1842 stringify!(opaque)
1843 )
1844 );
1845 }
1846 extern "C" {
1847 pub static ZSTD_defaultCMem: ZSTD_customMem;
1848 }
1849 extern "C" {
ZSTD_createCCtx_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_CCtx1850 pub fn ZSTD_createCCtx_advanced(
1851 customMem: ZSTD_customMem,
1852 ) -> *mut ZSTD_CCtx;
1853 }
1854 extern "C" {
ZSTD_createCStream_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_CStream1855 pub fn ZSTD_createCStream_advanced(
1856 customMem: ZSTD_customMem,
1857 ) -> *mut ZSTD_CStream;
1858 }
1859 extern "C" {
ZSTD_createDCtx_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_DCtx1860 pub fn ZSTD_createDCtx_advanced(
1861 customMem: ZSTD_customMem,
1862 ) -> *mut ZSTD_DCtx;
1863 }
1864 extern "C" {
ZSTD_createDStream_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_DStream1865 pub fn ZSTD_createDStream_advanced(
1866 customMem: ZSTD_customMem,
1867 ) -> *mut ZSTD_DStream;
1868 }
1869 extern "C" {
ZSTD_createCDict_advanced( dict: *const ::core::ffi::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, cParams: ZSTD_compressionParameters, customMem: ZSTD_customMem, ) -> *mut ZSTD_CDict1870 pub fn ZSTD_createCDict_advanced(
1871 dict: *const ::core::ffi::c_void,
1872 dictSize: usize,
1873 dictLoadMethod: ZSTD_dictLoadMethod_e,
1874 dictContentType: ZSTD_dictContentType_e,
1875 cParams: ZSTD_compressionParameters,
1876 customMem: ZSTD_customMem,
1877 ) -> *mut ZSTD_CDict;
1878 }
1879 #[repr(C)]
1880 #[derive(Debug, Copy, Clone)]
1881 pub struct POOL_ctx_s {
1882 _unused: [u8; 0],
1883 }
1884 pub type ZSTD_threadPool = POOL_ctx_s;
1885 extern "C" {
ZSTD_createThreadPool(numThreads: usize) -> *mut ZSTD_threadPool1886 pub fn ZSTD_createThreadPool(numThreads: usize) -> *mut ZSTD_threadPool;
1887 }
1888 extern "C" {
ZSTD_freeThreadPool(pool: *mut ZSTD_threadPool)1889 pub fn ZSTD_freeThreadPool(pool: *mut ZSTD_threadPool);
1890 }
1891 extern "C" {
ZSTD_CCtx_refThreadPool( cctx: *mut ZSTD_CCtx, pool: *mut ZSTD_threadPool, ) -> usize1892 pub fn ZSTD_CCtx_refThreadPool(
1893 cctx: *mut ZSTD_CCtx,
1894 pool: *mut ZSTD_threadPool,
1895 ) -> usize;
1896 }
1897 extern "C" {
ZSTD_createCDict_advanced2( dict: *const ::core::ffi::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, cctxParams: *const ZSTD_CCtx_params, customMem: ZSTD_customMem, ) -> *mut ZSTD_CDict1898 pub fn ZSTD_createCDict_advanced2(
1899 dict: *const ::core::ffi::c_void,
1900 dictSize: usize,
1901 dictLoadMethod: ZSTD_dictLoadMethod_e,
1902 dictContentType: ZSTD_dictContentType_e,
1903 cctxParams: *const ZSTD_CCtx_params,
1904 customMem: ZSTD_customMem,
1905 ) -> *mut ZSTD_CDict;
1906 }
1907 extern "C" {
ZSTD_createDDict_advanced( dict: *const ::core::ffi::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, customMem: ZSTD_customMem, ) -> *mut ZSTD_DDict1908 pub fn ZSTD_createDDict_advanced(
1909 dict: *const ::core::ffi::c_void,
1910 dictSize: usize,
1911 dictLoadMethod: ZSTD_dictLoadMethod_e,
1912 dictContentType: ZSTD_dictContentType_e,
1913 customMem: ZSTD_customMem,
1914 ) -> *mut ZSTD_DDict;
1915 }
1916 extern "C" {
1917 #[doc = " ZSTD_createCDict_byReference() :"]
1918 #[doc = " Create a digested dictionary for compression"]
1919 #[doc = " Dictionary content is just referenced, not duplicated."]
1920 #[doc = " As a consequence, `dictBuffer` **must** outlive CDict,"]
1921 #[doc = " and its content must remain unmodified throughout the lifetime of CDict."]
1922 #[doc = " note: equivalent to ZSTD_createCDict_advanced(), with dictLoadMethod==ZSTD_dlm_byRef"]
ZSTD_createCDict_byReference( dictBuffer: *const ::core::ffi::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> *mut ZSTD_CDict1923 pub fn ZSTD_createCDict_byReference(
1924 dictBuffer: *const ::core::ffi::c_void,
1925 dictSize: usize,
1926 compressionLevel: ::std::os::raw::c_int,
1927 ) -> *mut ZSTD_CDict;
1928 }
1929 extern "C" {
1930 #[doc = " ZSTD_getDictID_fromCDict() :"]
1931 #[doc = " Provides the dictID of the dictionary loaded into `cdict`."]
1932 #[doc = " If @return == 0, the dictionary is not conformant to Zstandard specification, or empty."]
1933 #[doc = " Non-conformant dictionaries can still be loaded, but as content-only dictionaries."]
ZSTD_getDictID_fromCDict( cdict: *const ZSTD_CDict, ) -> ::std::os::raw::c_uint1934 pub fn ZSTD_getDictID_fromCDict(
1935 cdict: *const ZSTD_CDict,
1936 ) -> ::std::os::raw::c_uint;
1937 }
1938 extern "C" {
1939 #[doc = " ZSTD_getCParams() :"]
1940 #[doc = " @return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize."]
1941 #[doc = " `estimatedSrcSize` value is optional, select 0 if not known"]
ZSTD_getCParams( compressionLevel: ::std::os::raw::c_int, estimatedSrcSize: ::std::os::raw::c_ulonglong, dictSize: usize, ) -> ZSTD_compressionParameters1942 pub fn ZSTD_getCParams(
1943 compressionLevel: ::std::os::raw::c_int,
1944 estimatedSrcSize: ::std::os::raw::c_ulonglong,
1945 dictSize: usize,
1946 ) -> ZSTD_compressionParameters;
1947 }
1948 extern "C" {
1949 #[doc = " ZSTD_getParams() :"]
1950 #[doc = " same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`."]
1951 #[doc = " All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0"]
ZSTD_getParams( compressionLevel: ::std::os::raw::c_int, estimatedSrcSize: ::std::os::raw::c_ulonglong, dictSize: usize, ) -> ZSTD_parameters1952 pub fn ZSTD_getParams(
1953 compressionLevel: ::std::os::raw::c_int,
1954 estimatedSrcSize: ::std::os::raw::c_ulonglong,
1955 dictSize: usize,
1956 ) -> ZSTD_parameters;
1957 }
1958 extern "C" {
1959 #[doc = " ZSTD_checkCParams() :"]
1960 #[doc = " Ensure param values remain within authorized range."]
1961 #[doc = " @return 0 on success, or an error code (can be checked with ZSTD_isError())"]
ZSTD_checkCParams(params: ZSTD_compressionParameters) -> usize1962 pub fn ZSTD_checkCParams(params: ZSTD_compressionParameters) -> usize;
1963 }
1964 extern "C" {
1965 #[doc = " ZSTD_adjustCParams() :"]
1966 #[doc = " optimize params for a given `srcSize` and `dictSize`."]
1967 #[doc = " `srcSize` can be unknown, in which case use ZSTD_CONTENTSIZE_UNKNOWN."]
1968 #[doc = " `dictSize` must be `0` when there is no dictionary."]
1969 #[doc = " cPar can be invalid : all parameters will be clamped within valid range in the @return struct."]
1970 #[doc = " This function never fails (wide contract)"]
ZSTD_adjustCParams( cPar: ZSTD_compressionParameters, srcSize: ::std::os::raw::c_ulonglong, dictSize: usize, ) -> ZSTD_compressionParameters1971 pub fn ZSTD_adjustCParams(
1972 cPar: ZSTD_compressionParameters,
1973 srcSize: ::std::os::raw::c_ulonglong,
1974 dictSize: usize,
1975 ) -> ZSTD_compressionParameters;
1976 }
1977 extern "C" {
1978 #[doc = " ZSTD_compress_advanced() :"]
1979 #[doc = " Note : this function is now DEPRECATED."]
1980 #[doc = " It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters."]
1981 #[doc = " This prototype will be marked as deprecated and generate compilation warning on reaching v1.5.x"]
ZSTD_compress_advanced( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, dict: *const ::core::ffi::c_void, dictSize: usize, params: ZSTD_parameters, ) -> usize1982 pub fn ZSTD_compress_advanced(
1983 cctx: *mut ZSTD_CCtx,
1984 dst: *mut ::core::ffi::c_void,
1985 dstCapacity: usize,
1986 src: *const ::core::ffi::c_void,
1987 srcSize: usize,
1988 dict: *const ::core::ffi::c_void,
1989 dictSize: usize,
1990 params: ZSTD_parameters,
1991 ) -> usize;
1992 }
1993 extern "C" {
1994 #[doc = " ZSTD_compress_usingCDict_advanced() :"]
1995 #[doc = " Note : this function is now REDUNDANT."]
1996 #[doc = " It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters."]
1997 #[doc = " This prototype will be marked as deprecated and generate compilation warning in some future version"]
ZSTD_compress_usingCDict_advanced( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, cdict: *const ZSTD_CDict, fParams: ZSTD_frameParameters, ) -> usize1998 pub fn ZSTD_compress_usingCDict_advanced(
1999 cctx: *mut ZSTD_CCtx,
2000 dst: *mut ::core::ffi::c_void,
2001 dstCapacity: usize,
2002 src: *const ::core::ffi::c_void,
2003 srcSize: usize,
2004 cdict: *const ZSTD_CDict,
2005 fParams: ZSTD_frameParameters,
2006 ) -> usize;
2007 }
2008 extern "C" {
2009 #[doc = " ZSTD_CCtx_loadDictionary_byReference() :"]
2010 #[doc = " Same as ZSTD_CCtx_loadDictionary(), but dictionary content is referenced, instead of being copied into CCtx."]
2011 #[doc = " It saves some memory, but also requires that `dict` outlives its usage within `cctx`"]
ZSTD_CCtx_loadDictionary_byReference( cctx: *mut ZSTD_CCtx, dict: *const ::core::ffi::c_void, dictSize: usize, ) -> usize2012 pub fn ZSTD_CCtx_loadDictionary_byReference(
2013 cctx: *mut ZSTD_CCtx,
2014 dict: *const ::core::ffi::c_void,
2015 dictSize: usize,
2016 ) -> usize;
2017 }
2018 extern "C" {
2019 #[doc = " ZSTD_CCtx_loadDictionary_advanced() :"]
2020 #[doc = " Same as ZSTD_CCtx_loadDictionary(), but gives finer control over"]
2021 #[doc = " how to load the dictionary (by copy ? by reference ?)"]
2022 #[doc = " and how to interpret it (automatic ? force raw mode ? full mode only ?)"]
ZSTD_CCtx_loadDictionary_advanced( cctx: *mut ZSTD_CCtx, dict: *const ::core::ffi::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, ) -> usize2023 pub fn ZSTD_CCtx_loadDictionary_advanced(
2024 cctx: *mut ZSTD_CCtx,
2025 dict: *const ::core::ffi::c_void,
2026 dictSize: usize,
2027 dictLoadMethod: ZSTD_dictLoadMethod_e,
2028 dictContentType: ZSTD_dictContentType_e,
2029 ) -> usize;
2030 }
2031 extern "C" {
2032 #[doc = " ZSTD_CCtx_refPrefix_advanced() :"]
2033 #[doc = " Same as ZSTD_CCtx_refPrefix(), but gives finer control over"]
2034 #[doc = " how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)"]
ZSTD_CCtx_refPrefix_advanced( cctx: *mut ZSTD_CCtx, prefix: *const ::core::ffi::c_void, prefixSize: usize, dictContentType: ZSTD_dictContentType_e, ) -> usize2035 pub fn ZSTD_CCtx_refPrefix_advanced(
2036 cctx: *mut ZSTD_CCtx,
2037 prefix: *const ::core::ffi::c_void,
2038 prefixSize: usize,
2039 dictContentType: ZSTD_dictContentType_e,
2040 ) -> usize;
2041 }
2042 extern "C" {
2043 #[doc = " ZSTD_CCtx_getParameter() :"]
2044 #[doc = " Get the requested compression parameter value, selected by enum ZSTD_cParameter,"]
2045 #[doc = " and store it into int* value."]
2046 #[doc = " @return : 0, or an error code (which can be tested with ZSTD_isError())."]
ZSTD_CCtx_getParameter( cctx: *mut ZSTD_CCtx, param: ZSTD_cParameter, value: *mut ::std::os::raw::c_int, ) -> usize2047 pub fn ZSTD_CCtx_getParameter(
2048 cctx: *mut ZSTD_CCtx,
2049 param: ZSTD_cParameter,
2050 value: *mut ::std::os::raw::c_int,
2051 ) -> usize;
2052 }
2053 extern "C" {
2054 #[doc = " ZSTD_CCtx_params :"]
2055 #[doc = " Quick howto :"]
2056 #[doc = " - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure"]
2057 #[doc = " - ZSTD_CCtxParams_setParameter() : Push parameters one by one into"]
2058 #[doc = " an existing ZSTD_CCtx_params structure."]
2059 #[doc = " This is similar to"]
2060 #[doc = " ZSTD_CCtx_setParameter()."]
2061 #[doc = " - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to"]
2062 #[doc = " an existing CCtx."]
2063 #[doc = " These parameters will be applied to"]
2064 #[doc = " all subsequent frames."]
2065 #[doc = " - ZSTD_compressStream2() : Do compression using the CCtx."]
2066 #[doc = " - ZSTD_freeCCtxParams() : Free the memory."]
2067 #[doc = ""]
2068 #[doc = " This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams()"]
2069 #[doc = " for static allocation of CCtx for single-threaded compression."]
ZSTD_createCCtxParams() -> *mut ZSTD_CCtx_params2070 pub fn ZSTD_createCCtxParams() -> *mut ZSTD_CCtx_params;
2071 }
2072 extern "C" {
ZSTD_freeCCtxParams(params: *mut ZSTD_CCtx_params) -> usize2073 pub fn ZSTD_freeCCtxParams(params: *mut ZSTD_CCtx_params) -> usize;
2074 }
2075 extern "C" {
2076 #[doc = " ZSTD_CCtxParams_reset() :"]
2077 #[doc = " Reset params to default values."]
ZSTD_CCtxParams_reset(params: *mut ZSTD_CCtx_params) -> usize2078 pub fn ZSTD_CCtxParams_reset(params: *mut ZSTD_CCtx_params) -> usize;
2079 }
2080 extern "C" {
2081 #[doc = " ZSTD_CCtxParams_init() :"]
2082 #[doc = " Initializes the compression parameters of cctxParams according to"]
2083 #[doc = " compression level. All other parameters are reset to their default values."]
ZSTD_CCtxParams_init( cctxParams: *mut ZSTD_CCtx_params, compressionLevel: ::std::os::raw::c_int, ) -> usize2084 pub fn ZSTD_CCtxParams_init(
2085 cctxParams: *mut ZSTD_CCtx_params,
2086 compressionLevel: ::std::os::raw::c_int,
2087 ) -> usize;
2088 }
2089 extern "C" {
2090 #[doc = " ZSTD_CCtxParams_init_advanced() :"]
2091 #[doc = " Initializes the compression and frame parameters of cctxParams according to"]
2092 #[doc = " params. All other parameters are reset to their default values."]
ZSTD_CCtxParams_init_advanced( cctxParams: *mut ZSTD_CCtx_params, params: ZSTD_parameters, ) -> usize2093 pub fn ZSTD_CCtxParams_init_advanced(
2094 cctxParams: *mut ZSTD_CCtx_params,
2095 params: ZSTD_parameters,
2096 ) -> usize;
2097 }
2098 extern "C" {
2099 #[doc = " ZSTD_CCtxParams_setParameter() :"]
2100 #[doc = " Similar to ZSTD_CCtx_setParameter."]
2101 #[doc = " Set one compression parameter, selected by enum ZSTD_cParameter."]
2102 #[doc = " Parameters must be applied to a ZSTD_CCtx using"]
2103 #[doc = " ZSTD_CCtx_setParametersUsingCCtxParams()."]
2104 #[doc = " @result : a code representing success or failure (which can be tested with"]
2105 #[doc = " ZSTD_isError())."]
ZSTD_CCtxParams_setParameter( params: *mut ZSTD_CCtx_params, param: ZSTD_cParameter, value: ::std::os::raw::c_int, ) -> usize2106 pub fn ZSTD_CCtxParams_setParameter(
2107 params: *mut ZSTD_CCtx_params,
2108 param: ZSTD_cParameter,
2109 value: ::std::os::raw::c_int,
2110 ) -> usize;
2111 }
2112 extern "C" {
2113 #[doc = " ZSTD_CCtxParams_getParameter() :"]
2114 #[doc = " Similar to ZSTD_CCtx_getParameter."]
2115 #[doc = " Get the requested value of one compression parameter, selected by enum ZSTD_cParameter."]
2116 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
ZSTD_CCtxParams_getParameter( params: *mut ZSTD_CCtx_params, param: ZSTD_cParameter, value: *mut ::std::os::raw::c_int, ) -> usize2117 pub fn ZSTD_CCtxParams_getParameter(
2118 params: *mut ZSTD_CCtx_params,
2119 param: ZSTD_cParameter,
2120 value: *mut ::std::os::raw::c_int,
2121 ) -> usize;
2122 }
2123 extern "C" {
2124 #[doc = " ZSTD_CCtx_setParametersUsingCCtxParams() :"]
2125 #[doc = " Apply a set of ZSTD_CCtx_params to the compression context."]
2126 #[doc = " This can be done even after compression is started,"]
2127 #[doc = " if nbWorkers==0, this will have no impact until a new compression is started."]
2128 #[doc = " if nbWorkers>=1, new parameters will be picked up at next job,"]
2129 #[doc = " with a few restrictions (windowLog, pledgedSrcSize, nbWorkers, jobSize, and overlapLog are not updated)."]
ZSTD_CCtx_setParametersUsingCCtxParams( cctx: *mut ZSTD_CCtx, params: *const ZSTD_CCtx_params, ) -> usize2130 pub fn ZSTD_CCtx_setParametersUsingCCtxParams(
2131 cctx: *mut ZSTD_CCtx,
2132 params: *const ZSTD_CCtx_params,
2133 ) -> usize;
2134 }
2135 extern "C" {
2136 #[doc = " ZSTD_compressStream2_simpleArgs() :"]
2137 #[doc = " Same as ZSTD_compressStream2(),"]
2138 #[doc = " but using only integral types as arguments."]
2139 #[doc = " This variant might be helpful for binders from dynamic languages"]
2140 #[doc = " which have troubles handling structures containing memory pointers."]
ZSTD_compressStream2_simpleArgs( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, dstPos: *mut usize, src: *const ::core::ffi::c_void, srcSize: usize, srcPos: *mut usize, endOp: ZSTD_EndDirective, ) -> usize2141 pub fn ZSTD_compressStream2_simpleArgs(
2142 cctx: *mut ZSTD_CCtx,
2143 dst: *mut ::core::ffi::c_void,
2144 dstCapacity: usize,
2145 dstPos: *mut usize,
2146 src: *const ::core::ffi::c_void,
2147 srcSize: usize,
2148 srcPos: *mut usize,
2149 endOp: ZSTD_EndDirective,
2150 ) -> usize;
2151 }
2152 extern "C" {
2153 #[doc = " ZSTD_isFrame() :"]
2154 #[doc = " Tells if the content of `buffer` starts with a valid Frame Identifier."]
2155 #[doc = " Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0."]
2156 #[doc = " Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled."]
2157 #[doc = " Note 3 : Skippable Frame Identifiers are considered valid."]
ZSTD_isFrame( buffer: *const ::core::ffi::c_void, size: usize, ) -> ::std::os::raw::c_uint2158 pub fn ZSTD_isFrame(
2159 buffer: *const ::core::ffi::c_void,
2160 size: usize,
2161 ) -> ::std::os::raw::c_uint;
2162 }
2163 extern "C" {
2164 #[doc = " ZSTD_createDDict_byReference() :"]
2165 #[doc = " Create a digested dictionary, ready to start decompression operation without startup delay."]
2166 #[doc = " Dictionary content is referenced, and therefore stays in dictBuffer."]
2167 #[doc = " It is important that dictBuffer outlives DDict,"]
2168 #[doc = " it must remain read accessible throughout the lifetime of DDict"]
ZSTD_createDDict_byReference( dictBuffer: *const ::core::ffi::c_void, dictSize: usize, ) -> *mut ZSTD_DDict2169 pub fn ZSTD_createDDict_byReference(
2170 dictBuffer: *const ::core::ffi::c_void,
2171 dictSize: usize,
2172 ) -> *mut ZSTD_DDict;
2173 }
2174 extern "C" {
2175 #[doc = " ZSTD_DCtx_loadDictionary_byReference() :"]
2176 #[doc = " Same as ZSTD_DCtx_loadDictionary(),"]
2177 #[doc = " but references `dict` content instead of copying it into `dctx`."]
2178 #[doc = " This saves memory if `dict` remains around.,"]
2179 #[doc = " However, it's imperative that `dict` remains accessible (and unmodified) while being used, so it must outlive decompression."]
ZSTD_DCtx_loadDictionary_byReference( dctx: *mut ZSTD_DCtx, dict: *const ::core::ffi::c_void, dictSize: usize, ) -> usize2180 pub fn ZSTD_DCtx_loadDictionary_byReference(
2181 dctx: *mut ZSTD_DCtx,
2182 dict: *const ::core::ffi::c_void,
2183 dictSize: usize,
2184 ) -> usize;
2185 }
2186 extern "C" {
2187 #[doc = " ZSTD_DCtx_loadDictionary_advanced() :"]
2188 #[doc = " Same as ZSTD_DCtx_loadDictionary(),"]
2189 #[doc = " but gives direct control over"]
2190 #[doc = " how to load the dictionary (by copy ? by reference ?)"]
2191 #[doc = " and how to interpret it (automatic ? force raw mode ? full mode only ?)."]
ZSTD_DCtx_loadDictionary_advanced( dctx: *mut ZSTD_DCtx, dict: *const ::core::ffi::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, ) -> usize2192 pub fn ZSTD_DCtx_loadDictionary_advanced(
2193 dctx: *mut ZSTD_DCtx,
2194 dict: *const ::core::ffi::c_void,
2195 dictSize: usize,
2196 dictLoadMethod: ZSTD_dictLoadMethod_e,
2197 dictContentType: ZSTD_dictContentType_e,
2198 ) -> usize;
2199 }
2200 extern "C" {
2201 #[doc = " ZSTD_DCtx_refPrefix_advanced() :"]
2202 #[doc = " Same as ZSTD_DCtx_refPrefix(), but gives finer control over"]
2203 #[doc = " how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)"]
ZSTD_DCtx_refPrefix_advanced( dctx: *mut ZSTD_DCtx, prefix: *const ::core::ffi::c_void, prefixSize: usize, dictContentType: ZSTD_dictContentType_e, ) -> usize2204 pub fn ZSTD_DCtx_refPrefix_advanced(
2205 dctx: *mut ZSTD_DCtx,
2206 prefix: *const ::core::ffi::c_void,
2207 prefixSize: usize,
2208 dictContentType: ZSTD_dictContentType_e,
2209 ) -> usize;
2210 }
2211 extern "C" {
2212 #[doc = " ZSTD_DCtx_setMaxWindowSize() :"]
2213 #[doc = " Refuses allocating internal buffers for frames requiring a window size larger than provided limit."]
2214 #[doc = " This protects a decoder context from reserving too much memory for itself (potential attack scenario)."]
2215 #[doc = " This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode."]
2216 #[doc = " By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT)"]
2217 #[doc = " @return : 0, or an error code (which can be tested using ZSTD_isError())."]
ZSTD_DCtx_setMaxWindowSize( dctx: *mut ZSTD_DCtx, maxWindowSize: usize, ) -> usize2218 pub fn ZSTD_DCtx_setMaxWindowSize(
2219 dctx: *mut ZSTD_DCtx,
2220 maxWindowSize: usize,
2221 ) -> usize;
2222 }
2223 extern "C" {
2224 #[doc = " ZSTD_DCtx_getParameter() :"]
2225 #[doc = " Get the requested decompression parameter value, selected by enum ZSTD_dParameter,"]
2226 #[doc = " and store it into int* value."]
2227 #[doc = " @return : 0, or an error code (which can be tested with ZSTD_isError())."]
ZSTD_DCtx_getParameter( dctx: *mut ZSTD_DCtx, param: ZSTD_dParameter, value: *mut ::std::os::raw::c_int, ) -> usize2228 pub fn ZSTD_DCtx_getParameter(
2229 dctx: *mut ZSTD_DCtx,
2230 param: ZSTD_dParameter,
2231 value: *mut ::std::os::raw::c_int,
2232 ) -> usize;
2233 }
2234 extern "C" {
2235 #[doc = " ZSTD_DCtx_setFormat() :"]
2236 #[doc = " Instruct the decoder context about what kind of data to decode next."]
2237 #[doc = " This instruction is mandatory to decode data without a fully-formed header,"]
2238 #[doc = " such ZSTD_f_zstd1_magicless for example."]
2239 #[doc = " @return : 0, or an error code (which can be tested using ZSTD_isError())."]
ZSTD_DCtx_setFormat( dctx: *mut ZSTD_DCtx, format: ZSTD_format_e, ) -> usize2240 pub fn ZSTD_DCtx_setFormat(
2241 dctx: *mut ZSTD_DCtx,
2242 format: ZSTD_format_e,
2243 ) -> usize;
2244 }
2245 extern "C" {
2246 #[doc = " ZSTD_decompressStream_simpleArgs() :"]
2247 #[doc = " Same as ZSTD_decompressStream(),"]
2248 #[doc = " but using only integral types as arguments."]
2249 #[doc = " This can be helpful for binders from dynamic languages"]
2250 #[doc = " which have troubles handling structures containing memory pointers."]
ZSTD_decompressStream_simpleArgs( dctx: *mut ZSTD_DCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, dstPos: *mut usize, src: *const ::core::ffi::c_void, srcSize: usize, srcPos: *mut usize, ) -> usize2251 pub fn ZSTD_decompressStream_simpleArgs(
2252 dctx: *mut ZSTD_DCtx,
2253 dst: *mut ::core::ffi::c_void,
2254 dstCapacity: usize,
2255 dstPos: *mut usize,
2256 src: *const ::core::ffi::c_void,
2257 srcSize: usize,
2258 srcPos: *mut usize,
2259 ) -> usize;
2260 }
2261 extern "C" {
2262 #[doc = " ZSTD_initCStream_srcSize() :"]
2263 #[doc = " This function is deprecated, and equivalent to:"]
2264 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2265 #[doc = " ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)"]
2266 #[doc = " ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
2267 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2268 #[doc = ""]
2269 #[doc = " pledgedSrcSize must be correct. If it is not known at init time, use"]
2270 #[doc = " ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs,"]
2271 #[doc = " \"0\" also disables frame content size field. It may be enabled in the future."]
2272 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_initCStream_srcSize( zcs: *mut ZSTD_CStream, compressionLevel: ::std::os::raw::c_int, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2273 pub fn ZSTD_initCStream_srcSize(
2274 zcs: *mut ZSTD_CStream,
2275 compressionLevel: ::std::os::raw::c_int,
2276 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2277 ) -> usize;
2278 }
2279 extern "C" {
2280 #[doc = " ZSTD_initCStream_usingDict() :"]
2281 #[doc = " This function is deprecated, and is equivalent to:"]
2282 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2283 #[doc = " ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
2284 #[doc = " ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);"]
2285 #[doc = ""]
2286 #[doc = " Creates of an internal CDict (incompatible with static CCtx), except if"]
2287 #[doc = " dict == NULL or dictSize < 8, in which case no dict is used."]
2288 #[doc = " Note: dict is loaded with ZSTD_dct_auto (treated as a full zstd dictionary if"]
2289 #[doc = " it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy."]
2290 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_initCStream_usingDict( zcs: *mut ZSTD_CStream, dict: *const ::core::ffi::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize2291 pub fn ZSTD_initCStream_usingDict(
2292 zcs: *mut ZSTD_CStream,
2293 dict: *const ::core::ffi::c_void,
2294 dictSize: usize,
2295 compressionLevel: ::std::os::raw::c_int,
2296 ) -> usize;
2297 }
2298 extern "C" {
2299 #[doc = " ZSTD_initCStream_advanced() :"]
2300 #[doc = " This function is deprecated, and is approximately equivalent to:"]
2301 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2302 #[doc = " // Pseudocode: Set each zstd parameter and leave the rest as-is."]
2303 #[doc = " for ((param, value) : params) {"]
2304 #[doc = " ZSTD_CCtx_setParameter(zcs, param, value);"]
2305 #[doc = " }"]
2306 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2307 #[doc = " ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);"]
2308 #[doc = ""]
2309 #[doc = " dict is loaded with ZSTD_dct_auto and ZSTD_dlm_byCopy."]
2310 #[doc = " pledgedSrcSize must be correct."]
2311 #[doc = " If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN."]
2312 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_initCStream_advanced( zcs: *mut ZSTD_CStream, dict: *const ::core::ffi::c_void, dictSize: usize, params: ZSTD_parameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2313 pub fn ZSTD_initCStream_advanced(
2314 zcs: *mut ZSTD_CStream,
2315 dict: *const ::core::ffi::c_void,
2316 dictSize: usize,
2317 params: ZSTD_parameters,
2318 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2319 ) -> usize;
2320 }
2321 extern "C" {
2322 #[doc = " ZSTD_initCStream_usingCDict() :"]
2323 #[doc = " This function is deprecated, and equivalent to:"]
2324 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2325 #[doc = " ZSTD_CCtx_refCDict(zcs, cdict);"]
2326 #[doc = ""]
2327 #[doc = " note : cdict will just be referenced, and must outlive compression session"]
2328 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_initCStream_usingCDict( zcs: *mut ZSTD_CStream, cdict: *const ZSTD_CDict, ) -> usize2329 pub fn ZSTD_initCStream_usingCDict(
2330 zcs: *mut ZSTD_CStream,
2331 cdict: *const ZSTD_CDict,
2332 ) -> usize;
2333 }
2334 extern "C" {
2335 #[doc = " ZSTD_initCStream_usingCDict_advanced() :"]
2336 #[doc = " This function is DEPRECATED, and is approximately equivalent to:"]
2337 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2338 #[doc = " // Pseudocode: Set each zstd frame parameter and leave the rest as-is."]
2339 #[doc = " for ((fParam, value) : fParams) {"]
2340 #[doc = " ZSTD_CCtx_setParameter(zcs, fParam, value);"]
2341 #[doc = " }"]
2342 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2343 #[doc = " ZSTD_CCtx_refCDict(zcs, cdict);"]
2344 #[doc = ""]
2345 #[doc = " same as ZSTD_initCStream_usingCDict(), with control over frame parameters."]
2346 #[doc = " pledgedSrcSize must be correct. If srcSize is not known at init time, use"]
2347 #[doc = " value ZSTD_CONTENTSIZE_UNKNOWN."]
2348 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_initCStream_usingCDict_advanced( zcs: *mut ZSTD_CStream, cdict: *const ZSTD_CDict, fParams: ZSTD_frameParameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2349 pub fn ZSTD_initCStream_usingCDict_advanced(
2350 zcs: *mut ZSTD_CStream,
2351 cdict: *const ZSTD_CDict,
2352 fParams: ZSTD_frameParameters,
2353 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2354 ) -> usize;
2355 }
2356 extern "C" {
2357 #[doc = " ZSTD_resetCStream() :"]
2358 #[doc = " This function is deprecated, and is equivalent to:"]
2359 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2360 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2361 #[doc = ""]
2362 #[doc = " start a new frame, using same parameters from previous frame."]
2363 #[doc = " This is typically useful to skip dictionary loading stage, since it will re-use it in-place."]
2364 #[doc = " Note that zcs must be init at least once before using ZSTD_resetCStream()."]
2365 #[doc = " If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN."]
2366 #[doc = " If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end."]
2367 #[doc = " For the time being, pledgedSrcSize==0 is interpreted as \"srcSize unknown\" for compatibility with older programs,"]
2368 #[doc = " but it will change to mean \"empty\" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead."]
2369 #[doc = " @return : 0, or an error code (which can be tested using ZSTD_isError())"]
2370 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_resetCStream( zcs: *mut ZSTD_CStream, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2371 pub fn ZSTD_resetCStream(
2372 zcs: *mut ZSTD_CStream,
2373 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2374 ) -> usize;
2375 }
2376 #[repr(C)]
2377 #[derive(Debug, Copy, Clone)]
2378 pub struct ZSTD_frameProgression {
2379 pub ingested: ::std::os::raw::c_ulonglong,
2380 pub consumed: ::std::os::raw::c_ulonglong,
2381 pub produced: ::std::os::raw::c_ulonglong,
2382 pub flushed: ::std::os::raw::c_ulonglong,
2383 pub currentJobID: ::std::os::raw::c_uint,
2384 pub nbActiveWorkers: ::std::os::raw::c_uint,
2385 }
2386 #[test]
bindgen_test_layout_ZSTD_frameProgression()2387 fn bindgen_test_layout_ZSTD_frameProgression() {
2388 assert_eq!(
2389 ::core::mem::size_of::<ZSTD_frameProgression>(),
2390 40usize,
2391 concat!("Size of: ", stringify!(ZSTD_frameProgression))
2392 );
2393 assert_eq!(
2394 ::core::mem::align_of::<ZSTD_frameProgression>(),
2395 8usize,
2396 concat!("Alignment of ", stringify!(ZSTD_frameProgression))
2397 );
2398 assert_eq!(
2399 unsafe {
2400 &(*(::core::ptr::null::<ZSTD_frameProgression>())).ingested
2401 as *const _ as usize
2402 },
2403 0usize,
2404 concat!(
2405 "Offset of field: ",
2406 stringify!(ZSTD_frameProgression),
2407 "::",
2408 stringify!(ingested)
2409 )
2410 );
2411 assert_eq!(
2412 unsafe {
2413 &(*(::core::ptr::null::<ZSTD_frameProgression>())).consumed
2414 as *const _ as usize
2415 },
2416 8usize,
2417 concat!(
2418 "Offset of field: ",
2419 stringify!(ZSTD_frameProgression),
2420 "::",
2421 stringify!(consumed)
2422 )
2423 );
2424 assert_eq!(
2425 unsafe {
2426 &(*(::core::ptr::null::<ZSTD_frameProgression>())).produced
2427 as *const _ as usize
2428 },
2429 16usize,
2430 concat!(
2431 "Offset of field: ",
2432 stringify!(ZSTD_frameProgression),
2433 "::",
2434 stringify!(produced)
2435 )
2436 );
2437 assert_eq!(
2438 unsafe {
2439 &(*(::core::ptr::null::<ZSTD_frameProgression>())).flushed
2440 as *const _ as usize
2441 },
2442 24usize,
2443 concat!(
2444 "Offset of field: ",
2445 stringify!(ZSTD_frameProgression),
2446 "::",
2447 stringify!(flushed)
2448 )
2449 );
2450 assert_eq!(
2451 unsafe {
2452 &(*(::core::ptr::null::<ZSTD_frameProgression>())).currentJobID
2453 as *const _ as usize
2454 },
2455 32usize,
2456 concat!(
2457 "Offset of field: ",
2458 stringify!(ZSTD_frameProgression),
2459 "::",
2460 stringify!(currentJobID)
2461 )
2462 );
2463 assert_eq!(
2464 unsafe {
2465 &(*(::core::ptr::null::<ZSTD_frameProgression>())).nbActiveWorkers
2466 as *const _ as usize
2467 },
2468 36usize,
2469 concat!(
2470 "Offset of field: ",
2471 stringify!(ZSTD_frameProgression),
2472 "::",
2473 stringify!(nbActiveWorkers)
2474 )
2475 );
2476 }
2477 extern "C" {
ZSTD_getFrameProgression( cctx: *const ZSTD_CCtx, ) -> ZSTD_frameProgression2478 pub fn ZSTD_getFrameProgression(
2479 cctx: *const ZSTD_CCtx,
2480 ) -> ZSTD_frameProgression;
2481 }
2482 extern "C" {
2483 #[doc = " ZSTD_toFlushNow() :"]
2484 #[doc = " Tell how many bytes are ready to be flushed immediately."]
2485 #[doc = " Useful for multithreading scenarios (nbWorkers >= 1)."]
2486 #[doc = " Probe the oldest active job, defined as oldest job not yet entirely flushed,"]
2487 #[doc = " and check its output buffer."]
2488 #[doc = " @return : amount of data stored in oldest job and ready to be flushed immediately."]
2489 #[doc = " if @return == 0, it means either :"]
2490 #[doc = " + there is no active job (could be checked with ZSTD_frameProgression()), or"]
2491 #[doc = " + oldest job is still actively compressing data,"]
2492 #[doc = " but everything it has produced has also been flushed so far,"]
2493 #[doc = " therefore flush speed is limited by production speed of oldest job"]
2494 #[doc = " irrespective of the speed of concurrent (and newer) jobs."]
ZSTD_toFlushNow(cctx: *mut ZSTD_CCtx) -> usize2495 pub fn ZSTD_toFlushNow(cctx: *mut ZSTD_CCtx) -> usize;
2496 }
2497 extern "C" {
2498 #[doc = " This function is deprecated, and is equivalent to:"]
2499 #[doc = ""]
2500 #[doc = " ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);"]
2501 #[doc = " ZSTD_DCtx_loadDictionary(zds, dict, dictSize);"]
2502 #[doc = ""]
2503 #[doc = " note: no dictionary will be used if dict == NULL or dictSize < 8"]
2504 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_initDStream_usingDict( zds: *mut ZSTD_DStream, dict: *const ::core::ffi::c_void, dictSize: usize, ) -> usize2505 pub fn ZSTD_initDStream_usingDict(
2506 zds: *mut ZSTD_DStream,
2507 dict: *const ::core::ffi::c_void,
2508 dictSize: usize,
2509 ) -> usize;
2510 }
2511 extern "C" {
2512 #[doc = " This function is deprecated, and is equivalent to:"]
2513 #[doc = ""]
2514 #[doc = " ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);"]
2515 #[doc = " ZSTD_DCtx_refDDict(zds, ddict);"]
2516 #[doc = ""]
2517 #[doc = " note : ddict is referenced, it must outlive decompression session"]
2518 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_initDStream_usingDDict( zds: *mut ZSTD_DStream, ddict: *const ZSTD_DDict, ) -> usize2519 pub fn ZSTD_initDStream_usingDDict(
2520 zds: *mut ZSTD_DStream,
2521 ddict: *const ZSTD_DDict,
2522 ) -> usize;
2523 }
2524 extern "C" {
2525 #[doc = " This function is deprecated, and is equivalent to:"]
2526 #[doc = ""]
2527 #[doc = " ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);"]
2528 #[doc = ""]
2529 #[doc = " re-use decompression parameters from previous init; saves dictionary loading"]
2530 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_resetDStream(zds: *mut ZSTD_DStream) -> usize2531 pub fn ZSTD_resetDStream(zds: *mut ZSTD_DStream) -> usize;
2532 }
2533 extern "C" {
2534 #[doc = "Buffer-less streaming compression (synchronous mode)"]
2535 #[doc = ""]
2536 #[doc = "A ZSTD_CCtx object is required to track streaming operations."]
2537 #[doc = "Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource."]
2538 #[doc = "ZSTD_CCtx object can be re-used multiple times within successive compression operations."]
2539 #[doc = ""]
2540 #[doc = "Start by initializing a context."]
2541 #[doc = "Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression,"]
2542 #[doc = "or ZSTD_compressBegin_advanced(), for finer parameter control."]
2543 #[doc = "It's also possible to duplicate a reference context which has already been initialized, using ZSTD_copyCCtx()"]
2544 #[doc = ""]
2545 #[doc = "Then, consume your input using ZSTD_compressContinue()."]
2546 #[doc = "There are some important considerations to keep in mind when using this advanced function :"]
2547 #[doc = "- ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only."]
2548 #[doc = "- Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks."]
2549 #[doc = "- Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario."]
2550 #[doc = "Worst case evaluation is provided by ZSTD_compressBound()."]
2551 #[doc = "ZSTD_compressContinue() doesn't guarantee recover after a failed compression."]
2552 #[doc = "- ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog)."]
2553 #[doc = "It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks)"]
2554 #[doc = "- ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps."]
2555 #[doc = "In which case, it will \"discard\" the relevant memory section from its history."]
2556 #[doc = ""]
2557 #[doc = "Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum."]
2558 #[doc = "It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame."]
2559 #[doc = "Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders."]
2560 #[doc = ""]
2561 #[doc = "`ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress again."]
ZSTD_compressBegin( cctx: *mut ZSTD_CCtx, compressionLevel: ::std::os::raw::c_int, ) -> usize2562 pub fn ZSTD_compressBegin(
2563 cctx: *mut ZSTD_CCtx,
2564 compressionLevel: ::std::os::raw::c_int,
2565 ) -> usize;
2566 }
2567 extern "C" {
ZSTD_compressBegin_usingDict( cctx: *mut ZSTD_CCtx, dict: *const ::core::ffi::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize2568 pub fn ZSTD_compressBegin_usingDict(
2569 cctx: *mut ZSTD_CCtx,
2570 dict: *const ::core::ffi::c_void,
2571 dictSize: usize,
2572 compressionLevel: ::std::os::raw::c_int,
2573 ) -> usize;
2574 }
2575 extern "C" {
ZSTD_compressBegin_advanced( cctx: *mut ZSTD_CCtx, dict: *const ::core::ffi::c_void, dictSize: usize, params: ZSTD_parameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2576 pub fn ZSTD_compressBegin_advanced(
2577 cctx: *mut ZSTD_CCtx,
2578 dict: *const ::core::ffi::c_void,
2579 dictSize: usize,
2580 params: ZSTD_parameters,
2581 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2582 ) -> usize;
2583 }
2584 extern "C" {
ZSTD_compressBegin_usingCDict( cctx: *mut ZSTD_CCtx, cdict: *const ZSTD_CDict, ) -> usize2585 pub fn ZSTD_compressBegin_usingCDict(
2586 cctx: *mut ZSTD_CCtx,
2587 cdict: *const ZSTD_CDict,
2588 ) -> usize;
2589 }
2590 extern "C" {
ZSTD_compressBegin_usingCDict_advanced( cctx: *mut ZSTD_CCtx, cdict: *const ZSTD_CDict, fParams: ZSTD_frameParameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2591 pub fn ZSTD_compressBegin_usingCDict_advanced(
2592 cctx: *mut ZSTD_CCtx,
2593 cdict: *const ZSTD_CDict,
2594 fParams: ZSTD_frameParameters,
2595 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2596 ) -> usize;
2597 }
2598 extern "C" {
ZSTD_copyCCtx( cctx: *mut ZSTD_CCtx, preparedCCtx: *const ZSTD_CCtx, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2599 pub fn ZSTD_copyCCtx(
2600 cctx: *mut ZSTD_CCtx,
2601 preparedCCtx: *const ZSTD_CCtx,
2602 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2603 ) -> usize;
2604 }
2605 extern "C" {
ZSTD_compressContinue( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize2606 pub fn ZSTD_compressContinue(
2607 cctx: *mut ZSTD_CCtx,
2608 dst: *mut ::core::ffi::c_void,
2609 dstCapacity: usize,
2610 src: *const ::core::ffi::c_void,
2611 srcSize: usize,
2612 ) -> usize;
2613 }
2614 extern "C" {
ZSTD_compressEnd( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize2615 pub fn ZSTD_compressEnd(
2616 cctx: *mut ZSTD_CCtx,
2617 dst: *mut ::core::ffi::c_void,
2618 dstCapacity: usize,
2619 src: *const ::core::ffi::c_void,
2620 srcSize: usize,
2621 ) -> usize;
2622 }
2623 #[repr(u32)]
2624 #[doc = "Buffer-less streaming decompression (synchronous mode)"]
2625 #[doc = ""]
2626 #[doc = "A ZSTD_DCtx object is required to track streaming operations."]
2627 #[doc = "Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it."]
2628 #[doc = "A ZSTD_DCtx object can be re-used multiple times."]
2629 #[doc = ""]
2630 #[doc = "First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader()."]
2631 #[doc = "Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough."]
2632 #[doc = "Data fragment must be large enough to ensure successful decoding."]
2633 #[doc = "`ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough."]
2634 #[doc = "@result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled."]
2635 #[doc = ">0 : `srcSize` is too small, please provide at least @result bytes on next attempt."]
2636 #[doc = "errorCode, which can be tested using ZSTD_isError()."]
2637 #[doc = ""]
2638 #[doc = "It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,"]
2639 #[doc = "such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`)."]
2640 #[doc = "Note that these values could be wrong, either because of data corruption, or because a 3rd party deliberately spoofs false information."]
2641 #[doc = "As a consequence, check that values remain within valid application range."]
2642 #[doc = "For example, do not allocate memory blindly, check that `windowSize` is within expectation."]
2643 #[doc = "Each application can set its own limits, depending on local restrictions."]
2644 #[doc = "For extended interoperability, it is recommended to support `windowSize` of at least 8 MB."]
2645 #[doc = ""]
2646 #[doc = "ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize` bytes."]
2647 #[doc = "ZSTD_decompressContinue() is very sensitive to contiguity,"]
2648 #[doc = "if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place,"]
2649 #[doc = "or that previous contiguous segment is large enough to properly handle maximum back-reference distance."]
2650 #[doc = "There are multiple ways to guarantee this condition."]
2651 #[doc = ""]
2652 #[doc = "The most memory efficient way is to use a round buffer of sufficient size."]
2653 #[doc = "Sufficient size is determined by invoking ZSTD_decodingBufferSize_min(),"]
2654 #[doc = "which can @return an error code if required value is too large for current system (in 32-bits mode)."]
2655 #[doc = "In a round buffer methodology, ZSTD_decompressContinue() decompresses each block next to previous one,"]
2656 #[doc = "up to the moment there is not enough room left in the buffer to guarantee decoding another full block,"]
2657 #[doc = "which maximum size is provided in `ZSTD_frameHeader` structure, field `blockSizeMax`."]
2658 #[doc = "At which point, decoding can resume from the beginning of the buffer."]
2659 #[doc = "Note that already decoded data stored in the buffer should be flushed before being overwritten."]
2660 #[doc = ""]
2661 #[doc = "There are alternatives possible, for example using two or more buffers of size `windowSize` each, though they consume more memory."]
2662 #[doc = ""]
2663 #[doc = "Finally, if you control the compression process, you can also ignore all buffer size rules,"]
2664 #[doc = "as long as the encoder and decoder progress in \"lock-step\","]
2665 #[doc = "aka use exactly the same buffer sizes, break contiguity at the same place, etc."]
2666 #[doc = ""]
2667 #[doc = "Once buffers are setup, start decompression, with ZSTD_decompressBegin()."]
2668 #[doc = "If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict()."]
2669 #[doc = ""]
2670 #[doc = "Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively."]
2671 #[doc = "ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue()."]
2672 #[doc = "ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail."]
2673 #[doc = ""]
2674 #[doc = "@result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity)."]
2675 #[doc = "It can be zero : it just means ZSTD_decompressContinue() has decoded some metadata item."]
2676 #[doc = "It can also be an error code, which can be tested with ZSTD_isError()."]
2677 #[doc = ""]
2678 #[doc = "A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero."]
2679 #[doc = "Context can then be reset to start a new decompression."]
2680 #[doc = ""]
2681 #[doc = "Note : it's possible to know if next input to present is a header or a block, using ZSTD_nextInputType()."]
2682 #[doc = "This information is not required to properly decode a frame."]
2683 #[doc = ""]
2684 #[doc = "== Special case : skippable frames =="]
2685 #[doc = ""]
2686 #[doc = "Skippable frames allow integration of user-defined data into a flow of concatenated frames."]
2687 #[doc = "Skippable frames will be ignored (skipped) by decompressor."]
2688 #[doc = "The format of skippable frames is as follows :"]
2689 #[doc = "a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F"]
2690 #[doc = "b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits"]
2691 #[doc = "c) Frame Content - any content (User Data) of length equal to Frame Size"]
2692 #[doc = "For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame."]
2693 #[doc = "For skippable frames ZSTD_decompressContinue() always returns 0 : it only skips the content."]
2694 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2695 pub enum ZSTD_frameType_e {
2696 ZSTD_frame = 0,
2697 ZSTD_skippableFrame = 1,
2698 }
2699 #[repr(C)]
2700 #[derive(Debug, Copy, Clone)]
2701 pub struct ZSTD_frameHeader {
2702 pub frameContentSize: ::std::os::raw::c_ulonglong,
2703 pub windowSize: ::std::os::raw::c_ulonglong,
2704 pub blockSizeMax: ::std::os::raw::c_uint,
2705 pub frameType: ZSTD_frameType_e,
2706 pub headerSize: ::std::os::raw::c_uint,
2707 pub dictID: ::std::os::raw::c_uint,
2708 pub checksumFlag: ::std::os::raw::c_uint,
2709 }
2710 #[test]
bindgen_test_layout_ZSTD_frameHeader()2711 fn bindgen_test_layout_ZSTD_frameHeader() {
2712 assert_eq!(
2713 ::core::mem::size_of::<ZSTD_frameHeader>(),
2714 40usize,
2715 concat!("Size of: ", stringify!(ZSTD_frameHeader))
2716 );
2717 assert_eq!(
2718 ::core::mem::align_of::<ZSTD_frameHeader>(),
2719 8usize,
2720 concat!("Alignment of ", stringify!(ZSTD_frameHeader))
2721 );
2722 assert_eq!(
2723 unsafe {
2724 &(*(::core::ptr::null::<ZSTD_frameHeader>())).frameContentSize
2725 as *const _ as usize
2726 },
2727 0usize,
2728 concat!(
2729 "Offset of field: ",
2730 stringify!(ZSTD_frameHeader),
2731 "::",
2732 stringify!(frameContentSize)
2733 )
2734 );
2735 assert_eq!(
2736 unsafe {
2737 &(*(::core::ptr::null::<ZSTD_frameHeader>())).windowSize
2738 as *const _ as usize
2739 },
2740 8usize,
2741 concat!(
2742 "Offset of field: ",
2743 stringify!(ZSTD_frameHeader),
2744 "::",
2745 stringify!(windowSize)
2746 )
2747 );
2748 assert_eq!(
2749 unsafe {
2750 &(*(::core::ptr::null::<ZSTD_frameHeader>())).blockSizeMax
2751 as *const _ as usize
2752 },
2753 16usize,
2754 concat!(
2755 "Offset of field: ",
2756 stringify!(ZSTD_frameHeader),
2757 "::",
2758 stringify!(blockSizeMax)
2759 )
2760 );
2761 assert_eq!(
2762 unsafe {
2763 &(*(::core::ptr::null::<ZSTD_frameHeader>())).frameType as *const _
2764 as usize
2765 },
2766 20usize,
2767 concat!(
2768 "Offset of field: ",
2769 stringify!(ZSTD_frameHeader),
2770 "::",
2771 stringify!(frameType)
2772 )
2773 );
2774 assert_eq!(
2775 unsafe {
2776 &(*(::core::ptr::null::<ZSTD_frameHeader>())).headerSize
2777 as *const _ as usize
2778 },
2779 24usize,
2780 concat!(
2781 "Offset of field: ",
2782 stringify!(ZSTD_frameHeader),
2783 "::",
2784 stringify!(headerSize)
2785 )
2786 );
2787 assert_eq!(
2788 unsafe {
2789 &(*(::core::ptr::null::<ZSTD_frameHeader>())).dictID as *const _
2790 as usize
2791 },
2792 28usize,
2793 concat!(
2794 "Offset of field: ",
2795 stringify!(ZSTD_frameHeader),
2796 "::",
2797 stringify!(dictID)
2798 )
2799 );
2800 assert_eq!(
2801 unsafe {
2802 &(*(::core::ptr::null::<ZSTD_frameHeader>())).checksumFlag
2803 as *const _ as usize
2804 },
2805 32usize,
2806 concat!(
2807 "Offset of field: ",
2808 stringify!(ZSTD_frameHeader),
2809 "::",
2810 stringify!(checksumFlag)
2811 )
2812 );
2813 }
2814 extern "C" {
2815 #[doc = " ZSTD_getFrameHeader() :"]
2816 #[doc = " decode Frame Header, or requires larger `srcSize`."]
2817 #[doc = " @return : 0, `zfhPtr` is correctly filled,"]
2818 #[doc = " >0, `srcSize` is too small, value is wanted `srcSize` amount,"]
2819 #[doc = " or an error code, which can be tested using ZSTD_isError()"]
ZSTD_getFrameHeader( zfhPtr: *mut ZSTD_frameHeader, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize2820 pub fn ZSTD_getFrameHeader(
2821 zfhPtr: *mut ZSTD_frameHeader,
2822 src: *const ::core::ffi::c_void,
2823 srcSize: usize,
2824 ) -> usize;
2825 }
2826 extern "C" {
2827 #[doc = " ZSTD_getFrameHeader_advanced() :"]
2828 #[doc = " same as ZSTD_getFrameHeader(),"]
2829 #[doc = " with added capability to select a format (like ZSTD_f_zstd1_magicless)"]
ZSTD_getFrameHeader_advanced( zfhPtr: *mut ZSTD_frameHeader, src: *const ::core::ffi::c_void, srcSize: usize, format: ZSTD_format_e, ) -> usize2830 pub fn ZSTD_getFrameHeader_advanced(
2831 zfhPtr: *mut ZSTD_frameHeader,
2832 src: *const ::core::ffi::c_void,
2833 srcSize: usize,
2834 format: ZSTD_format_e,
2835 ) -> usize;
2836 }
2837 extern "C" {
ZSTD_decodingBufferSize_min( windowSize: ::std::os::raw::c_ulonglong, frameContentSize: ::std::os::raw::c_ulonglong, ) -> usize2838 pub fn ZSTD_decodingBufferSize_min(
2839 windowSize: ::std::os::raw::c_ulonglong,
2840 frameContentSize: ::std::os::raw::c_ulonglong,
2841 ) -> usize;
2842 }
2843 extern "C" {
ZSTD_decompressBegin(dctx: *mut ZSTD_DCtx) -> usize2844 pub fn ZSTD_decompressBegin(dctx: *mut ZSTD_DCtx) -> usize;
2845 }
2846 extern "C" {
ZSTD_decompressBegin_usingDict( dctx: *mut ZSTD_DCtx, dict: *const ::core::ffi::c_void, dictSize: usize, ) -> usize2847 pub fn ZSTD_decompressBegin_usingDict(
2848 dctx: *mut ZSTD_DCtx,
2849 dict: *const ::core::ffi::c_void,
2850 dictSize: usize,
2851 ) -> usize;
2852 }
2853 extern "C" {
ZSTD_decompressBegin_usingDDict( dctx: *mut ZSTD_DCtx, ddict: *const ZSTD_DDict, ) -> usize2854 pub fn ZSTD_decompressBegin_usingDDict(
2855 dctx: *mut ZSTD_DCtx,
2856 ddict: *const ZSTD_DDict,
2857 ) -> usize;
2858 }
2859 extern "C" {
ZSTD_nextSrcSizeToDecompress(dctx: *mut ZSTD_DCtx) -> usize2860 pub fn ZSTD_nextSrcSizeToDecompress(dctx: *mut ZSTD_DCtx) -> usize;
2861 }
2862 extern "C" {
ZSTD_decompressContinue( dctx: *mut ZSTD_DCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize2863 pub fn ZSTD_decompressContinue(
2864 dctx: *mut ZSTD_DCtx,
2865 dst: *mut ::core::ffi::c_void,
2866 dstCapacity: usize,
2867 src: *const ::core::ffi::c_void,
2868 srcSize: usize,
2869 ) -> usize;
2870 }
2871 extern "C" {
ZSTD_copyDCtx(dctx: *mut ZSTD_DCtx, preparedDCtx: *const ZSTD_DCtx)2872 pub fn ZSTD_copyDCtx(dctx: *mut ZSTD_DCtx, preparedDCtx: *const ZSTD_DCtx);
2873 }
2874 #[repr(u32)]
2875 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2876 pub enum ZSTD_nextInputType_e {
2877 ZSTDnit_frameHeader = 0,
2878 ZSTDnit_blockHeader = 1,
2879 ZSTDnit_block = 2,
2880 ZSTDnit_lastBlock = 3,
2881 ZSTDnit_checksum = 4,
2882 ZSTDnit_skippableFrame = 5,
2883 }
2884 extern "C" {
ZSTD_nextInputType(dctx: *mut ZSTD_DCtx) -> ZSTD_nextInputType_e2885 pub fn ZSTD_nextInputType(dctx: *mut ZSTD_DCtx) -> ZSTD_nextInputType_e;
2886 }
2887 extern "C" {
2888 #[doc = "Block functions produce and decode raw zstd blocks, without frame metadata."]
2889 #[doc = "Frame metadata cost is typically ~12 bytes, which can be non-negligible for very small blocks (< 100 bytes)."]
2890 #[doc = "But users will have to take in charge needed metadata to regenerate data, such as compressed and content sizes."]
2891 #[doc = ""]
2892 #[doc = "A few rules to respect :"]
2893 #[doc = "- Compressing and decompressing require a context structure"]
2894 #[doc = "+ Use ZSTD_createCCtx() and ZSTD_createDCtx()"]
2895 #[doc = "- It is necessary to init context before starting"]
2896 #[doc = "+ compression : any ZSTD_compressBegin*() variant, including with dictionary"]
2897 #[doc = "+ decompression : any ZSTD_decompressBegin*() variant, including with dictionary"]
2898 #[doc = "+ copyCCtx() and copyDCtx() can be used too"]
2899 #[doc = "- Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB"]
2900 #[doc = "+ If input is larger than a block size, it's necessary to split input data into multiple blocks"]
2901 #[doc = "+ For inputs larger than a single block, consider using regular ZSTD_compress() instead."]
2902 #[doc = "Frame metadata is not that costly, and quickly becomes negligible as source size grows larger than a block."]
2903 #[doc = "- When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero) !"]
2904 #[doc = "===> In which case, nothing is produced into `dst` !"]
2905 #[doc = "+ User __must__ test for such outcome and deal directly with uncompressed data"]
2906 #[doc = "+ A block cannot be declared incompressible if ZSTD_compressBlock() return value was != 0."]
2907 #[doc = "Doing so would mess up with statistics history, leading to potential data corruption."]
2908 #[doc = "+ ZSTD_decompressBlock() _doesn't accept uncompressed data as input_ !!"]
2909 #[doc = "+ In case of multiple successive blocks, should some of them be uncompressed,"]
2910 #[doc = "decoder must be informed of their existence in order to follow proper history."]
2911 #[doc = "Use ZSTD_insertBlock() for such a case."]
ZSTD_getBlockSize(cctx: *const ZSTD_CCtx) -> usize2912 pub fn ZSTD_getBlockSize(cctx: *const ZSTD_CCtx) -> usize;
2913 }
2914 extern "C" {
ZSTD_compressBlock( cctx: *mut ZSTD_CCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize2915 pub fn ZSTD_compressBlock(
2916 cctx: *mut ZSTD_CCtx,
2917 dst: *mut ::core::ffi::c_void,
2918 dstCapacity: usize,
2919 src: *const ::core::ffi::c_void,
2920 srcSize: usize,
2921 ) -> usize;
2922 }
2923 extern "C" {
ZSTD_decompressBlock( dctx: *mut ZSTD_DCtx, dst: *mut ::core::ffi::c_void, dstCapacity: usize, src: *const ::core::ffi::c_void, srcSize: usize, ) -> usize2924 pub fn ZSTD_decompressBlock(
2925 dctx: *mut ZSTD_DCtx,
2926 dst: *mut ::core::ffi::c_void,
2927 dstCapacity: usize,
2928 src: *const ::core::ffi::c_void,
2929 srcSize: usize,
2930 ) -> usize;
2931 }
2932 extern "C" {
ZSTD_insertBlock( dctx: *mut ZSTD_DCtx, blockStart: *const ::core::ffi::c_void, blockSize: usize, ) -> usize2933 pub fn ZSTD_insertBlock(
2934 dctx: *mut ZSTD_DCtx,
2935 blockStart: *const ::core::ffi::c_void,
2936 blockSize: usize,
2937 ) -> usize;
2938 }
2939 extern "C" {
2940 #[doc = " ZDICT_trainFromBuffer():"]
2941 #[doc = " Train a dictionary from an array of samples."]
2942 #[doc = " Redirect towards ZDICT_optimizeTrainFromBuffer_fastCover() single-threaded, with d=8, steps=4,"]
2943 #[doc = " f=20, and accel=1."]
2944 #[doc = " Samples must be stored concatenated in a single flat buffer `samplesBuffer`,"]
2945 #[doc = " supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order."]
2946 #[doc = " The resulting dictionary will be saved into `dictBuffer`."]
2947 #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
2948 #[doc = " or an error code, which can be tested with ZDICT_isError()."]
2949 #[doc = " Note: Dictionary training will fail if there are not enough samples to construct a"]
2950 #[doc = " dictionary, or if most of the samples are too small (< 8 bytes being the lower limit)."]
2951 #[doc = " If dictionary training fails, you should use zstd without a dictionary, as the dictionary"]
2952 #[doc = " would've been ineffective anyways. If you believe your samples would benefit from a dictionary"]
2953 #[doc = " please open an issue with details, and we can look into it."]
2954 #[doc = " Note: ZDICT_trainFromBuffer()'s memory usage is about 6 MB."]
2955 #[doc = " Tips: In general, a reasonable dictionary has a size of ~ 100 KB."]
2956 #[doc = " It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`."]
2957 #[doc = " In general, it's recommended to provide a few thousands samples, though this can vary a lot."]
2958 #[doc = " It's recommended that total size of all samples be about ~x100 times the target size of dictionary."]
ZDICT_trainFromBuffer( dictBuffer: *mut ::core::ffi::c_void, dictBufferCapacity: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, ) -> usize2959 pub fn ZDICT_trainFromBuffer(
2960 dictBuffer: *mut ::core::ffi::c_void,
2961 dictBufferCapacity: usize,
2962 samplesBuffer: *const ::core::ffi::c_void,
2963 samplesSizes: *const usize,
2964 nbSamples: ::std::os::raw::c_uint,
2965 ) -> usize;
2966 }
2967 #[repr(C)]
2968 #[derive(Debug, Copy, Clone)]
2969 pub struct ZDICT_params_t {
2970 pub compressionLevel: ::std::os::raw::c_int,
2971 pub notificationLevel: ::std::os::raw::c_uint,
2972 pub dictID: ::std::os::raw::c_uint,
2973 }
2974 #[test]
bindgen_test_layout_ZDICT_params_t()2975 fn bindgen_test_layout_ZDICT_params_t() {
2976 assert_eq!(
2977 ::core::mem::size_of::<ZDICT_params_t>(),
2978 12usize,
2979 concat!("Size of: ", stringify!(ZDICT_params_t))
2980 );
2981 assert_eq!(
2982 ::core::mem::align_of::<ZDICT_params_t>(),
2983 4usize,
2984 concat!("Alignment of ", stringify!(ZDICT_params_t))
2985 );
2986 assert_eq!(
2987 unsafe {
2988 &(*(::core::ptr::null::<ZDICT_params_t>())).compressionLevel
2989 as *const _ as usize
2990 },
2991 0usize,
2992 concat!(
2993 "Offset of field: ",
2994 stringify!(ZDICT_params_t),
2995 "::",
2996 stringify!(compressionLevel)
2997 )
2998 );
2999 assert_eq!(
3000 unsafe {
3001 &(*(::core::ptr::null::<ZDICT_params_t>())).notificationLevel
3002 as *const _ as usize
3003 },
3004 4usize,
3005 concat!(
3006 "Offset of field: ",
3007 stringify!(ZDICT_params_t),
3008 "::",
3009 stringify!(notificationLevel)
3010 )
3011 );
3012 assert_eq!(
3013 unsafe {
3014 &(*(::core::ptr::null::<ZDICT_params_t>())).dictID as *const _
3015 as usize
3016 },
3017 8usize,
3018 concat!(
3019 "Offset of field: ",
3020 stringify!(ZDICT_params_t),
3021 "::",
3022 stringify!(dictID)
3023 )
3024 );
3025 }
3026 extern "C" {
3027 #[doc = " ZDICT_finalizeDictionary():"]
3028 #[doc = " Given a custom content as a basis for dictionary, and a set of samples,"]
3029 #[doc = " finalize dictionary by adding headers and statistics according to the zstd"]
3030 #[doc = " dictionary format."]
3031 #[doc = ""]
3032 #[doc = " Samples must be stored concatenated in a flat buffer `samplesBuffer`,"]
3033 #[doc = " supplied with an array of sizes `samplesSizes`, providing the size of each"]
3034 #[doc = " sample in order. The samples are used to construct the statistics, so they"]
3035 #[doc = " should be representative of what you will compress with this dictionary."]
3036 #[doc = ""]
3037 #[doc = " The compression level can be set in `parameters`. You should pass the"]
3038 #[doc = " compression level you expect to use in production. The statistics for each"]
3039 #[doc = " compression level differ, so tuning the dictionary for the compression level"]
3040 #[doc = " can help quite a bit."]
3041 #[doc = ""]
3042 #[doc = " You can set an explicit dictionary ID in `parameters`, or allow us to pick"]
3043 #[doc = " a random dictionary ID for you, but we can't guarantee no collisions."]
3044 #[doc = ""]
3045 #[doc = " The dstDictBuffer and the dictContent may overlap, and the content will be"]
3046 #[doc = " appended to the end of the header. If the header + the content doesn't fit in"]
3047 #[doc = " maxDictSize the beginning of the content is truncated to make room, since it"]
3048 #[doc = " is presumed that the most profitable content is at the end of the dictionary,"]
3049 #[doc = " since that is the cheapest to reference."]
3050 #[doc = ""]
3051 #[doc = " `dictContentSize` must be >= ZDICT_CONTENTSIZE_MIN bytes."]
3052 #[doc = " `maxDictSize` must be >= max(dictContentSize, ZSTD_DICTSIZE_MIN)."]
3053 #[doc = ""]
3054 #[doc = " @return: size of dictionary stored into `dstDictBuffer` (<= `maxDictSize`),"]
3055 #[doc = " or an error code, which can be tested by ZDICT_isError()."]
3056 #[doc = " Note: ZDICT_finalizeDictionary() will push notifications into stderr if"]
3057 #[doc = " instructed to, using notificationLevel>0."]
3058 #[doc = " NOTE: This function currently may fail in several edge cases including:"]
3059 #[doc = " * Not enough samples"]
3060 #[doc = " * Samples are uncompressible"]
3061 #[doc = " * Samples are all exactly the same"]
ZDICT_finalizeDictionary( dstDictBuffer: *mut ::core::ffi::c_void, maxDictSize: usize, dictContent: *const ::core::ffi::c_void, dictContentSize: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, parameters: ZDICT_params_t, ) -> usize3062 pub fn ZDICT_finalizeDictionary(
3063 dstDictBuffer: *mut ::core::ffi::c_void,
3064 maxDictSize: usize,
3065 dictContent: *const ::core::ffi::c_void,
3066 dictContentSize: usize,
3067 samplesBuffer: *const ::core::ffi::c_void,
3068 samplesSizes: *const usize,
3069 nbSamples: ::std::os::raw::c_uint,
3070 parameters: ZDICT_params_t,
3071 ) -> usize;
3072 }
3073 extern "C" {
ZDICT_getDictID( dictBuffer: *const ::core::ffi::c_void, dictSize: usize, ) -> ::std::os::raw::c_uint3074 pub fn ZDICT_getDictID(
3075 dictBuffer: *const ::core::ffi::c_void,
3076 dictSize: usize,
3077 ) -> ::std::os::raw::c_uint;
3078 }
3079 extern "C" {
ZDICT_getDictHeaderSize( dictBuffer: *const ::core::ffi::c_void, dictSize: usize, ) -> usize3080 pub fn ZDICT_getDictHeaderSize(
3081 dictBuffer: *const ::core::ffi::c_void,
3082 dictSize: usize,
3083 ) -> usize;
3084 }
3085 extern "C" {
ZDICT_isError(errorCode: usize) -> ::std::os::raw::c_uint3086 pub fn ZDICT_isError(errorCode: usize) -> ::std::os::raw::c_uint;
3087 }
3088 extern "C" {
ZDICT_getErrorName( errorCode: usize, ) -> *const ::std::os::raw::c_char3089 pub fn ZDICT_getErrorName(
3090 errorCode: usize,
3091 ) -> *const ::std::os::raw::c_char;
3092 }
3093 #[doc = " ZDICT_cover_params_t:"]
3094 #[doc = " k and d are the only required parameters."]
3095 #[doc = " For others, value 0 means default."]
3096 #[repr(C)]
3097 #[derive(Debug, Copy, Clone)]
3098 pub struct ZDICT_cover_params_t {
3099 pub k: ::std::os::raw::c_uint,
3100 pub d: ::std::os::raw::c_uint,
3101 pub steps: ::std::os::raw::c_uint,
3102 pub nbThreads: ::std::os::raw::c_uint,
3103 pub splitPoint: f64,
3104 pub shrinkDict: ::std::os::raw::c_uint,
3105 pub shrinkDictMaxRegression: ::std::os::raw::c_uint,
3106 pub zParams: ZDICT_params_t,
3107 }
3108 #[test]
bindgen_test_layout_ZDICT_cover_params_t()3109 fn bindgen_test_layout_ZDICT_cover_params_t() {
3110 assert_eq!(
3111 ::core::mem::size_of::<ZDICT_cover_params_t>(),
3112 48usize,
3113 concat!("Size of: ", stringify!(ZDICT_cover_params_t))
3114 );
3115 assert_eq!(
3116 ::core::mem::align_of::<ZDICT_cover_params_t>(),
3117 8usize,
3118 concat!("Alignment of ", stringify!(ZDICT_cover_params_t))
3119 );
3120 assert_eq!(
3121 unsafe {
3122 &(*(::core::ptr::null::<ZDICT_cover_params_t>())).k as *const _
3123 as usize
3124 },
3125 0usize,
3126 concat!(
3127 "Offset of field: ",
3128 stringify!(ZDICT_cover_params_t),
3129 "::",
3130 stringify!(k)
3131 )
3132 );
3133 assert_eq!(
3134 unsafe {
3135 &(*(::core::ptr::null::<ZDICT_cover_params_t>())).d as *const _
3136 as usize
3137 },
3138 4usize,
3139 concat!(
3140 "Offset of field: ",
3141 stringify!(ZDICT_cover_params_t),
3142 "::",
3143 stringify!(d)
3144 )
3145 );
3146 assert_eq!(
3147 unsafe {
3148 &(*(::core::ptr::null::<ZDICT_cover_params_t>())).steps as *const _
3149 as usize
3150 },
3151 8usize,
3152 concat!(
3153 "Offset of field: ",
3154 stringify!(ZDICT_cover_params_t),
3155 "::",
3156 stringify!(steps)
3157 )
3158 );
3159 assert_eq!(
3160 unsafe {
3161 &(*(::core::ptr::null::<ZDICT_cover_params_t>())).nbThreads
3162 as *const _ as usize
3163 },
3164 12usize,
3165 concat!(
3166 "Offset of field: ",
3167 stringify!(ZDICT_cover_params_t),
3168 "::",
3169 stringify!(nbThreads)
3170 )
3171 );
3172 assert_eq!(
3173 unsafe {
3174 &(*(::core::ptr::null::<ZDICT_cover_params_t>())).splitPoint
3175 as *const _ as usize
3176 },
3177 16usize,
3178 concat!(
3179 "Offset of field: ",
3180 stringify!(ZDICT_cover_params_t),
3181 "::",
3182 stringify!(splitPoint)
3183 )
3184 );
3185 assert_eq!(
3186 unsafe {
3187 &(*(::core::ptr::null::<ZDICT_cover_params_t>())).shrinkDict
3188 as *const _ as usize
3189 },
3190 24usize,
3191 concat!(
3192 "Offset of field: ",
3193 stringify!(ZDICT_cover_params_t),
3194 "::",
3195 stringify!(shrinkDict)
3196 )
3197 );
3198 assert_eq!(
3199 unsafe {
3200 &(*(::core::ptr::null::<ZDICT_cover_params_t>()))
3201 .shrinkDictMaxRegression as *const _ as usize
3202 },
3203 28usize,
3204 concat!(
3205 "Offset of field: ",
3206 stringify!(ZDICT_cover_params_t),
3207 "::",
3208 stringify!(shrinkDictMaxRegression)
3209 )
3210 );
3211 assert_eq!(
3212 unsafe {
3213 &(*(::core::ptr::null::<ZDICT_cover_params_t>())).zParams
3214 as *const _ as usize
3215 },
3216 32usize,
3217 concat!(
3218 "Offset of field: ",
3219 stringify!(ZDICT_cover_params_t),
3220 "::",
3221 stringify!(zParams)
3222 )
3223 );
3224 }
3225 #[repr(C)]
3226 #[derive(Debug, Copy, Clone)]
3227 pub struct ZDICT_fastCover_params_t {
3228 pub k: ::std::os::raw::c_uint,
3229 pub d: ::std::os::raw::c_uint,
3230 pub f: ::std::os::raw::c_uint,
3231 pub steps: ::std::os::raw::c_uint,
3232 pub nbThreads: ::std::os::raw::c_uint,
3233 pub splitPoint: f64,
3234 pub accel: ::std::os::raw::c_uint,
3235 pub shrinkDict: ::std::os::raw::c_uint,
3236 pub shrinkDictMaxRegression: ::std::os::raw::c_uint,
3237 pub zParams: ZDICT_params_t,
3238 }
3239 #[test]
bindgen_test_layout_ZDICT_fastCover_params_t()3240 fn bindgen_test_layout_ZDICT_fastCover_params_t() {
3241 assert_eq!(
3242 ::core::mem::size_of::<ZDICT_fastCover_params_t>(),
3243 56usize,
3244 concat!("Size of: ", stringify!(ZDICT_fastCover_params_t))
3245 );
3246 assert_eq!(
3247 ::core::mem::align_of::<ZDICT_fastCover_params_t>(),
3248 8usize,
3249 concat!("Alignment of ", stringify!(ZDICT_fastCover_params_t))
3250 );
3251 assert_eq!(
3252 unsafe {
3253 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).k as *const _
3254 as usize
3255 },
3256 0usize,
3257 concat!(
3258 "Offset of field: ",
3259 stringify!(ZDICT_fastCover_params_t),
3260 "::",
3261 stringify!(k)
3262 )
3263 );
3264 assert_eq!(
3265 unsafe {
3266 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).d as *const _
3267 as usize
3268 },
3269 4usize,
3270 concat!(
3271 "Offset of field: ",
3272 stringify!(ZDICT_fastCover_params_t),
3273 "::",
3274 stringify!(d)
3275 )
3276 );
3277 assert_eq!(
3278 unsafe {
3279 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).f as *const _
3280 as usize
3281 },
3282 8usize,
3283 concat!(
3284 "Offset of field: ",
3285 stringify!(ZDICT_fastCover_params_t),
3286 "::",
3287 stringify!(f)
3288 )
3289 );
3290 assert_eq!(
3291 unsafe {
3292 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).steps
3293 as *const _ as usize
3294 },
3295 12usize,
3296 concat!(
3297 "Offset of field: ",
3298 stringify!(ZDICT_fastCover_params_t),
3299 "::",
3300 stringify!(steps)
3301 )
3302 );
3303 assert_eq!(
3304 unsafe {
3305 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).nbThreads
3306 as *const _ as usize
3307 },
3308 16usize,
3309 concat!(
3310 "Offset of field: ",
3311 stringify!(ZDICT_fastCover_params_t),
3312 "::",
3313 stringify!(nbThreads)
3314 )
3315 );
3316 assert_eq!(
3317 unsafe {
3318 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).splitPoint
3319 as *const _ as usize
3320 },
3321 24usize,
3322 concat!(
3323 "Offset of field: ",
3324 stringify!(ZDICT_fastCover_params_t),
3325 "::",
3326 stringify!(splitPoint)
3327 )
3328 );
3329 assert_eq!(
3330 unsafe {
3331 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).accel
3332 as *const _ as usize
3333 },
3334 32usize,
3335 concat!(
3336 "Offset of field: ",
3337 stringify!(ZDICT_fastCover_params_t),
3338 "::",
3339 stringify!(accel)
3340 )
3341 );
3342 assert_eq!(
3343 unsafe {
3344 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).shrinkDict
3345 as *const _ as usize
3346 },
3347 36usize,
3348 concat!(
3349 "Offset of field: ",
3350 stringify!(ZDICT_fastCover_params_t),
3351 "::",
3352 stringify!(shrinkDict)
3353 )
3354 );
3355 assert_eq!(
3356 unsafe {
3357 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>()))
3358 .shrinkDictMaxRegression as *const _ as usize
3359 },
3360 40usize,
3361 concat!(
3362 "Offset of field: ",
3363 stringify!(ZDICT_fastCover_params_t),
3364 "::",
3365 stringify!(shrinkDictMaxRegression)
3366 )
3367 );
3368 assert_eq!(
3369 unsafe {
3370 &(*(::core::ptr::null::<ZDICT_fastCover_params_t>())).zParams
3371 as *const _ as usize
3372 },
3373 44usize,
3374 concat!(
3375 "Offset of field: ",
3376 stringify!(ZDICT_fastCover_params_t),
3377 "::",
3378 stringify!(zParams)
3379 )
3380 );
3381 }
3382 extern "C" {
3383 #[doc = " ZDICT_trainFromBuffer_cover():"]
3384 #[doc = " Train a dictionary from an array of samples using the COVER algorithm."]
3385 #[doc = " Samples must be stored concatenated in a single flat buffer `samplesBuffer`,"]
3386 #[doc = " supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order."]
3387 #[doc = " The resulting dictionary will be saved into `dictBuffer`."]
3388 #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
3389 #[doc = " or an error code, which can be tested with ZDICT_isError()."]
3390 #[doc = " See ZDICT_trainFromBuffer() for details on failure modes."]
3391 #[doc = " Note: ZDICT_trainFromBuffer_cover() requires about 9 bytes of memory for each input byte."]
3392 #[doc = " Tips: In general, a reasonable dictionary has a size of ~ 100 KB."]
3393 #[doc = " It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`."]
3394 #[doc = " In general, it's recommended to provide a few thousands samples, though this can vary a lot."]
3395 #[doc = " It's recommended that total size of all samples be about ~x100 times the target size of dictionary."]
ZDICT_trainFromBuffer_cover( dictBuffer: *mut ::core::ffi::c_void, dictBufferCapacity: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, parameters: ZDICT_cover_params_t, ) -> usize3396 pub fn ZDICT_trainFromBuffer_cover(
3397 dictBuffer: *mut ::core::ffi::c_void,
3398 dictBufferCapacity: usize,
3399 samplesBuffer: *const ::core::ffi::c_void,
3400 samplesSizes: *const usize,
3401 nbSamples: ::std::os::raw::c_uint,
3402 parameters: ZDICT_cover_params_t,
3403 ) -> usize;
3404 }
3405 extern "C" {
3406 #[doc = " ZDICT_optimizeTrainFromBuffer_cover():"]
3407 #[doc = " The same requirements as above hold for all the parameters except `parameters`."]
3408 #[doc = " This function tries many parameter combinations and picks the best parameters."]
3409 #[doc = " `*parameters` is filled with the best parameters found,"]
3410 #[doc = " dictionary constructed with those parameters is stored in `dictBuffer`."]
3411 #[doc = ""]
3412 #[doc = " All of the parameters d, k, steps are optional."]
3413 #[doc = " If d is non-zero then we don't check multiple values of d, otherwise we check d = {6, 8}."]
3414 #[doc = " if steps is zero it defaults to its default value."]
3415 #[doc = " If k is non-zero then we don't check multiple values of k, otherwise we check steps values in [50, 2000]."]
3416 #[doc = ""]
3417 #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
3418 #[doc = " or an error code, which can be tested with ZDICT_isError()."]
3419 #[doc = " On success `*parameters` contains the parameters selected."]
3420 #[doc = " See ZDICT_trainFromBuffer() for details on failure modes."]
3421 #[doc = " Note: ZDICT_optimizeTrainFromBuffer_cover() requires about 8 bytes of memory for each input byte and additionally another 5 bytes of memory for each byte of memory for each thread."]
ZDICT_optimizeTrainFromBuffer_cover( dictBuffer: *mut ::core::ffi::c_void, dictBufferCapacity: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, parameters: *mut ZDICT_cover_params_t, ) -> usize3422 pub fn ZDICT_optimizeTrainFromBuffer_cover(
3423 dictBuffer: *mut ::core::ffi::c_void,
3424 dictBufferCapacity: usize,
3425 samplesBuffer: *const ::core::ffi::c_void,
3426 samplesSizes: *const usize,
3427 nbSamples: ::std::os::raw::c_uint,
3428 parameters: *mut ZDICT_cover_params_t,
3429 ) -> usize;
3430 }
3431 extern "C" {
3432 #[doc = " ZDICT_trainFromBuffer_fastCover():"]
3433 #[doc = " Train a dictionary from an array of samples using a modified version of COVER algorithm."]
3434 #[doc = " Samples must be stored concatenated in a single flat buffer `samplesBuffer`,"]
3435 #[doc = " supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order."]
3436 #[doc = " d and k are required."]
3437 #[doc = " All other parameters are optional, will use default values if not provided"]
3438 #[doc = " The resulting dictionary will be saved into `dictBuffer`."]
3439 #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
3440 #[doc = " or an error code, which can be tested with ZDICT_isError()."]
3441 #[doc = " See ZDICT_trainFromBuffer() for details on failure modes."]
3442 #[doc = " Note: ZDICT_trainFromBuffer_fastCover() requires 6 * 2^f bytes of memory."]
3443 #[doc = " Tips: In general, a reasonable dictionary has a size of ~ 100 KB."]
3444 #[doc = " It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`."]
3445 #[doc = " In general, it's recommended to provide a few thousands samples, though this can vary a lot."]
3446 #[doc = " It's recommended that total size of all samples be about ~x100 times the target size of dictionary."]
ZDICT_trainFromBuffer_fastCover( dictBuffer: *mut ::core::ffi::c_void, dictBufferCapacity: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, parameters: ZDICT_fastCover_params_t, ) -> usize3447 pub fn ZDICT_trainFromBuffer_fastCover(
3448 dictBuffer: *mut ::core::ffi::c_void,
3449 dictBufferCapacity: usize,
3450 samplesBuffer: *const ::core::ffi::c_void,
3451 samplesSizes: *const usize,
3452 nbSamples: ::std::os::raw::c_uint,
3453 parameters: ZDICT_fastCover_params_t,
3454 ) -> usize;
3455 }
3456 extern "C" {
3457 #[doc = " ZDICT_optimizeTrainFromBuffer_fastCover():"]
3458 #[doc = " The same requirements as above hold for all the parameters except `parameters`."]
3459 #[doc = " This function tries many parameter combinations (specifically, k and d combinations)"]
3460 #[doc = " and picks the best parameters. `*parameters` is filled with the best parameters found,"]
3461 #[doc = " dictionary constructed with those parameters is stored in `dictBuffer`."]
3462 #[doc = " All of the parameters d, k, steps, f, and accel are optional."]
3463 #[doc = " If d is non-zero then we don't check multiple values of d, otherwise we check d = {6, 8}."]
3464 #[doc = " if steps is zero it defaults to its default value."]
3465 #[doc = " If k is non-zero then we don't check multiple values of k, otherwise we check steps values in [50, 2000]."]
3466 #[doc = " If f is zero, default value of 20 is used."]
3467 #[doc = " If accel is zero, default value of 1 is used."]
3468 #[doc = ""]
3469 #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
3470 #[doc = " or an error code, which can be tested with ZDICT_isError()."]
3471 #[doc = " On success `*parameters` contains the parameters selected."]
3472 #[doc = " See ZDICT_trainFromBuffer() for details on failure modes."]
3473 #[doc = " Note: ZDICT_optimizeTrainFromBuffer_fastCover() requires about 6 * 2^f bytes of memory for each thread."]
ZDICT_optimizeTrainFromBuffer_fastCover( dictBuffer: *mut ::core::ffi::c_void, dictBufferCapacity: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, parameters: *mut ZDICT_fastCover_params_t, ) -> usize3474 pub fn ZDICT_optimizeTrainFromBuffer_fastCover(
3475 dictBuffer: *mut ::core::ffi::c_void,
3476 dictBufferCapacity: usize,
3477 samplesBuffer: *const ::core::ffi::c_void,
3478 samplesSizes: *const usize,
3479 nbSamples: ::std::os::raw::c_uint,
3480 parameters: *mut ZDICT_fastCover_params_t,
3481 ) -> usize;
3482 }
3483 #[repr(C)]
3484 #[derive(Debug, Copy, Clone)]
3485 pub struct ZDICT_legacy_params_t {
3486 pub selectivityLevel: ::std::os::raw::c_uint,
3487 pub zParams: ZDICT_params_t,
3488 }
3489 #[test]
bindgen_test_layout_ZDICT_legacy_params_t()3490 fn bindgen_test_layout_ZDICT_legacy_params_t() {
3491 assert_eq!(
3492 ::core::mem::size_of::<ZDICT_legacy_params_t>(),
3493 16usize,
3494 concat!("Size of: ", stringify!(ZDICT_legacy_params_t))
3495 );
3496 assert_eq!(
3497 ::core::mem::align_of::<ZDICT_legacy_params_t>(),
3498 4usize,
3499 concat!("Alignment of ", stringify!(ZDICT_legacy_params_t))
3500 );
3501 assert_eq!(
3502 unsafe {
3503 &(*(::core::ptr::null::<ZDICT_legacy_params_t>())).selectivityLevel
3504 as *const _ as usize
3505 },
3506 0usize,
3507 concat!(
3508 "Offset of field: ",
3509 stringify!(ZDICT_legacy_params_t),
3510 "::",
3511 stringify!(selectivityLevel)
3512 )
3513 );
3514 assert_eq!(
3515 unsafe {
3516 &(*(::core::ptr::null::<ZDICT_legacy_params_t>())).zParams
3517 as *const _ as usize
3518 },
3519 4usize,
3520 concat!(
3521 "Offset of field: ",
3522 stringify!(ZDICT_legacy_params_t),
3523 "::",
3524 stringify!(zParams)
3525 )
3526 );
3527 }
3528 extern "C" {
3529 #[doc = " ZDICT_trainFromBuffer_legacy():"]
3530 #[doc = " Train a dictionary from an array of samples."]
3531 #[doc = " Samples must be stored concatenated in a single flat buffer `samplesBuffer`,"]
3532 #[doc = " supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order."]
3533 #[doc = " The resulting dictionary will be saved into `dictBuffer`."]
3534 #[doc = " `parameters` is optional and can be provided with values set to 0 to mean \"default\"."]
3535 #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
3536 #[doc = " or an error code, which can be tested with ZDICT_isError()."]
3537 #[doc = " See ZDICT_trainFromBuffer() for details on failure modes."]
3538 #[doc = " Tips: In general, a reasonable dictionary has a size of ~ 100 KB."]
3539 #[doc = " It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`."]
3540 #[doc = " In general, it's recommended to provide a few thousands samples, though this can vary a lot."]
3541 #[doc = " It's recommended that total size of all samples be about ~x100 times the target size of dictionary."]
3542 #[doc = " Note: ZDICT_trainFromBuffer_legacy() will send notifications into stderr if instructed to, using notificationLevel>0."]
ZDICT_trainFromBuffer_legacy( dictBuffer: *mut ::core::ffi::c_void, dictBufferCapacity: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, parameters: ZDICT_legacy_params_t, ) -> usize3543 pub fn ZDICT_trainFromBuffer_legacy(
3544 dictBuffer: *mut ::core::ffi::c_void,
3545 dictBufferCapacity: usize,
3546 samplesBuffer: *const ::core::ffi::c_void,
3547 samplesSizes: *const usize,
3548 nbSamples: ::std::os::raw::c_uint,
3549 parameters: ZDICT_legacy_params_t,
3550 ) -> usize;
3551 }
3552 extern "C" {
ZDICT_addEntropyTablesFromBuffer( dictBuffer: *mut ::core::ffi::c_void, dictContentSize: usize, dictBufferCapacity: usize, samplesBuffer: *const ::core::ffi::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, ) -> usize3553 pub fn ZDICT_addEntropyTablesFromBuffer(
3554 dictBuffer: *mut ::core::ffi::c_void,
3555 dictContentSize: usize,
3556 dictBufferCapacity: usize,
3557 samplesBuffer: *const ::core::ffi::c_void,
3558 samplesSizes: *const usize,
3559 nbSamples: ::std::os::raw::c_uint,
3560 ) -> usize;
3561 }
3562 extern "C" {
memcpy( __dest: *mut ::core::ffi::c_void, __src: *const ::core::ffi::c_void, __n: ::std::os::raw::c_ulong, ) -> *mut ::core::ffi::c_void3563 pub fn memcpy(
3564 __dest: *mut ::core::ffi::c_void,
3565 __src: *const ::core::ffi::c_void,
3566 __n: ::std::os::raw::c_ulong,
3567 ) -> *mut ::core::ffi::c_void;
3568 }
3569 extern "C" {
memmove( __dest: *mut ::core::ffi::c_void, __src: *const ::core::ffi::c_void, __n: ::std::os::raw::c_ulong, ) -> *mut ::core::ffi::c_void3570 pub fn memmove(
3571 __dest: *mut ::core::ffi::c_void,
3572 __src: *const ::core::ffi::c_void,
3573 __n: ::std::os::raw::c_ulong,
3574 ) -> *mut ::core::ffi::c_void;
3575 }
3576 extern "C" {
memccpy( __dest: *mut ::core::ffi::c_void, __src: *const ::core::ffi::c_void, __c: ::std::os::raw::c_int, __n: ::std::os::raw::c_ulong, ) -> *mut ::core::ffi::c_void3577 pub fn memccpy(
3578 __dest: *mut ::core::ffi::c_void,
3579 __src: *const ::core::ffi::c_void,
3580 __c: ::std::os::raw::c_int,
3581 __n: ::std::os::raw::c_ulong,
3582 ) -> *mut ::core::ffi::c_void;
3583 }
3584 extern "C" {
memset( __s: *mut ::core::ffi::c_void, __c: ::std::os::raw::c_int, __n: ::std::os::raw::c_ulong, ) -> *mut ::core::ffi::c_void3585 pub fn memset(
3586 __s: *mut ::core::ffi::c_void,
3587 __c: ::std::os::raw::c_int,
3588 __n: ::std::os::raw::c_ulong,
3589 ) -> *mut ::core::ffi::c_void;
3590 }
3591 extern "C" {
memcmp( __s1: *const ::core::ffi::c_void, __s2: *const ::core::ffi::c_void, __n: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int3592 pub fn memcmp(
3593 __s1: *const ::core::ffi::c_void,
3594 __s2: *const ::core::ffi::c_void,
3595 __n: ::std::os::raw::c_ulong,
3596 ) -> ::std::os::raw::c_int;
3597 }
3598 extern "C" {
memchr( __s: *const ::core::ffi::c_void, __c: ::std::os::raw::c_int, __n: ::std::os::raw::c_ulong, ) -> *mut ::core::ffi::c_void3599 pub fn memchr(
3600 __s: *const ::core::ffi::c_void,
3601 __c: ::std::os::raw::c_int,
3602 __n: ::std::os::raw::c_ulong,
3603 ) -> *mut ::core::ffi::c_void;
3604 }
3605 extern "C" {
strcpy( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3606 pub fn strcpy(
3607 __dest: *mut ::std::os::raw::c_char,
3608 __src: *const ::std::os::raw::c_char,
3609 ) -> *mut ::std::os::raw::c_char;
3610 }
3611 extern "C" {
strncpy( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_char3612 pub fn strncpy(
3613 __dest: *mut ::std::os::raw::c_char,
3614 __src: *const ::std::os::raw::c_char,
3615 __n: ::std::os::raw::c_ulong,
3616 ) -> *mut ::std::os::raw::c_char;
3617 }
3618 extern "C" {
strcat( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3619 pub fn strcat(
3620 __dest: *mut ::std::os::raw::c_char,
3621 __src: *const ::std::os::raw::c_char,
3622 ) -> *mut ::std::os::raw::c_char;
3623 }
3624 extern "C" {
strncat( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_char3625 pub fn strncat(
3626 __dest: *mut ::std::os::raw::c_char,
3627 __src: *const ::std::os::raw::c_char,
3628 __n: ::std::os::raw::c_ulong,
3629 ) -> *mut ::std::os::raw::c_char;
3630 }
3631 extern "C" {
strcmp( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int3632 pub fn strcmp(
3633 __s1: *const ::std::os::raw::c_char,
3634 __s2: *const ::std::os::raw::c_char,
3635 ) -> ::std::os::raw::c_int;
3636 }
3637 extern "C" {
strncmp( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int3638 pub fn strncmp(
3639 __s1: *const ::std::os::raw::c_char,
3640 __s2: *const ::std::os::raw::c_char,
3641 __n: ::std::os::raw::c_ulong,
3642 ) -> ::std::os::raw::c_int;
3643 }
3644 extern "C" {
strcoll( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int3645 pub fn strcoll(
3646 __s1: *const ::std::os::raw::c_char,
3647 __s2: *const ::std::os::raw::c_char,
3648 ) -> ::std::os::raw::c_int;
3649 }
3650 extern "C" {
strxfrm( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_ulong3651 pub fn strxfrm(
3652 __dest: *mut ::std::os::raw::c_char,
3653 __src: *const ::std::os::raw::c_char,
3654 __n: ::std::os::raw::c_ulong,
3655 ) -> ::std::os::raw::c_ulong;
3656 }
3657 #[repr(C)]
3658 #[derive(Debug, Copy, Clone)]
3659 pub struct __locale_struct {
3660 pub __locales: [*mut __locale_data; 13usize],
3661 pub __ctype_b: *const ::std::os::raw::c_ushort,
3662 pub __ctype_tolower: *const ::std::os::raw::c_int,
3663 pub __ctype_toupper: *const ::std::os::raw::c_int,
3664 pub __names: [*const ::std::os::raw::c_char; 13usize],
3665 }
3666 #[test]
bindgen_test_layout___locale_struct()3667 fn bindgen_test_layout___locale_struct() {
3668 assert_eq!(
3669 ::core::mem::size_of::<__locale_struct>(),
3670 232usize,
3671 concat!("Size of: ", stringify!(__locale_struct))
3672 );
3673 assert_eq!(
3674 ::core::mem::align_of::<__locale_struct>(),
3675 8usize,
3676 concat!("Alignment of ", stringify!(__locale_struct))
3677 );
3678 assert_eq!(
3679 unsafe {
3680 &(*(::core::ptr::null::<__locale_struct>())).__locales as *const _
3681 as usize
3682 },
3683 0usize,
3684 concat!(
3685 "Offset of field: ",
3686 stringify!(__locale_struct),
3687 "::",
3688 stringify!(__locales)
3689 )
3690 );
3691 assert_eq!(
3692 unsafe {
3693 &(*(::core::ptr::null::<__locale_struct>())).__ctype_b as *const _
3694 as usize
3695 },
3696 104usize,
3697 concat!(
3698 "Offset of field: ",
3699 stringify!(__locale_struct),
3700 "::",
3701 stringify!(__ctype_b)
3702 )
3703 );
3704 assert_eq!(
3705 unsafe {
3706 &(*(::core::ptr::null::<__locale_struct>())).__ctype_tolower
3707 as *const _ as usize
3708 },
3709 112usize,
3710 concat!(
3711 "Offset of field: ",
3712 stringify!(__locale_struct),
3713 "::",
3714 stringify!(__ctype_tolower)
3715 )
3716 );
3717 assert_eq!(
3718 unsafe {
3719 &(*(::core::ptr::null::<__locale_struct>())).__ctype_toupper
3720 as *const _ as usize
3721 },
3722 120usize,
3723 concat!(
3724 "Offset of field: ",
3725 stringify!(__locale_struct),
3726 "::",
3727 stringify!(__ctype_toupper)
3728 )
3729 );
3730 assert_eq!(
3731 unsafe {
3732 &(*(::core::ptr::null::<__locale_struct>())).__names as *const _
3733 as usize
3734 },
3735 128usize,
3736 concat!(
3737 "Offset of field: ",
3738 stringify!(__locale_struct),
3739 "::",
3740 stringify!(__names)
3741 )
3742 );
3743 }
3744 pub type __locale_t = *mut __locale_struct;
3745 pub type locale_t = __locale_t;
3746 extern "C" {
strcoll_l( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, __l: locale_t, ) -> ::std::os::raw::c_int3747 pub fn strcoll_l(
3748 __s1: *const ::std::os::raw::c_char,
3749 __s2: *const ::std::os::raw::c_char,
3750 __l: locale_t,
3751 ) -> ::std::os::raw::c_int;
3752 }
3753 extern "C" {
strxfrm_l( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, __n: usize, __l: locale_t, ) -> usize3754 pub fn strxfrm_l(
3755 __dest: *mut ::std::os::raw::c_char,
3756 __src: *const ::std::os::raw::c_char,
3757 __n: usize,
3758 __l: locale_t,
3759 ) -> usize;
3760 }
3761 extern "C" {
strdup( __s: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3762 pub fn strdup(
3763 __s: *const ::std::os::raw::c_char,
3764 ) -> *mut ::std::os::raw::c_char;
3765 }
3766 extern "C" {
strndup( __string: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_char3767 pub fn strndup(
3768 __string: *const ::std::os::raw::c_char,
3769 __n: ::std::os::raw::c_ulong,
3770 ) -> *mut ::std::os::raw::c_char;
3771 }
3772 extern "C" {
strchr( __s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char3773 pub fn strchr(
3774 __s: *const ::std::os::raw::c_char,
3775 __c: ::std::os::raw::c_int,
3776 ) -> *mut ::std::os::raw::c_char;
3777 }
3778 extern "C" {
strrchr( __s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char3779 pub fn strrchr(
3780 __s: *const ::std::os::raw::c_char,
3781 __c: ::std::os::raw::c_int,
3782 ) -> *mut ::std::os::raw::c_char;
3783 }
3784 extern "C" {
strcspn( __s: *const ::std::os::raw::c_char, __reject: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_ulong3785 pub fn strcspn(
3786 __s: *const ::std::os::raw::c_char,
3787 __reject: *const ::std::os::raw::c_char,
3788 ) -> ::std::os::raw::c_ulong;
3789 }
3790 extern "C" {
strspn( __s: *const ::std::os::raw::c_char, __accept: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_ulong3791 pub fn strspn(
3792 __s: *const ::std::os::raw::c_char,
3793 __accept: *const ::std::os::raw::c_char,
3794 ) -> ::std::os::raw::c_ulong;
3795 }
3796 extern "C" {
strpbrk( __s: *const ::std::os::raw::c_char, __accept: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3797 pub fn strpbrk(
3798 __s: *const ::std::os::raw::c_char,
3799 __accept: *const ::std::os::raw::c_char,
3800 ) -> *mut ::std::os::raw::c_char;
3801 }
3802 extern "C" {
strstr( __haystack: *const ::std::os::raw::c_char, __needle: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3803 pub fn strstr(
3804 __haystack: *const ::std::os::raw::c_char,
3805 __needle: *const ::std::os::raw::c_char,
3806 ) -> *mut ::std::os::raw::c_char;
3807 }
3808 extern "C" {
strtok( __s: *mut ::std::os::raw::c_char, __delim: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3809 pub fn strtok(
3810 __s: *mut ::std::os::raw::c_char,
3811 __delim: *const ::std::os::raw::c_char,
3812 ) -> *mut ::std::os::raw::c_char;
3813 }
3814 extern "C" {
__strtok_r( __s: *mut ::std::os::raw::c_char, __delim: *const ::std::os::raw::c_char, __save_ptr: *mut *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3815 pub fn __strtok_r(
3816 __s: *mut ::std::os::raw::c_char,
3817 __delim: *const ::std::os::raw::c_char,
3818 __save_ptr: *mut *mut ::std::os::raw::c_char,
3819 ) -> *mut ::std::os::raw::c_char;
3820 }
3821 extern "C" {
strtok_r( __s: *mut ::std::os::raw::c_char, __delim: *const ::std::os::raw::c_char, __save_ptr: *mut *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3822 pub fn strtok_r(
3823 __s: *mut ::std::os::raw::c_char,
3824 __delim: *const ::std::os::raw::c_char,
3825 __save_ptr: *mut *mut ::std::os::raw::c_char,
3826 ) -> *mut ::std::os::raw::c_char;
3827 }
3828 extern "C" {
strlen( __s: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_ulong3829 pub fn strlen(
3830 __s: *const ::std::os::raw::c_char,
3831 ) -> ::std::os::raw::c_ulong;
3832 }
3833 extern "C" {
strnlen( __string: *const ::std::os::raw::c_char, __maxlen: usize, ) -> usize3834 pub fn strnlen(
3835 __string: *const ::std::os::raw::c_char,
3836 __maxlen: usize,
3837 ) -> usize;
3838 }
3839 extern "C" {
strerror( __errnum: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char3840 pub fn strerror(
3841 __errnum: ::std::os::raw::c_int,
3842 ) -> *mut ::std::os::raw::c_char;
3843 }
3844 extern "C" {
3845 #[link_name = "\u{1}__xpg_strerror_r"]
strerror_r( __errnum: ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, __buflen: usize, ) -> ::std::os::raw::c_int3846 pub fn strerror_r(
3847 __errnum: ::std::os::raw::c_int,
3848 __buf: *mut ::std::os::raw::c_char,
3849 __buflen: usize,
3850 ) -> ::std::os::raw::c_int;
3851 }
3852 extern "C" {
strerror_l( __errnum: ::std::os::raw::c_int, __l: locale_t, ) -> *mut ::std::os::raw::c_char3853 pub fn strerror_l(
3854 __errnum: ::std::os::raw::c_int,
3855 __l: locale_t,
3856 ) -> *mut ::std::os::raw::c_char;
3857 }
3858 extern "C" {
bcmp( __s1: *const ::core::ffi::c_void, __s2: *const ::core::ffi::c_void, __n: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int3859 pub fn bcmp(
3860 __s1: *const ::core::ffi::c_void,
3861 __s2: *const ::core::ffi::c_void,
3862 __n: ::std::os::raw::c_ulong,
3863 ) -> ::std::os::raw::c_int;
3864 }
3865 extern "C" {
bcopy( __src: *const ::core::ffi::c_void, __dest: *mut ::core::ffi::c_void, __n: usize, )3866 pub fn bcopy(
3867 __src: *const ::core::ffi::c_void,
3868 __dest: *mut ::core::ffi::c_void,
3869 __n: usize,
3870 );
3871 }
3872 extern "C" {
bzero(__s: *mut ::core::ffi::c_void, __n: ::std::os::raw::c_ulong)3873 pub fn bzero(__s: *mut ::core::ffi::c_void, __n: ::std::os::raw::c_ulong);
3874 }
3875 extern "C" {
index( __s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char3876 pub fn index(
3877 __s: *const ::std::os::raw::c_char,
3878 __c: ::std::os::raw::c_int,
3879 ) -> *mut ::std::os::raw::c_char;
3880 }
3881 extern "C" {
rindex( __s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char3882 pub fn rindex(
3883 __s: *const ::std::os::raw::c_char,
3884 __c: ::std::os::raw::c_int,
3885 ) -> *mut ::std::os::raw::c_char;
3886 }
3887 extern "C" {
ffs(__i: ::std::os::raw::c_int) -> ::std::os::raw::c_int3888 pub fn ffs(__i: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
3889 }
3890 extern "C" {
ffsl(__l: ::std::os::raw::c_long) -> ::std::os::raw::c_int3891 pub fn ffsl(__l: ::std::os::raw::c_long) -> ::std::os::raw::c_int;
3892 }
3893 extern "C" {
ffsll(__ll: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int3894 pub fn ffsll(__ll: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int;
3895 }
3896 extern "C" {
strcasecmp( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int3897 pub fn strcasecmp(
3898 __s1: *const ::std::os::raw::c_char,
3899 __s2: *const ::std::os::raw::c_char,
3900 ) -> ::std::os::raw::c_int;
3901 }
3902 extern "C" {
strncasecmp( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int3903 pub fn strncasecmp(
3904 __s1: *const ::std::os::raw::c_char,
3905 __s2: *const ::std::os::raw::c_char,
3906 __n: ::std::os::raw::c_ulong,
3907 ) -> ::std::os::raw::c_int;
3908 }
3909 extern "C" {
strcasecmp_l( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, __loc: locale_t, ) -> ::std::os::raw::c_int3910 pub fn strcasecmp_l(
3911 __s1: *const ::std::os::raw::c_char,
3912 __s2: *const ::std::os::raw::c_char,
3913 __loc: locale_t,
3914 ) -> ::std::os::raw::c_int;
3915 }
3916 extern "C" {
strncasecmp_l( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, __n: usize, __loc: locale_t, ) -> ::std::os::raw::c_int3917 pub fn strncasecmp_l(
3918 __s1: *const ::std::os::raw::c_char,
3919 __s2: *const ::std::os::raw::c_char,
3920 __n: usize,
3921 __loc: locale_t,
3922 ) -> ::std::os::raw::c_int;
3923 }
3924 extern "C" {
explicit_bzero(__s: *mut ::core::ffi::c_void, __n: usize)3925 pub fn explicit_bzero(__s: *mut ::core::ffi::c_void, __n: usize);
3926 }
3927 extern "C" {
strsep( __stringp: *mut *mut ::std::os::raw::c_char, __delim: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3928 pub fn strsep(
3929 __stringp: *mut *mut ::std::os::raw::c_char,
3930 __delim: *const ::std::os::raw::c_char,
3931 ) -> *mut ::std::os::raw::c_char;
3932 }
3933 extern "C" {
strsignal( __sig: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char3934 pub fn strsignal(
3935 __sig: ::std::os::raw::c_int,
3936 ) -> *mut ::std::os::raw::c_char;
3937 }
3938 extern "C" {
__stpcpy( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3939 pub fn __stpcpy(
3940 __dest: *mut ::std::os::raw::c_char,
3941 __src: *const ::std::os::raw::c_char,
3942 ) -> *mut ::std::os::raw::c_char;
3943 }
3944 extern "C" {
stpcpy( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char3945 pub fn stpcpy(
3946 __dest: *mut ::std::os::raw::c_char,
3947 __src: *const ::std::os::raw::c_char,
3948 ) -> *mut ::std::os::raw::c_char;
3949 }
3950 extern "C" {
__stpncpy( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, __n: usize, ) -> *mut ::std::os::raw::c_char3951 pub fn __stpncpy(
3952 __dest: *mut ::std::os::raw::c_char,
3953 __src: *const ::std::os::raw::c_char,
3954 __n: usize,
3955 ) -> *mut ::std::os::raw::c_char;
3956 }
3957 extern "C" {
stpncpy( __dest: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_char3958 pub fn stpncpy(
3959 __dest: *mut ::std::os::raw::c_char,
3960 __src: *const ::std::os::raw::c_char,
3961 __n: ::std::os::raw::c_ulong,
3962 ) -> *mut ::std::os::raw::c_char;
3963 }
3964 #[repr(C)]
3965 #[derive(Debug, Copy, Clone)]
3966 pub struct ZSTDMT_CCtx_s {
3967 _unused: [u8; 0],
3968 }
3969 pub type ZSTDMT_CCtx = ZSTDMT_CCtx_s;
3970 extern "C" {
ZSTDMT_createCCtx_advanced( nbWorkers: ::std::os::raw::c_uint, cMem: ZSTD_customMem, pool: *mut ZSTD_threadPool, ) -> *mut ZSTDMT_CCtx3971 pub fn ZSTDMT_createCCtx_advanced(
3972 nbWorkers: ::std::os::raw::c_uint,
3973 cMem: ZSTD_customMem,
3974 pool: *mut ZSTD_threadPool,
3975 ) -> *mut ZSTDMT_CCtx;
3976 }
3977 extern "C" {
ZSTDMT_freeCCtx(mtctx: *mut ZSTDMT_CCtx) -> usize3978 pub fn ZSTDMT_freeCCtx(mtctx: *mut ZSTDMT_CCtx) -> usize;
3979 }
3980 extern "C" {
ZSTDMT_sizeof_CCtx(mtctx: *mut ZSTDMT_CCtx) -> usize3981 pub fn ZSTDMT_sizeof_CCtx(mtctx: *mut ZSTDMT_CCtx) -> usize;
3982 }
3983 extern "C" {
ZSTDMT_nextInputSizeHint(mtctx: *const ZSTDMT_CCtx) -> usize3984 pub fn ZSTDMT_nextInputSizeHint(mtctx: *const ZSTDMT_CCtx) -> usize;
3985 }
3986 extern "C" {
3987 #[doc = " ZSTDMT_initCStream_internal() :"]
3988 #[doc = " Private use only. Init streaming operation."]
3989 #[doc = " expects params to be valid."]
3990 #[doc = " must receive dict, or cdict, or none, but not both."]
3991 #[doc = " @return : 0, or an error code"]
ZSTDMT_initCStream_internal( zcs: *mut ZSTDMT_CCtx, dict: *const ::core::ffi::c_void, dictSize: usize, dictContentType: ZSTD_dictContentType_e, cdict: *const ZSTD_CDict, params: ZSTD_CCtx_params, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize3992 pub fn ZSTDMT_initCStream_internal(
3993 zcs: *mut ZSTDMT_CCtx,
3994 dict: *const ::core::ffi::c_void,
3995 dictSize: usize,
3996 dictContentType: ZSTD_dictContentType_e,
3997 cdict: *const ZSTD_CDict,
3998 params: ZSTD_CCtx_params,
3999 pledgedSrcSize: ::std::os::raw::c_ulonglong,
4000 ) -> usize;
4001 }
4002 extern "C" {
4003 #[doc = " ZSTDMT_compressStream_generic() :"]
4004 #[doc = " Combines ZSTDMT_compressStream() with optional ZSTDMT_flushStream() or ZSTDMT_endStream()"]
4005 #[doc = " depending on flush directive."]
4006 #[doc = " @return : minimum amount of data still to be flushed"]
4007 #[doc = " 0 if fully flushed"]
4008 #[doc = " or an error code"]
4009 #[doc = " note : needs to be init using any ZSTD_initCStream*() variant"]
ZSTDMT_compressStream_generic( mtctx: *mut ZSTDMT_CCtx, output: *mut ZSTD_outBuffer, input: *mut ZSTD_inBuffer, endOp: ZSTD_EndDirective, ) -> usize4010 pub fn ZSTDMT_compressStream_generic(
4011 mtctx: *mut ZSTDMT_CCtx,
4012 output: *mut ZSTD_outBuffer,
4013 input: *mut ZSTD_inBuffer,
4014 endOp: ZSTD_EndDirective,
4015 ) -> usize;
4016 }
4017 extern "C" {
4018 #[doc = " ZSTDMT_toFlushNow()"]
4019 #[doc = " Tell how many bytes are ready to be flushed immediately."]
4020 #[doc = " Probe the oldest active job (not yet entirely flushed) and check its output buffer."]
4021 #[doc = " If return 0, it means there is no active job,"]
4022 #[doc = " or, it means oldest job is still active, but everything produced has been flushed so far,"]
4023 #[doc = " therefore flushing is limited by speed of oldest job."]
ZSTDMT_toFlushNow(mtctx: *mut ZSTDMT_CCtx) -> usize4024 pub fn ZSTDMT_toFlushNow(mtctx: *mut ZSTDMT_CCtx) -> usize;
4025 }
4026 extern "C" {
4027 #[doc = " ZSTDMT_updateCParams_whileCompressing() :"]
4028 #[doc = " Updates only a selected set of compression parameters, to remain compatible with current frame."]
4029 #[doc = " New parameters will be applied to next compression job."]
ZSTDMT_updateCParams_whileCompressing( mtctx: *mut ZSTDMT_CCtx, cctxParams: *const ZSTD_CCtx_params, )4030 pub fn ZSTDMT_updateCParams_whileCompressing(
4031 mtctx: *mut ZSTDMT_CCtx,
4032 cctxParams: *const ZSTD_CCtx_params,
4033 );
4034 }
4035 extern "C" {
4036 #[doc = " ZSTDMT_getFrameProgression():"]
4037 #[doc = " tells how much data has been consumed (input) and produced (output) for current frame."]
4038 #[doc = " able to count progression inside worker threads."]
ZSTDMT_getFrameProgression( mtctx: *mut ZSTDMT_CCtx, ) -> ZSTD_frameProgression4039 pub fn ZSTDMT_getFrameProgression(
4040 mtctx: *mut ZSTDMT_CCtx,
4041 ) -> ZSTD_frameProgression;
4042 }
4043 #[repr(C)]
4044 #[derive(Debug, Copy, Clone)]
4045 pub struct __locale_data {
4046 pub _address: u8,
4047 }
4048