1 /* automatically generated by rust-bindgen */
2
3 pub const _LIBC_LIMITS_H_: u32 = 1;
4 pub const _FEATURES_H: u32 = 1;
5 pub const _DEFAULT_SOURCE: u32 = 1;
6 pub const __USE_ISOC11: u32 = 1;
7 pub const __USE_ISOC99: u32 = 1;
8 pub const __USE_ISOC95: u32 = 1;
9 pub const __USE_POSIX_IMPLICITLY: u32 = 1;
10 pub const _POSIX_SOURCE: u32 = 1;
11 pub const _POSIX_C_SOURCE: u32 = 200809;
12 pub const __USE_POSIX: u32 = 1;
13 pub const __USE_POSIX2: u32 = 1;
14 pub const __USE_POSIX199309: u32 = 1;
15 pub const __USE_POSIX199506: u32 = 1;
16 pub const __USE_XOPEN2K: u32 = 1;
17 pub const __USE_XOPEN2K8: u32 = 1;
18 pub const _ATFILE_SOURCE: u32 = 1;
19 pub const __USE_MISC: u32 = 1;
20 pub const __USE_ATFILE: u32 = 1;
21 pub const __USE_FORTIFY_LEVEL: u32 = 0;
22 pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
23 pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
24 pub const _STDC_PREDEF_H: u32 = 1;
25 pub const __STDC_IEC_559__: u32 = 1;
26 pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
27 pub const __STDC_ISO_10646__: u32 = 201706;
28 pub const __GNU_LIBRARY__: u32 = 6;
29 pub const __GLIBC__: u32 = 2;
30 pub const __GLIBC_MINOR__: u32 = 30;
31 pub const _SYS_CDEFS_H: u32 = 1;
32 pub const __glibc_c99_flexarr_available: u32 = 1;
33 pub const __WORDSIZE: u32 = 64;
34 pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
35 pub const __SYSCALL_WORDSIZE: u32 = 64;
36 pub const __HAVE_GENERIC_SELECTION: u32 = 1;
37 pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
38 pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
39 pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
40 pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
41 pub const MB_LEN_MAX: u32 = 16;
42 pub const _BITS_POSIX1_LIM_H: u32 = 1;
43 pub const _POSIX_AIO_LISTIO_MAX: u32 = 2;
44 pub const _POSIX_AIO_MAX: u32 = 1;
45 pub const _POSIX_ARG_MAX: u32 = 4096;
46 pub const _POSIX_CHILD_MAX: u32 = 25;
47 pub const _POSIX_DELAYTIMER_MAX: u32 = 32;
48 pub const _POSIX_HOST_NAME_MAX: u32 = 255;
49 pub const _POSIX_LINK_MAX: u32 = 8;
50 pub const _POSIX_LOGIN_NAME_MAX: u32 = 9;
51 pub const _POSIX_MAX_CANON: u32 = 255;
52 pub const _POSIX_MAX_INPUT: u32 = 255;
53 pub const _POSIX_MQ_OPEN_MAX: u32 = 8;
54 pub const _POSIX_MQ_PRIO_MAX: u32 = 32;
55 pub const _POSIX_NAME_MAX: u32 = 14;
56 pub const _POSIX_NGROUPS_MAX: u32 = 8;
57 pub const _POSIX_OPEN_MAX: u32 = 20;
58 pub const _POSIX_PATH_MAX: u32 = 256;
59 pub const _POSIX_PIPE_BUF: u32 = 512;
60 pub const _POSIX_RE_DUP_MAX: u32 = 255;
61 pub const _POSIX_RTSIG_MAX: u32 = 8;
62 pub const _POSIX_SEM_NSEMS_MAX: u32 = 256;
63 pub const _POSIX_SEM_VALUE_MAX: u32 = 32767;
64 pub const _POSIX_SIGQUEUE_MAX: u32 = 32;
65 pub const _POSIX_SSIZE_MAX: u32 = 32767;
66 pub const _POSIX_STREAM_MAX: u32 = 8;
67 pub const _POSIX_SYMLINK_MAX: u32 = 255;
68 pub const _POSIX_SYMLOOP_MAX: u32 = 8;
69 pub const _POSIX_TIMER_MAX: u32 = 32;
70 pub const _POSIX_TTY_NAME_MAX: u32 = 9;
71 pub const _POSIX_TZNAME_MAX: u32 = 6;
72 pub const _POSIX_CLOCKRES_MIN: u32 = 20000000;
73 pub const NR_OPEN: u32 = 1024;
74 pub const NGROUPS_MAX: u32 = 65536;
75 pub const ARG_MAX: u32 = 131072;
76 pub const LINK_MAX: u32 = 127;
77 pub const MAX_CANON: u32 = 255;
78 pub const MAX_INPUT: u32 = 255;
79 pub const NAME_MAX: u32 = 255;
80 pub const PATH_MAX: u32 = 4096;
81 pub const PIPE_BUF: u32 = 4096;
82 pub const XATTR_NAME_MAX: u32 = 255;
83 pub const XATTR_SIZE_MAX: u32 = 65536;
84 pub const XATTR_LIST_MAX: u32 = 65536;
85 pub const RTSIG_MAX: u32 = 32;
86 pub const _POSIX_THREAD_KEYS_MAX: u32 = 128;
87 pub const PTHREAD_KEYS_MAX: u32 = 1024;
88 pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
89 pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
90 pub const _POSIX_THREAD_THREADS_MAX: u32 = 64;
91 pub const AIO_PRIO_DELTA_MAX: u32 = 20;
92 pub const PTHREAD_STACK_MIN: u32 = 16384;
93 pub const DELAYTIMER_MAX: u32 = 2147483647;
94 pub const TTY_NAME_MAX: u32 = 32;
95 pub const LOGIN_NAME_MAX: u32 = 256;
96 pub const HOST_NAME_MAX: u32 = 64;
97 pub const MQ_PRIO_MAX: u32 = 32768;
98 pub const SEM_VALUE_MAX: u32 = 2147483647;
99 pub const _BITS_POSIX2_LIM_H: u32 = 1;
100 pub const _POSIX2_BC_BASE_MAX: u32 = 99;
101 pub const _POSIX2_BC_DIM_MAX: u32 = 2048;
102 pub const _POSIX2_BC_SCALE_MAX: u32 = 99;
103 pub const _POSIX2_BC_STRING_MAX: u32 = 1000;
104 pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2;
105 pub const _POSIX2_EXPR_NEST_MAX: u32 = 32;
106 pub const _POSIX2_LINE_MAX: u32 = 2048;
107 pub const _POSIX2_RE_DUP_MAX: u32 = 255;
108 pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14;
109 pub const BC_BASE_MAX: u32 = 99;
110 pub const BC_DIM_MAX: u32 = 2048;
111 pub const BC_SCALE_MAX: u32 = 99;
112 pub const BC_STRING_MAX: u32 = 1000;
113 pub const COLL_WEIGHTS_MAX: u32 = 255;
114 pub const EXPR_NEST_MAX: u32 = 32;
115 pub const LINE_MAX: u32 = 2048;
116 pub const CHARCLASS_NAME_MAX: u32 = 2048;
117 pub const RE_DUP_MAX: u32 = 32767;
118 pub const ZSTD_VERSION_MAJOR: u32 = 1;
119 pub const ZSTD_VERSION_MINOR: u32 = 4;
120 pub const ZSTD_VERSION_RELEASE: u32 = 4;
121 pub const ZSTD_VERSION_NUMBER: u32 = 10404;
122 pub const ZSTD_CLEVEL_DEFAULT: u32 = 3;
123 pub const ZSTD_MAGICNUMBER: u32 = 4247762216;
124 pub const ZSTD_MAGIC_DICTIONARY: u32 = 3962610743;
125 pub const ZSTD_MAGIC_SKIPPABLE_START: u32 = 407710288;
126 pub const ZSTD_MAGIC_SKIPPABLE_MASK: u32 = 4294967280;
127 pub const ZSTD_BLOCKSIZELOG_MAX: u32 = 17;
128 pub const ZSTD_BLOCKSIZE_MAX: u32 = 131072;
129 pub const ZSTD_CONTENTSIZE_UNKNOWN: i32 = -1;
130 pub const ZSTD_CONTENTSIZE_ERROR: i32 = -2;
131 pub const ZSTD_FRAMEHEADERSIZE_MAX: u32 = 18;
132 pub const ZSTD_SKIPPABLEHEADERSIZE: u32 = 8;
133 pub const ZSTD_WINDOWLOG_MAX_32: u32 = 30;
134 pub const ZSTD_WINDOWLOG_MAX_64: u32 = 31;
135 pub const ZSTD_WINDOWLOG_MIN: u32 = 10;
136 pub const ZSTD_HASHLOG_MIN: u32 = 6;
137 pub const ZSTD_CHAINLOG_MAX_32: u32 = 29;
138 pub const ZSTD_CHAINLOG_MAX_64: u32 = 30;
139 pub const ZSTD_CHAINLOG_MIN: u32 = 6;
140 pub const ZSTD_SEARCHLOG_MIN: u32 = 1;
141 pub const ZSTD_MINMATCH_MAX: u32 = 7;
142 pub const ZSTD_MINMATCH_MIN: u32 = 3;
143 pub const ZSTD_TARGETLENGTH_MAX: u32 = 131072;
144 pub const ZSTD_TARGETLENGTH_MIN: u32 = 0;
145 pub const ZSTD_OVERLAPLOG_MIN: u32 = 0;
146 pub const ZSTD_OVERLAPLOG_MAX: u32 = 9;
147 pub const ZSTD_WINDOWLOG_LIMIT_DEFAULT: u32 = 27;
148 pub const ZSTD_LDM_HASHLOG_MIN: u32 = 6;
149 pub const ZSTD_LDM_MINMATCH_MIN: u32 = 4;
150 pub const ZSTD_LDM_MINMATCH_MAX: u32 = 4096;
151 pub const ZSTD_LDM_BUCKETSIZELOG_MIN: u32 = 1;
152 pub const ZSTD_LDM_BUCKETSIZELOG_MAX: u32 = 8;
153 pub const ZSTD_LDM_HASHRATELOG_MIN: u32 = 0;
154 pub const ZSTD_TARGETCBLOCKSIZE_MIN: u32 = 64;
155 pub const ZSTD_TARGETCBLOCKSIZE_MAX: u32 = 131072;
156 pub const ZSTD_SRCSIZEHINT_MIN: u32 = 0;
157 pub const ZSTD_HASHLOG3_MAX: u32 = 17;
158 pub const ZSTDMT_NBWORKERS_MAX: u32 = 200;
159 pub type wchar_t = ::std::os::raw::c_int;
160 extern "C" {
ZSTD_versionNumber() -> ::std::os::raw::c_uint161 pub fn ZSTD_versionNumber() -> ::std::os::raw::c_uint;
162 }
163 extern "C" {
ZSTD_versionString() -> *const ::std::os::raw::c_char164 pub fn ZSTD_versionString() -> *const ::std::os::raw::c_char;
165 }
166 extern "C" {
167 #[doc = " Simple API"]
168 #[doc = " Compresses `src` content as a single zstd compressed frame into already allocated `dst`."]
169 #[doc = " Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`."]
170 #[doc = " @return : compressed size written into `dst` (<= `dstCapacity),"]
171 #[doc = " or an error code if it fails (which can be tested using ZSTD_isError())."]
ZSTD_compress( dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize172 pub fn ZSTD_compress(
173 dst: *mut ::std::os::raw::c_void,
174 dstCapacity: usize,
175 src: *const ::std::os::raw::c_void,
176 srcSize: usize,
177 compressionLevel: ::std::os::raw::c_int,
178 ) -> usize;
179 }
180 extern "C" {
181 #[doc = " ZSTD_decompress() :"]
182 #[doc = " `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames."]
183 #[doc = " `dstCapacity` is an upper bound of originalSize to regenerate."]
184 #[doc = " If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data."]
185 #[doc = " @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),"]
186 #[doc = " or an errorCode if it fails (which can be tested using ZSTD_isError())."]
ZSTD_decompress( dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, compressedSize: usize, ) -> usize187 pub fn ZSTD_decompress(
188 dst: *mut ::std::os::raw::c_void,
189 dstCapacity: usize,
190 src: *const ::std::os::raw::c_void,
191 compressedSize: usize,
192 ) -> usize;
193 }
194 extern "C" {
ZSTD_getFrameContentSize( src: *const ::std::os::raw::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong195 pub fn ZSTD_getFrameContentSize(
196 src: *const ::std::os::raw::c_void,
197 srcSize: usize,
198 ) -> ::std::os::raw::c_ulonglong;
199 }
200 extern "C" {
201 #[doc = " ZSTD_getDecompressedSize() :"]
202 #[doc = " NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize()."]
203 #[doc = " Both functions work the same way, but ZSTD_getDecompressedSize() blends"]
204 #[doc = " \"empty\", \"unknown\" and \"error\" results to the same return value (0),"]
205 #[doc = " while ZSTD_getFrameContentSize() gives them separate return values."]
206 #[doc = " @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise."]
ZSTD_getDecompressedSize( src: *const ::std::os::raw::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong207 pub fn ZSTD_getDecompressedSize(
208 src: *const ::std::os::raw::c_void,
209 srcSize: usize,
210 ) -> ::std::os::raw::c_ulonglong;
211 }
212 extern "C" {
213 #[doc = " ZSTD_findFrameCompressedSize() :"]
214 #[doc = " `src` should point to the start of a ZSTD frame or skippable frame."]
215 #[doc = " `srcSize` must be >= first frame size"]
216 #[doc = " @return : the compressed size of the first frame starting at `src`,"]
217 #[doc = " suitable to pass as `srcSize` to `ZSTD_decompress` or similar,"]
218 #[doc = " or an error code if input is invalid"]
ZSTD_findFrameCompressedSize( src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize219 pub fn ZSTD_findFrameCompressedSize(
220 src: *const ::std::os::raw::c_void,
221 srcSize: usize,
222 ) -> usize;
223 }
224 extern "C" {
ZSTD_compressBound(srcSize: usize) -> usize225 pub fn ZSTD_compressBound(srcSize: usize) -> usize;
226 }
227 extern "C" {
ZSTD_isError(code: usize) -> ::std::os::raw::c_uint228 pub fn ZSTD_isError(code: usize) -> ::std::os::raw::c_uint;
229 }
230 extern "C" {
ZSTD_getErrorName(code: usize) -> *const ::std::os::raw::c_char231 pub fn ZSTD_getErrorName(code: usize) -> *const ::std::os::raw::c_char;
232 }
233 extern "C" {
ZSTD_minCLevel() -> ::std::os::raw::c_int234 pub fn ZSTD_minCLevel() -> ::std::os::raw::c_int;
235 }
236 extern "C" {
ZSTD_maxCLevel() -> ::std::os::raw::c_int237 pub fn ZSTD_maxCLevel() -> ::std::os::raw::c_int;
238 }
239 #[repr(C)]
240 #[derive(Debug, Copy, Clone)]
241 pub struct ZSTD_CCtx_s {
242 _unused: [u8; 0],
243 }
244 #[doc = " Explicit context"]
245 pub type ZSTD_CCtx = ZSTD_CCtx_s;
246 extern "C" {
ZSTD_createCCtx() -> *mut ZSTD_CCtx247 pub fn ZSTD_createCCtx() -> *mut ZSTD_CCtx;
248 }
249 extern "C" {
ZSTD_freeCCtx(cctx: *mut ZSTD_CCtx) -> usize250 pub fn ZSTD_freeCCtx(cctx: *mut ZSTD_CCtx) -> usize;
251 }
252 extern "C" {
253 #[doc = " ZSTD_compressCCtx() :"]
254 #[doc = " Same as ZSTD_compress(), using an explicit ZSTD_CCtx."]
255 #[doc = " Important : in order to behave similarly to `ZSTD_compress()`,"]
256 #[doc = " this function compresses at requested compression level,"]
257 #[doc = " __ignoring any other parameter__ ."]
258 #[doc = " If any advanced parameter was set using the advanced API,"]
259 #[doc = " they will all be reset. Only `compressionLevel` remains."]
ZSTD_compressCCtx( cctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize260 pub fn ZSTD_compressCCtx(
261 cctx: *mut ZSTD_CCtx,
262 dst: *mut ::std::os::raw::c_void,
263 dstCapacity: usize,
264 src: *const ::std::os::raw::c_void,
265 srcSize: usize,
266 compressionLevel: ::std::os::raw::c_int,
267 ) -> usize;
268 }
269 #[repr(C)]
270 #[derive(Debug, Copy, Clone)]
271 pub struct ZSTD_DCtx_s {
272 _unused: [u8; 0],
273 }
274 pub type ZSTD_DCtx = ZSTD_DCtx_s;
275 extern "C" {
ZSTD_createDCtx() -> *mut ZSTD_DCtx276 pub fn ZSTD_createDCtx() -> *mut ZSTD_DCtx;
277 }
278 extern "C" {
ZSTD_freeDCtx(dctx: *mut ZSTD_DCtx) -> usize279 pub fn ZSTD_freeDCtx(dctx: *mut ZSTD_DCtx) -> usize;
280 }
281 extern "C" {
282 #[doc = " ZSTD_decompressDCtx() :"]
283 #[doc = " Same as ZSTD_decompress(),"]
284 #[doc = " requires an allocated ZSTD_DCtx."]
285 #[doc = " Compatible with sticky parameters."]
ZSTD_decompressDCtx( dctx: *mut ZSTD_DCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize286 pub fn ZSTD_decompressDCtx(
287 dctx: *mut ZSTD_DCtx,
288 dst: *mut ::std::os::raw::c_void,
289 dstCapacity: usize,
290 src: *const ::std::os::raw::c_void,
291 srcSize: usize,
292 ) -> usize;
293 }
294 #[repr(u32)]
295 #[doc = " Advanced compression API"]
296 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
297 pub enum ZSTD_strategy {
298 ZSTD_fast = 1,
299 ZSTD_dfast = 2,
300 ZSTD_greedy = 3,
301 ZSTD_lazy = 4,
302 ZSTD_lazy2 = 5,
303 ZSTD_btlazy2 = 6,
304 ZSTD_btopt = 7,
305 ZSTD_btultra = 8,
306 ZSTD_btultra2 = 9,
307 }
308 #[repr(u32)]
309 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
310 pub enum ZSTD_cParameter {
311 ZSTD_c_compressionLevel = 100,
312 ZSTD_c_windowLog = 101,
313 ZSTD_c_hashLog = 102,
314 ZSTD_c_chainLog = 103,
315 ZSTD_c_searchLog = 104,
316 ZSTD_c_minMatch = 105,
317 ZSTD_c_targetLength = 106,
318 ZSTD_c_strategy = 107,
319 ZSTD_c_enableLongDistanceMatching = 160,
320 ZSTD_c_ldmHashLog = 161,
321 ZSTD_c_ldmMinMatch = 162,
322 ZSTD_c_ldmBucketSizeLog = 163,
323 ZSTD_c_ldmHashRateLog = 164,
324 ZSTD_c_contentSizeFlag = 200,
325 ZSTD_c_checksumFlag = 201,
326 ZSTD_c_dictIDFlag = 202,
327 ZSTD_c_nbWorkers = 400,
328 ZSTD_c_jobSize = 401,
329 ZSTD_c_overlapLog = 402,
330 ZSTD_c_experimentalParam1 = 500,
331 ZSTD_c_experimentalParam2 = 10,
332 ZSTD_c_experimentalParam3 = 1000,
333 ZSTD_c_experimentalParam4 = 1001,
334 ZSTD_c_experimentalParam5 = 1002,
335 ZSTD_c_experimentalParam6 = 1003,
336 ZSTD_c_experimentalParam7 = 1004,
337 }
338 #[repr(C)]
339 #[derive(Debug, Copy, Clone)]
340 pub struct ZSTD_bounds {
341 pub error: usize,
342 pub lowerBound: ::std::os::raw::c_int,
343 pub upperBound: ::std::os::raw::c_int,
344 }
345 #[test]
bindgen_test_layout_ZSTD_bounds()346 fn bindgen_test_layout_ZSTD_bounds() {
347 assert_eq!(
348 ::core::mem::size_of::<ZSTD_bounds>(),
349 16usize,
350 concat!("Size of: ", stringify!(ZSTD_bounds))
351 );
352 assert_eq!(
353 ::core::mem::align_of::<ZSTD_bounds>(),
354 8usize,
355 concat!("Alignment of ", stringify!(ZSTD_bounds))
356 );
357 assert_eq!(
358 unsafe {
359 &(*(::core::ptr::null::<ZSTD_bounds>())).error as *const _ as usize
360 },
361 0usize,
362 concat!(
363 "Offset of field: ",
364 stringify!(ZSTD_bounds),
365 "::",
366 stringify!(error)
367 )
368 );
369 assert_eq!(
370 unsafe {
371 &(*(::core::ptr::null::<ZSTD_bounds>())).lowerBound as *const _
372 as usize
373 },
374 8usize,
375 concat!(
376 "Offset of field: ",
377 stringify!(ZSTD_bounds),
378 "::",
379 stringify!(lowerBound)
380 )
381 );
382 assert_eq!(
383 unsafe {
384 &(*(::core::ptr::null::<ZSTD_bounds>())).upperBound as *const _
385 as usize
386 },
387 12usize,
388 concat!(
389 "Offset of field: ",
390 stringify!(ZSTD_bounds),
391 "::",
392 stringify!(upperBound)
393 )
394 );
395 }
396 extern "C" {
397 #[doc = " ZSTD_cParam_getBounds() :"]
398 #[doc = " All parameters must belong to an interval with lower and upper bounds,"]
399 #[doc = " otherwise they will either trigger an error or be automatically clamped."]
400 #[doc = " @return : a structure, ZSTD_bounds, which contains"]
401 #[doc = " - an error status field, which must be tested using ZSTD_isError()"]
402 #[doc = " - lower and upper bounds, both inclusive"]
ZSTD_cParam_getBounds(cParam: ZSTD_cParameter) -> ZSTD_bounds403 pub fn ZSTD_cParam_getBounds(cParam: ZSTD_cParameter) -> ZSTD_bounds;
404 }
405 extern "C" {
406 #[doc = " ZSTD_CCtx_setParameter() :"]
407 #[doc = " Set one compression parameter, selected by enum ZSTD_cParameter."]
408 #[doc = " All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds()."]
409 #[doc = " Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter)."]
410 #[doc = " Setting a parameter is generally only possible during frame initialization (before starting compression)."]
411 #[doc = " Exception : when using multi-threading mode (nbWorkers >= 1),"]
412 #[doc = " the following parameters can be updated _during_ compression (within same frame):"]
413 #[doc = " => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy."]
414 #[doc = " new parameters will be active for next job only (after a flush())."]
415 #[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, ) -> usize416 pub fn ZSTD_CCtx_setParameter(
417 cctx: *mut ZSTD_CCtx,
418 param: ZSTD_cParameter,
419 value: ::std::os::raw::c_int,
420 ) -> usize;
421 }
422 extern "C" {
423 #[doc = " ZSTD_CCtx_setPledgedSrcSize() :"]
424 #[doc = " Total input data size to be compressed as a single frame."]
425 #[doc = " Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag."]
426 #[doc = " This value will also be controlled at end of frame, and trigger an error if not respected."]
427 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
428 #[doc = " Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame."]
429 #[doc = " In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN."]
430 #[doc = " ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame."]
431 #[doc = " Note 2 : pledgedSrcSize is only valid once, for the next frame."]
432 #[doc = " It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN."]
433 #[doc = " Note 3 : Whenever all input data is provided and consumed in a single round,"]
434 #[doc = " for example with ZSTD_compress2(),"]
435 #[doc = " or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end),"]
436 #[doc = " this value is automatically overridden by srcSize instead."]
ZSTD_CCtx_setPledgedSrcSize( cctx: *mut ZSTD_CCtx, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize437 pub fn ZSTD_CCtx_setPledgedSrcSize(
438 cctx: *mut ZSTD_CCtx,
439 pledgedSrcSize: ::std::os::raw::c_ulonglong,
440 ) -> usize;
441 }
442 #[repr(u32)]
443 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
444 pub enum ZSTD_ResetDirective {
445 ZSTD_reset_session_only = 1,
446 ZSTD_reset_parameters = 2,
447 ZSTD_reset_session_and_parameters = 3,
448 }
449 extern "C" {
450 #[doc = " ZSTD_CCtx_reset() :"]
451 #[doc = " There are 2 different things that can be reset, independently or jointly :"]
452 #[doc = " - The session : will stop compressing current frame, and make CCtx ready to start a new one."]
453 #[doc = " Useful after an error, or to interrupt any ongoing compression."]
454 #[doc = " Any internal data not yet flushed is cancelled."]
455 #[doc = " Compression parameters and dictionary remain unchanged."]
456 #[doc = " They will be used to compress next frame."]
457 #[doc = " Resetting session never fails."]
458 #[doc = " - The parameters : changes all parameters back to \"default\"."]
459 #[doc = " This removes any reference to any dictionary too."]
460 #[doc = " Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing)"]
461 #[doc = " otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError())"]
462 #[doc = " - Both : similar to resetting the session, followed by resetting parameters."]
ZSTD_CCtx_reset( cctx: *mut ZSTD_CCtx, reset: ZSTD_ResetDirective, ) -> usize463 pub fn ZSTD_CCtx_reset(
464 cctx: *mut ZSTD_CCtx,
465 reset: ZSTD_ResetDirective,
466 ) -> usize;
467 }
468 extern "C" {
469 #[doc = " ZSTD_compress2() :"]
470 #[doc = " Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API."]
471 #[doc = " ZSTD_compress2() always starts a new frame."]
472 #[doc = " Should cctx hold data from a previously unfinished frame, everything about it is forgotten."]
473 #[doc = " - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()"]
474 #[doc = " - The function is always blocking, returns when compression is completed."]
475 #[doc = " Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`."]
476 #[doc = " @return : compressed size written into `dst` (<= `dstCapacity),"]
477 #[doc = " or an error code if it fails (which can be tested using ZSTD_isError())."]
ZSTD_compress2( cctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize478 pub fn ZSTD_compress2(
479 cctx: *mut ZSTD_CCtx,
480 dst: *mut ::std::os::raw::c_void,
481 dstCapacity: usize,
482 src: *const ::std::os::raw::c_void,
483 srcSize: usize,
484 ) -> usize;
485 }
486 #[repr(u32)]
487 #[doc = " Advanced decompression API"]
488 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
489 pub enum ZSTD_dParameter {
490 ZSTD_d_windowLogMax = 100,
491 ZSTD_d_experimentalParam1 = 1000,
492 }
493 extern "C" {
494 #[doc = " ZSTD_dParam_getBounds() :"]
495 #[doc = " All parameters must belong to an interval with lower and upper bounds,"]
496 #[doc = " otherwise they will either trigger an error or be automatically clamped."]
497 #[doc = " @return : a structure, ZSTD_bounds, which contains"]
498 #[doc = " - an error status field, which must be tested using ZSTD_isError()"]
499 #[doc = " - both lower and upper bounds, inclusive"]
ZSTD_dParam_getBounds(dParam: ZSTD_dParameter) -> ZSTD_bounds500 pub fn ZSTD_dParam_getBounds(dParam: ZSTD_dParameter) -> ZSTD_bounds;
501 }
502 extern "C" {
503 #[doc = " ZSTD_DCtx_setParameter() :"]
504 #[doc = " Set one compression parameter, selected by enum ZSTD_dParameter."]
505 #[doc = " All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds()."]
506 #[doc = " Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter)."]
507 #[doc = " Setting a parameter is only possible during frame initialization (before starting decompression)."]
508 #[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, ) -> usize509 pub fn ZSTD_DCtx_setParameter(
510 dctx: *mut ZSTD_DCtx,
511 param: ZSTD_dParameter,
512 value: ::std::os::raw::c_int,
513 ) -> usize;
514 }
515 extern "C" {
516 #[doc = " ZSTD_DCtx_reset() :"]
517 #[doc = " Return a DCtx to clean state."]
518 #[doc = " Session and parameters can be reset jointly or separately."]
519 #[doc = " Parameters can only be reset when no active frame is being decompressed."]
520 #[doc = " @return : 0, or an error code, which can be tested with ZSTD_isError()"]
ZSTD_DCtx_reset( dctx: *mut ZSTD_DCtx, reset: ZSTD_ResetDirective, ) -> usize521 pub fn ZSTD_DCtx_reset(
522 dctx: *mut ZSTD_DCtx,
523 reset: ZSTD_ResetDirective,
524 ) -> usize;
525 }
526 #[doc = " Streaming"]
527 #[repr(C)]
528 #[derive(Debug, Copy, Clone)]
529 pub struct ZSTD_inBuffer_s {
530 #[doc = "< start of input buffer"]
531 pub src: *const ::std::os::raw::c_void,
532 #[doc = "< size of input buffer"]
533 pub size: usize,
534 #[doc = "< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size"]
535 pub pos: usize,
536 }
537 #[test]
bindgen_test_layout_ZSTD_inBuffer_s()538 fn bindgen_test_layout_ZSTD_inBuffer_s() {
539 assert_eq!(
540 ::core::mem::size_of::<ZSTD_inBuffer_s>(),
541 24usize,
542 concat!("Size of: ", stringify!(ZSTD_inBuffer_s))
543 );
544 assert_eq!(
545 ::core::mem::align_of::<ZSTD_inBuffer_s>(),
546 8usize,
547 concat!("Alignment of ", stringify!(ZSTD_inBuffer_s))
548 );
549 assert_eq!(
550 unsafe {
551 &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).src as *const _
552 as usize
553 },
554 0usize,
555 concat!(
556 "Offset of field: ",
557 stringify!(ZSTD_inBuffer_s),
558 "::",
559 stringify!(src)
560 )
561 );
562 assert_eq!(
563 unsafe {
564 &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).size as *const _
565 as usize
566 },
567 8usize,
568 concat!(
569 "Offset of field: ",
570 stringify!(ZSTD_inBuffer_s),
571 "::",
572 stringify!(size)
573 )
574 );
575 assert_eq!(
576 unsafe {
577 &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).pos as *const _
578 as usize
579 },
580 16usize,
581 concat!(
582 "Offset of field: ",
583 stringify!(ZSTD_inBuffer_s),
584 "::",
585 stringify!(pos)
586 )
587 );
588 }
589 pub type ZSTD_inBuffer = ZSTD_inBuffer_s;
590 #[repr(C)]
591 #[derive(Debug, Copy, Clone)]
592 pub struct ZSTD_outBuffer_s {
593 #[doc = "< start of output buffer"]
594 pub dst: *mut ::std::os::raw::c_void,
595 #[doc = "< size of output buffer"]
596 pub size: usize,
597 #[doc = "< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size"]
598 pub pos: usize,
599 }
600 #[test]
bindgen_test_layout_ZSTD_outBuffer_s()601 fn bindgen_test_layout_ZSTD_outBuffer_s() {
602 assert_eq!(
603 ::core::mem::size_of::<ZSTD_outBuffer_s>(),
604 24usize,
605 concat!("Size of: ", stringify!(ZSTD_outBuffer_s))
606 );
607 assert_eq!(
608 ::core::mem::align_of::<ZSTD_outBuffer_s>(),
609 8usize,
610 concat!("Alignment of ", stringify!(ZSTD_outBuffer_s))
611 );
612 assert_eq!(
613 unsafe {
614 &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).dst as *const _
615 as usize
616 },
617 0usize,
618 concat!(
619 "Offset of field: ",
620 stringify!(ZSTD_outBuffer_s),
621 "::",
622 stringify!(dst)
623 )
624 );
625 assert_eq!(
626 unsafe {
627 &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).size as *const _
628 as usize
629 },
630 8usize,
631 concat!(
632 "Offset of field: ",
633 stringify!(ZSTD_outBuffer_s),
634 "::",
635 stringify!(size)
636 )
637 );
638 assert_eq!(
639 unsafe {
640 &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).pos as *const _
641 as usize
642 },
643 16usize,
644 concat!(
645 "Offset of field: ",
646 stringify!(ZSTD_outBuffer_s),
647 "::",
648 stringify!(pos)
649 )
650 );
651 }
652 pub type ZSTD_outBuffer = ZSTD_outBuffer_s;
653 pub type ZSTD_CStream = ZSTD_CCtx;
654 extern "C" {
ZSTD_createCStream() -> *mut ZSTD_CStream655 pub fn ZSTD_createCStream() -> *mut ZSTD_CStream;
656 }
657 extern "C" {
ZSTD_freeCStream(zcs: *mut ZSTD_CStream) -> usize658 pub fn ZSTD_freeCStream(zcs: *mut ZSTD_CStream) -> usize;
659 }
660 #[repr(u32)]
661 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
662 pub enum ZSTD_EndDirective {
663 ZSTD_e_continue = 0,
664 ZSTD_e_flush = 1,
665 ZSTD_e_end = 2,
666 }
667 extern "C" {
668 #[doc = " ZSTD_compressStream2() :"]
669 #[doc = " Behaves about the same as ZSTD_compressStream, with additional control on end directive."]
670 #[doc = " - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()"]
671 #[doc = " - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)"]
672 #[doc = " - output->pos must be <= dstCapacity, input->pos must be <= srcSize"]
673 #[doc = " - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit."]
674 #[doc = " - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller."]
675 #[doc = " - When nbWorkers>=1, function is non-blocking : it just acquires a copy of input, and distributes jobs to internal worker threads, flush whatever is available,"]
676 #[doc = " and then immediately returns, just indicating that there is some data remaining to be flushed."]
677 #[doc = " The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte."]
678 #[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."]
679 #[doc = " - @return provides a minimum amount of data remaining to be flushed from internal buffers"]
680 #[doc = " or an error code, which can be tested using ZSTD_isError()."]
681 #[doc = " if @return != 0, flush is not fully completed, there is still some data left within internal buffers."]
682 #[doc = " This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers."]
683 #[doc = " For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed."]
684 #[doc = " - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),"]
685 #[doc = " only ZSTD_e_end or ZSTD_e_flush operations are allowed."]
686 #[doc = " Before starting a new compression job, or changing compression parameters,"]
687 #[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, ) -> usize688 pub fn ZSTD_compressStream2(
689 cctx: *mut ZSTD_CCtx,
690 output: *mut ZSTD_outBuffer,
691 input: *mut ZSTD_inBuffer,
692 endOp: ZSTD_EndDirective,
693 ) -> usize;
694 }
695 extern "C" {
ZSTD_CStreamInSize() -> usize696 pub fn ZSTD_CStreamInSize() -> usize;
697 }
698 extern "C" {
ZSTD_CStreamOutSize() -> usize699 pub fn ZSTD_CStreamOutSize() -> usize;
700 }
701 extern "C" {
702 #[doc = " Equivalent to:"]
703 #[doc = ""]
704 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
705 #[doc = " ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)"]
706 #[doc = " ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
ZSTD_initCStream( zcs: *mut ZSTD_CStream, compressionLevel: ::std::os::raw::c_int, ) -> usize707 pub fn ZSTD_initCStream(
708 zcs: *mut ZSTD_CStream,
709 compressionLevel: ::std::os::raw::c_int,
710 ) -> usize;
711 }
712 extern "C" {
713 #[doc = " Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue)."]
714 #[doc = " NOTE: The return value is different. ZSTD_compressStream() returns a hint for"]
715 #[doc = " the next read size (if non-zero and not an error). ZSTD_compressStream2()"]
716 #[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, ) -> usize717 pub fn ZSTD_compressStream(
718 zcs: *mut ZSTD_CStream,
719 output: *mut ZSTD_outBuffer,
720 input: *mut ZSTD_inBuffer,
721 ) -> usize;
722 }
723 extern "C" {
724 #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush)."]
ZSTD_flushStream( zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer, ) -> usize725 pub fn ZSTD_flushStream(
726 zcs: *mut ZSTD_CStream,
727 output: *mut ZSTD_outBuffer,
728 ) -> usize;
729 }
730 extern "C" {
731 #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end)."]
ZSTD_endStream( zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer, ) -> usize732 pub fn ZSTD_endStream(
733 zcs: *mut ZSTD_CStream,
734 output: *mut ZSTD_outBuffer,
735 ) -> usize;
736 }
737 pub type ZSTD_DStream = ZSTD_DCtx;
738 extern "C" {
ZSTD_createDStream() -> *mut ZSTD_DStream739 pub fn ZSTD_createDStream() -> *mut ZSTD_DStream;
740 }
741 extern "C" {
ZSTD_freeDStream(zds: *mut ZSTD_DStream) -> usize742 pub fn ZSTD_freeDStream(zds: *mut ZSTD_DStream) -> usize;
743 }
744 extern "C" {
ZSTD_initDStream(zds: *mut ZSTD_DStream) -> usize745 pub fn ZSTD_initDStream(zds: *mut ZSTD_DStream) -> usize;
746 }
747 extern "C" {
ZSTD_decompressStream( zds: *mut ZSTD_DStream, output: *mut ZSTD_outBuffer, input: *mut ZSTD_inBuffer, ) -> usize748 pub fn ZSTD_decompressStream(
749 zds: *mut ZSTD_DStream,
750 output: *mut ZSTD_outBuffer,
751 input: *mut ZSTD_inBuffer,
752 ) -> usize;
753 }
754 extern "C" {
ZSTD_DStreamInSize() -> usize755 pub fn ZSTD_DStreamInSize() -> usize;
756 }
757 extern "C" {
ZSTD_DStreamOutSize() -> usize758 pub fn ZSTD_DStreamOutSize() -> usize;
759 }
760 extern "C" {
761 #[doc = " Simple dictionary API"]
762 #[doc = " Compression at an explicit compression level using a Dictionary."]
763 #[doc = " A dictionary can be any arbitrary data segment (also called a prefix),"]
764 #[doc = " or a buffer with specified information (see dictBuilder/zdict.h)."]
765 #[doc = " Note : This function loads the dictionary, resulting in significant startup delay."]
766 #[doc = " It's intended for a dictionary used only once."]
767 #[doc = " Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used."]
ZSTD_compress_usingDict( ctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, dict: *const ::std::os::raw::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize768 pub fn ZSTD_compress_usingDict(
769 ctx: *mut ZSTD_CCtx,
770 dst: *mut ::std::os::raw::c_void,
771 dstCapacity: usize,
772 src: *const ::std::os::raw::c_void,
773 srcSize: usize,
774 dict: *const ::std::os::raw::c_void,
775 dictSize: usize,
776 compressionLevel: ::std::os::raw::c_int,
777 ) -> usize;
778 }
779 extern "C" {
780 #[doc = " ZSTD_decompress_usingDict() :"]
781 #[doc = " Decompression using a known Dictionary."]
782 #[doc = " Dictionary must be identical to the one used during compression."]
783 #[doc = " Note : This function loads the dictionary, resulting in significant startup delay."]
784 #[doc = " It's intended for a dictionary used only once."]
785 #[doc = " Note : When `dict == NULL || dictSize < 8` no dictionary is used."]
ZSTD_decompress_usingDict( dctx: *mut ZSTD_DCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, dict: *const ::std::os::raw::c_void, dictSize: usize, ) -> usize786 pub fn ZSTD_decompress_usingDict(
787 dctx: *mut ZSTD_DCtx,
788 dst: *mut ::std::os::raw::c_void,
789 dstCapacity: usize,
790 src: *const ::std::os::raw::c_void,
791 srcSize: usize,
792 dict: *const ::std::os::raw::c_void,
793 dictSize: usize,
794 ) -> usize;
795 }
796 #[repr(C)]
797 #[derive(Debug, Copy, Clone)]
798 pub struct ZSTD_CDict_s {
799 _unused: [u8; 0],
800 }
801 #[doc = " Bulk processing dictionary API"]
802 pub type ZSTD_CDict = ZSTD_CDict_s;
803 extern "C" {
804 #[doc = " ZSTD_createCDict() :"]
805 #[doc = " When compressing multiple messages or blocks using the same dictionary,"]
806 #[doc = " it's recommended to digest the dictionary only once, since it's a costly operation."]
807 #[doc = " ZSTD_createCDict() will create a state from digesting a dictionary."]
808 #[doc = " The resulting state can be used for future compression operations with very limited startup cost."]
809 #[doc = " ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only."]
810 #[doc = " @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict."]
811 #[doc = " Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content."]
812 #[doc = " Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer,"]
813 #[doc = " in which case the only thing that it transports is the @compressionLevel."]
814 #[doc = " This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively,"]
815 #[doc = " expecting a ZSTD_CDict parameter with any data, including those without a known dictionary."]
ZSTD_createCDict( dictBuffer: *const ::std::os::raw::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> *mut ZSTD_CDict816 pub fn ZSTD_createCDict(
817 dictBuffer: *const ::std::os::raw::c_void,
818 dictSize: usize,
819 compressionLevel: ::std::os::raw::c_int,
820 ) -> *mut ZSTD_CDict;
821 }
822 extern "C" {
823 #[doc = " ZSTD_freeCDict() :"]
824 #[doc = " Function frees memory allocated by ZSTD_createCDict()."]
ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize825 pub fn ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize;
826 }
827 extern "C" {
828 #[doc = " ZSTD_compress_usingCDict() :"]
829 #[doc = " Compression using a digested Dictionary."]
830 #[doc = " Recommended when same dictionary is used multiple times."]
831 #[doc = " Note : compression level is _decided at dictionary creation time_,"]
832 #[doc = " and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)"]
ZSTD_compress_usingCDict( cctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, cdict: *const ZSTD_CDict, ) -> usize833 pub fn ZSTD_compress_usingCDict(
834 cctx: *mut ZSTD_CCtx,
835 dst: *mut ::std::os::raw::c_void,
836 dstCapacity: usize,
837 src: *const ::std::os::raw::c_void,
838 srcSize: usize,
839 cdict: *const ZSTD_CDict,
840 ) -> usize;
841 }
842 #[repr(C)]
843 #[derive(Debug, Copy, Clone)]
844 pub struct ZSTD_DDict_s {
845 _unused: [u8; 0],
846 }
847 pub type ZSTD_DDict = ZSTD_DDict_s;
848 extern "C" {
849 #[doc = " ZSTD_createDDict() :"]
850 #[doc = " Create a digested dictionary, ready to start decompression operation without startup delay."]
851 #[doc = " dictBuffer can be released after DDict creation, as its content is copied inside DDict."]
ZSTD_createDDict( dictBuffer: *const ::std::os::raw::c_void, dictSize: usize, ) -> *mut ZSTD_DDict852 pub fn ZSTD_createDDict(
853 dictBuffer: *const ::std::os::raw::c_void,
854 dictSize: usize,
855 ) -> *mut ZSTD_DDict;
856 }
857 extern "C" {
858 #[doc = " ZSTD_freeDDict() :"]
859 #[doc = " Function frees memory allocated with ZSTD_createDDict()"]
ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize860 pub fn ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize;
861 }
862 extern "C" {
863 #[doc = " ZSTD_decompress_usingDDict() :"]
864 #[doc = " Decompression using a digested Dictionary."]
865 #[doc = " Recommended when same dictionary is used multiple times."]
ZSTD_decompress_usingDDict( dctx: *mut ZSTD_DCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ddict: *const ZSTD_DDict, ) -> usize866 pub fn ZSTD_decompress_usingDDict(
867 dctx: *mut ZSTD_DCtx,
868 dst: *mut ::std::os::raw::c_void,
869 dstCapacity: usize,
870 src: *const ::std::os::raw::c_void,
871 srcSize: usize,
872 ddict: *const ZSTD_DDict,
873 ) -> usize;
874 }
875 extern "C" {
876 #[doc = " ZSTD_getDictID_fromDict() :"]
877 #[doc = " Provides the dictID stored within dictionary."]
878 #[doc = " if @return == 0, the dictionary is not conformant with Zstandard specification."]
879 #[doc = " It can still be loaded, but as a content-only dictionary."]
ZSTD_getDictID_fromDict( dict: *const ::std::os::raw::c_void, dictSize: usize, ) -> ::std::os::raw::c_uint880 pub fn ZSTD_getDictID_fromDict(
881 dict: *const ::std::os::raw::c_void,
882 dictSize: usize,
883 ) -> ::std::os::raw::c_uint;
884 }
885 extern "C" {
886 #[doc = " ZSTD_getDictID_fromDDict() :"]
887 #[doc = " Provides the dictID of the dictionary loaded into `ddict`."]
888 #[doc = " If @return == 0, the dictionary is not conformant to Zstandard specification, or empty."]
889 #[doc = " Non-conformant dictionaries can still be loaded, but as content-only dictionaries."]
ZSTD_getDictID_fromDDict( ddict: *const ZSTD_DDict, ) -> ::std::os::raw::c_uint890 pub fn ZSTD_getDictID_fromDDict(
891 ddict: *const ZSTD_DDict,
892 ) -> ::std::os::raw::c_uint;
893 }
894 extern "C" {
895 #[doc = " ZSTD_getDictID_fromFrame() :"]
896 #[doc = " Provides the dictID required to decompressed the frame stored within `src`."]
897 #[doc = " If @return == 0, the dictID could not be decoded."]
898 #[doc = " This could for one of the following reasons :"]
899 #[doc = " - The frame does not require a dictionary to be decoded (most common case)."]
900 #[doc = " - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden information."]
901 #[doc = " Note : this use case also happens when using a non-conformant dictionary."]
902 #[doc = " - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`)."]
903 #[doc = " - This is not a Zstandard frame."]
904 #[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 ::std::os::raw::c_void, srcSize: usize, ) -> ::std::os::raw::c_uint905 pub fn ZSTD_getDictID_fromFrame(
906 src: *const ::std::os::raw::c_void,
907 srcSize: usize,
908 ) -> ::std::os::raw::c_uint;
909 }
910 extern "C" {
911 #[doc = " ZSTD_CCtx_loadDictionary() :"]
912 #[doc = " Create an internal CDict from `dict` buffer."]
913 #[doc = " Decompression will have to use same dictionary."]
914 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
915 #[doc = " Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,"]
916 #[doc = " meaning \"return to no-dictionary mode\"."]
917 #[doc = " Note 1 : Dictionary is sticky, it will be used for all future compressed frames."]
918 #[doc = " To return to \"no-dictionary\" situation, load a NULL dictionary (or reset parameters)."]
919 #[doc = " Note 2 : Loading a dictionary involves building tables."]
920 #[doc = " It's also a CPU consuming operation, with non-negligible impact on latency."]
921 #[doc = " Tables are dependent on compression parameters, and for this reason,"]
922 #[doc = " compression parameters can no longer be changed after loading a dictionary."]
923 #[doc = " Note 3 :`dict` content will be copied internally."]
924 #[doc = " Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead."]
925 #[doc = " In such a case, dictionary buffer must outlive its users."]
926 #[doc = " Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()"]
927 #[doc = " to precisely select how dictionary content must be interpreted."]
ZSTD_CCtx_loadDictionary( cctx: *mut ZSTD_CCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, ) -> usize928 pub fn ZSTD_CCtx_loadDictionary(
929 cctx: *mut ZSTD_CCtx,
930 dict: *const ::std::os::raw::c_void,
931 dictSize: usize,
932 ) -> usize;
933 }
934 extern "C" {
935 #[doc = " ZSTD_CCtx_refCDict() :"]
936 #[doc = " Reference a prepared dictionary, to be used for all next compressed frames."]
937 #[doc = " Note that compression parameters are enforced from within CDict,"]
938 #[doc = " and supersede any compression parameter previously set within CCtx."]
939 #[doc = " The parameters ignored are labled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs."]
940 #[doc = " The ignored parameters will be used again if the CCtx is returned to no-dictionary mode."]
941 #[doc = " The dictionary will remain valid for future compressed frames using same CCtx."]
942 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
943 #[doc = " Special : Referencing a NULL CDict means \"return to no-dictionary mode\"."]
944 #[doc = " Note 1 : Currently, only one dictionary can be managed."]
945 #[doc = " Referencing a new dictionary effectively \"discards\" any previous one."]
946 #[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, ) -> usize947 pub fn ZSTD_CCtx_refCDict(
948 cctx: *mut ZSTD_CCtx,
949 cdict: *const ZSTD_CDict,
950 ) -> usize;
951 }
952 extern "C" {
953 #[doc = " ZSTD_CCtx_refPrefix() :"]
954 #[doc = " Reference a prefix (single-usage dictionary) for next compressed frame."]
955 #[doc = " A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end)."]
956 #[doc = " Decompression will need same prefix to properly regenerate data."]
957 #[doc = " Compressing with a prefix is similar in outcome as performing a diff and compressing it,"]
958 #[doc = " but performs much faster, especially during decompression (compression speed is tunable with compression level)."]
959 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
960 #[doc = " Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary"]
961 #[doc = " Note 1 : Prefix buffer is referenced. It **must** outlive compression."]
962 #[doc = " Its content must remain unmodified during compression."]
963 #[doc = " Note 2 : If the intention is to diff some large src data blob with some prior version of itself,"]
964 #[doc = " ensure that the window size is large enough to contain the entire source."]
965 #[doc = " See ZSTD_c_windowLog."]
966 #[doc = " Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters."]
967 #[doc = " It's a CPU consuming operation, with non-negligible impact on latency."]
968 #[doc = " If there is a need to use the same prefix multiple times, consider loadDictionary instead."]
969 #[doc = " Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent)."]
970 #[doc = " Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation."]
ZSTD_CCtx_refPrefix( cctx: *mut ZSTD_CCtx, prefix: *const ::std::os::raw::c_void, prefixSize: usize, ) -> usize971 pub fn ZSTD_CCtx_refPrefix(
972 cctx: *mut ZSTD_CCtx,
973 prefix: *const ::std::os::raw::c_void,
974 prefixSize: usize,
975 ) -> usize;
976 }
977 extern "C" {
978 #[doc = " ZSTD_DCtx_loadDictionary() :"]
979 #[doc = " Create an internal DDict from dict buffer,"]
980 #[doc = " to be used to decompress next frames."]
981 #[doc = " The dictionary remains valid for all future frames, until explicitly invalidated."]
982 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
983 #[doc = " Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,"]
984 #[doc = " meaning \"return to no-dictionary mode\"."]
985 #[doc = " Note 1 : Loading a dictionary involves building tables,"]
986 #[doc = " which has a non-negligible impact on CPU usage and latency."]
987 #[doc = " It's recommended to \"load once, use many times\", to amortize the cost"]
988 #[doc = " Note 2 :`dict` content will be copied internally, so `dict` can be released after loading."]
989 #[doc = " Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead."]
990 #[doc = " Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of"]
991 #[doc = " how dictionary content is loaded and interpreted."]
ZSTD_DCtx_loadDictionary( dctx: *mut ZSTD_DCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, ) -> usize992 pub fn ZSTD_DCtx_loadDictionary(
993 dctx: *mut ZSTD_DCtx,
994 dict: *const ::std::os::raw::c_void,
995 dictSize: usize,
996 ) -> usize;
997 }
998 extern "C" {
999 #[doc = " ZSTD_DCtx_refDDict() :"]
1000 #[doc = " Reference a prepared dictionary, to be used to decompress next frames."]
1001 #[doc = " The dictionary remains active for decompression of future frames using same DCtx."]
1002 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
1003 #[doc = " Note 1 : Currently, only one dictionary can be managed."]
1004 #[doc = " Referencing a new dictionary effectively \"discards\" any previous one."]
1005 #[doc = " Special: referencing a NULL DDict means \"return to no-dictionary mode\"."]
1006 #[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, ) -> usize1007 pub fn ZSTD_DCtx_refDDict(
1008 dctx: *mut ZSTD_DCtx,
1009 ddict: *const ZSTD_DDict,
1010 ) -> usize;
1011 }
1012 extern "C" {
1013 #[doc = " ZSTD_DCtx_refPrefix() :"]
1014 #[doc = " Reference a prefix (single-usage dictionary) to decompress next frame."]
1015 #[doc = " This is the reverse operation of ZSTD_CCtx_refPrefix(),"]
1016 #[doc = " and must use the same prefix as the one used during compression."]
1017 #[doc = " Prefix is **only used once**. Reference is discarded at end of frame."]
1018 #[doc = " End of frame is reached when ZSTD_decompressStream() returns 0."]
1019 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
1020 #[doc = " Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary"]
1021 #[doc = " Note 2 : Prefix buffer is referenced. It **must** outlive decompression."]
1022 #[doc = " Prefix buffer must remain unmodified up to the end of frame,"]
1023 #[doc = " reached when ZSTD_decompressStream() returns 0."]
1024 #[doc = " Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent)."]
1025 #[doc = " Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section)"]
1026 #[doc = " Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost."]
1027 #[doc = " A full dictionary is more costly, as it requires building tables."]
ZSTD_DCtx_refPrefix( dctx: *mut ZSTD_DCtx, prefix: *const ::std::os::raw::c_void, prefixSize: usize, ) -> usize1028 pub fn ZSTD_DCtx_refPrefix(
1029 dctx: *mut ZSTD_DCtx,
1030 prefix: *const ::std::os::raw::c_void,
1031 prefixSize: usize,
1032 ) -> usize;
1033 }
1034 extern "C" {
1035 #[doc = " ZSTD_sizeof_*() :"]
1036 #[doc = " These functions give the _current_ memory usage of selected object."]
1037 #[doc = " Note that object memory usage can evolve (increase or decrease) over time."]
ZSTD_sizeof_CCtx(cctx: *const ZSTD_CCtx) -> usize1038 pub fn ZSTD_sizeof_CCtx(cctx: *const ZSTD_CCtx) -> usize;
1039 }
1040 extern "C" {
ZSTD_sizeof_DCtx(dctx: *const ZSTD_DCtx) -> usize1041 pub fn ZSTD_sizeof_DCtx(dctx: *const ZSTD_DCtx) -> usize;
1042 }
1043 extern "C" {
ZSTD_sizeof_CStream(zcs: *const ZSTD_CStream) -> usize1044 pub fn ZSTD_sizeof_CStream(zcs: *const ZSTD_CStream) -> usize;
1045 }
1046 extern "C" {
ZSTD_sizeof_DStream(zds: *const ZSTD_DStream) -> usize1047 pub fn ZSTD_sizeof_DStream(zds: *const ZSTD_DStream) -> usize;
1048 }
1049 extern "C" {
ZSTD_sizeof_CDict(cdict: *const ZSTD_CDict) -> usize1050 pub fn ZSTD_sizeof_CDict(cdict: *const ZSTD_CDict) -> usize;
1051 }
1052 extern "C" {
ZSTD_sizeof_DDict(ddict: *const ZSTD_DDict) -> usize1053 pub fn ZSTD_sizeof_DDict(ddict: *const ZSTD_DDict) -> usize;
1054 }
1055 #[repr(C)]
1056 #[derive(Debug, Copy, Clone)]
1057 pub struct ZSTD_CCtx_params_s {
1058 _unused: [u8; 0],
1059 }
1060 pub type ZSTD_CCtx_params = ZSTD_CCtx_params_s;
1061 #[repr(C)]
1062 #[derive(Debug, Copy, Clone)]
1063 pub struct ZSTD_Sequence {
1064 pub matchPos: ::std::os::raw::c_uint,
1065 pub offset: ::std::os::raw::c_uint,
1066 pub litLength: ::std::os::raw::c_uint,
1067 pub matchLength: ::std::os::raw::c_uint,
1068 pub rep: ::std::os::raw::c_uint,
1069 }
1070 #[test]
bindgen_test_layout_ZSTD_Sequence()1071 fn bindgen_test_layout_ZSTD_Sequence() {
1072 assert_eq!(
1073 ::core::mem::size_of::<ZSTD_Sequence>(),
1074 20usize,
1075 concat!("Size of: ", stringify!(ZSTD_Sequence))
1076 );
1077 assert_eq!(
1078 ::core::mem::align_of::<ZSTD_Sequence>(),
1079 4usize,
1080 concat!("Alignment of ", stringify!(ZSTD_Sequence))
1081 );
1082 assert_eq!(
1083 unsafe {
1084 &(*(::core::ptr::null::<ZSTD_Sequence>())).matchPos as *const _
1085 as usize
1086 },
1087 0usize,
1088 concat!(
1089 "Offset of field: ",
1090 stringify!(ZSTD_Sequence),
1091 "::",
1092 stringify!(matchPos)
1093 )
1094 );
1095 assert_eq!(
1096 unsafe {
1097 &(*(::core::ptr::null::<ZSTD_Sequence>())).offset as *const _
1098 as usize
1099 },
1100 4usize,
1101 concat!(
1102 "Offset of field: ",
1103 stringify!(ZSTD_Sequence),
1104 "::",
1105 stringify!(offset)
1106 )
1107 );
1108 assert_eq!(
1109 unsafe {
1110 &(*(::core::ptr::null::<ZSTD_Sequence>())).litLength as *const _
1111 as usize
1112 },
1113 8usize,
1114 concat!(
1115 "Offset of field: ",
1116 stringify!(ZSTD_Sequence),
1117 "::",
1118 stringify!(litLength)
1119 )
1120 );
1121 assert_eq!(
1122 unsafe {
1123 &(*(::core::ptr::null::<ZSTD_Sequence>())).matchLength as *const _
1124 as usize
1125 },
1126 12usize,
1127 concat!(
1128 "Offset of field: ",
1129 stringify!(ZSTD_Sequence),
1130 "::",
1131 stringify!(matchLength)
1132 )
1133 );
1134 assert_eq!(
1135 unsafe {
1136 &(*(::core::ptr::null::<ZSTD_Sequence>())).rep as *const _ as usize
1137 },
1138 16usize,
1139 concat!(
1140 "Offset of field: ",
1141 stringify!(ZSTD_Sequence),
1142 "::",
1143 stringify!(rep)
1144 )
1145 );
1146 }
1147 #[repr(C)]
1148 #[derive(Debug, Copy, Clone)]
1149 pub struct ZSTD_compressionParameters {
1150 #[doc = "< largest match distance : larger == more compression, more memory needed during decompression"]
1151 pub windowLog: ::std::os::raw::c_uint,
1152 #[doc = "< fully searched segment : larger == more compression, slower, more memory (useless for fast)"]
1153 pub chainLog: ::std::os::raw::c_uint,
1154 #[doc = "< dispatch table : larger == faster, more memory"]
1155 pub hashLog: ::std::os::raw::c_uint,
1156 #[doc = "< nb of searches : larger == more compression, slower"]
1157 pub searchLog: ::std::os::raw::c_uint,
1158 #[doc = "< match length searched : larger == faster decompression, sometimes less compression"]
1159 pub minMatch: ::std::os::raw::c_uint,
1160 #[doc = "< acceptable match size for optimal parser (only) : larger == more compression, slower"]
1161 pub targetLength: ::std::os::raw::c_uint,
1162 #[doc = "< see ZSTD_strategy definition above"]
1163 pub strategy: ZSTD_strategy,
1164 }
1165 #[test]
bindgen_test_layout_ZSTD_compressionParameters()1166 fn bindgen_test_layout_ZSTD_compressionParameters() {
1167 assert_eq!(
1168 ::core::mem::size_of::<ZSTD_compressionParameters>(),
1169 28usize,
1170 concat!("Size of: ", stringify!(ZSTD_compressionParameters))
1171 );
1172 assert_eq!(
1173 ::core::mem::align_of::<ZSTD_compressionParameters>(),
1174 4usize,
1175 concat!("Alignment of ", stringify!(ZSTD_compressionParameters))
1176 );
1177 assert_eq!(
1178 unsafe {
1179 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).windowLog
1180 as *const _ as usize
1181 },
1182 0usize,
1183 concat!(
1184 "Offset of field: ",
1185 stringify!(ZSTD_compressionParameters),
1186 "::",
1187 stringify!(windowLog)
1188 )
1189 );
1190 assert_eq!(
1191 unsafe {
1192 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).chainLog
1193 as *const _ as usize
1194 },
1195 4usize,
1196 concat!(
1197 "Offset of field: ",
1198 stringify!(ZSTD_compressionParameters),
1199 "::",
1200 stringify!(chainLog)
1201 )
1202 );
1203 assert_eq!(
1204 unsafe {
1205 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).hashLog
1206 as *const _ as usize
1207 },
1208 8usize,
1209 concat!(
1210 "Offset of field: ",
1211 stringify!(ZSTD_compressionParameters),
1212 "::",
1213 stringify!(hashLog)
1214 )
1215 );
1216 assert_eq!(
1217 unsafe {
1218 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).searchLog
1219 as *const _ as usize
1220 },
1221 12usize,
1222 concat!(
1223 "Offset of field: ",
1224 stringify!(ZSTD_compressionParameters),
1225 "::",
1226 stringify!(searchLog)
1227 )
1228 );
1229 assert_eq!(
1230 unsafe {
1231 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).minMatch
1232 as *const _ as usize
1233 },
1234 16usize,
1235 concat!(
1236 "Offset of field: ",
1237 stringify!(ZSTD_compressionParameters),
1238 "::",
1239 stringify!(minMatch)
1240 )
1241 );
1242 assert_eq!(
1243 unsafe {
1244 &(*(::core::ptr::null::<ZSTD_compressionParameters>()))
1245 .targetLength as *const _ as usize
1246 },
1247 20usize,
1248 concat!(
1249 "Offset of field: ",
1250 stringify!(ZSTD_compressionParameters),
1251 "::",
1252 stringify!(targetLength)
1253 )
1254 );
1255 assert_eq!(
1256 unsafe {
1257 &(*(::core::ptr::null::<ZSTD_compressionParameters>())).strategy
1258 as *const _ as usize
1259 },
1260 24usize,
1261 concat!(
1262 "Offset of field: ",
1263 stringify!(ZSTD_compressionParameters),
1264 "::",
1265 stringify!(strategy)
1266 )
1267 );
1268 }
1269 #[repr(C)]
1270 #[derive(Debug, Copy, Clone)]
1271 pub struct ZSTD_frameParameters {
1272 #[doc = "< 1: content size will be in frame header (when known)"]
1273 pub contentSizeFlag: ::std::os::raw::c_int,
1274 #[doc = "< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection"]
1275 pub checksumFlag: ::std::os::raw::c_int,
1276 #[doc = "< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression)"]
1277 pub noDictIDFlag: ::std::os::raw::c_int,
1278 }
1279 #[test]
bindgen_test_layout_ZSTD_frameParameters()1280 fn bindgen_test_layout_ZSTD_frameParameters() {
1281 assert_eq!(
1282 ::core::mem::size_of::<ZSTD_frameParameters>(),
1283 12usize,
1284 concat!("Size of: ", stringify!(ZSTD_frameParameters))
1285 );
1286 assert_eq!(
1287 ::core::mem::align_of::<ZSTD_frameParameters>(),
1288 4usize,
1289 concat!("Alignment of ", stringify!(ZSTD_frameParameters))
1290 );
1291 assert_eq!(
1292 unsafe {
1293 &(*(::core::ptr::null::<ZSTD_frameParameters>())).contentSizeFlag
1294 as *const _ as usize
1295 },
1296 0usize,
1297 concat!(
1298 "Offset of field: ",
1299 stringify!(ZSTD_frameParameters),
1300 "::",
1301 stringify!(contentSizeFlag)
1302 )
1303 );
1304 assert_eq!(
1305 unsafe {
1306 &(*(::core::ptr::null::<ZSTD_frameParameters>())).checksumFlag
1307 as *const _ as usize
1308 },
1309 4usize,
1310 concat!(
1311 "Offset of field: ",
1312 stringify!(ZSTD_frameParameters),
1313 "::",
1314 stringify!(checksumFlag)
1315 )
1316 );
1317 assert_eq!(
1318 unsafe {
1319 &(*(::core::ptr::null::<ZSTD_frameParameters>())).noDictIDFlag
1320 as *const _ as usize
1321 },
1322 8usize,
1323 concat!(
1324 "Offset of field: ",
1325 stringify!(ZSTD_frameParameters),
1326 "::",
1327 stringify!(noDictIDFlag)
1328 )
1329 );
1330 }
1331 #[repr(C)]
1332 #[derive(Debug, Copy, Clone)]
1333 pub struct ZSTD_parameters {
1334 pub cParams: ZSTD_compressionParameters,
1335 pub fParams: ZSTD_frameParameters,
1336 }
1337 #[test]
bindgen_test_layout_ZSTD_parameters()1338 fn bindgen_test_layout_ZSTD_parameters() {
1339 assert_eq!(
1340 ::core::mem::size_of::<ZSTD_parameters>(),
1341 40usize,
1342 concat!("Size of: ", stringify!(ZSTD_parameters))
1343 );
1344 assert_eq!(
1345 ::core::mem::align_of::<ZSTD_parameters>(),
1346 4usize,
1347 concat!("Alignment of ", stringify!(ZSTD_parameters))
1348 );
1349 assert_eq!(
1350 unsafe {
1351 &(*(::core::ptr::null::<ZSTD_parameters>())).cParams as *const _
1352 as usize
1353 },
1354 0usize,
1355 concat!(
1356 "Offset of field: ",
1357 stringify!(ZSTD_parameters),
1358 "::",
1359 stringify!(cParams)
1360 )
1361 );
1362 assert_eq!(
1363 unsafe {
1364 &(*(::core::ptr::null::<ZSTD_parameters>())).fParams as *const _
1365 as usize
1366 },
1367 28usize,
1368 concat!(
1369 "Offset of field: ",
1370 stringify!(ZSTD_parameters),
1371 "::",
1372 stringify!(fParams)
1373 )
1374 );
1375 }
1376 #[repr(u32)]
1377 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1378 pub enum ZSTD_dictContentType_e {
1379 ZSTD_dct_auto = 0,
1380 ZSTD_dct_rawContent = 1,
1381 ZSTD_dct_fullDict = 2,
1382 }
1383 #[repr(u32)]
1384 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1385 pub enum ZSTD_dictLoadMethod_e {
1386 #[doc = "< Copy dictionary content internally"]
1387 ZSTD_dlm_byCopy = 0,
1388 #[doc = "< Reference dictionary content -- the dictionary buffer must outlive its users."]
1389 ZSTD_dlm_byRef = 1,
1390 }
1391 #[repr(u32)]
1392 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1393 pub enum ZSTD_format_e {
1394 ZSTD_f_zstd1 = 0,
1395 ZSTD_f_zstd1_magicless = 1,
1396 }
1397 #[repr(u32)]
1398 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1399 pub enum ZSTD_dictAttachPref_e {
1400 ZSTD_dictDefaultAttach = 0,
1401 ZSTD_dictForceAttach = 1,
1402 ZSTD_dictForceCopy = 2,
1403 ZSTD_dictForceLoad = 3,
1404 }
1405 #[repr(u32)]
1406 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1407 pub enum ZSTD_literalCompressionMode_e {
1408 #[doc = "< Automatically determine the compression mode based on the compression level."]
1409 #[doc = " Negative compression levels will be uncompressed, and positive compression"]
1410 #[doc = " levels will be compressed."]
1411 ZSTD_lcm_auto = 0,
1412 #[doc = "< Always attempt Huffman compression. Uncompressed literals will still be"]
1413 #[doc = " emitted if Huffman compression is not profitable."]
1414 ZSTD_lcm_huffman = 1,
1415 #[doc = "< Always emit uncompressed literals."]
1416 ZSTD_lcm_uncompressed = 2,
1417 }
1418 extern "C" {
1419 #[doc = " ZSTD_findDecompressedSize() :"]
1420 #[doc = " `src` should point to the start of a series of ZSTD encoded and/or skippable frames"]
1421 #[doc = " `srcSize` must be the _exact_ size of this series"]
1422 #[doc = " (i.e. there should be a frame boundary at `src + srcSize`)"]
1423 #[doc = " @return : - decompressed size of all data in all successive frames"]
1424 #[doc = " - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN"]
1425 #[doc = " - if an error occurred: ZSTD_CONTENTSIZE_ERROR"]
1426 #[doc = ""]
1427 #[doc = " note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode."]
1428 #[doc = " When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size."]
1429 #[doc = " In which case, it's necessary to use streaming mode to decompress data."]
1430 #[doc = " note 2 : decompressed size is always present when compression is done with ZSTD_compress()"]
1431 #[doc = " note 3 : decompressed size can be very large (64-bits value),"]
1432 #[doc = " potentially larger than what local system can handle as a single memory segment."]
1433 #[doc = " In which case, it's necessary to use streaming mode to decompress data."]
1434 #[doc = " note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified."]
1435 #[doc = " Always ensure result fits within application's authorized limits."]
1436 #[doc = " Each application can set its own limits."]
1437 #[doc = " note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to"]
1438 #[doc = " read each contained frame header. This is fast as most of the data is skipped,"]
1439 #[doc = " however it does mean that all frame data must be present and valid."]
ZSTD_findDecompressedSize( src: *const ::std::os::raw::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong1440 pub fn ZSTD_findDecompressedSize(
1441 src: *const ::std::os::raw::c_void,
1442 srcSize: usize,
1443 ) -> ::std::os::raw::c_ulonglong;
1444 }
1445 extern "C" {
1446 #[doc = " ZSTD_decompressBound() :"]
1447 #[doc = " `src` should point to the start of a series of ZSTD encoded and/or skippable frames"]
1448 #[doc = " `srcSize` must be the _exact_ size of this series"]
1449 #[doc = " (i.e. there should be a frame boundary at `src + srcSize`)"]
1450 #[doc = " @return : - upper-bound for the decompressed size of all data in all successive frames"]
1451 #[doc = " - if an error occured: ZSTD_CONTENTSIZE_ERROR"]
1452 #[doc = ""]
1453 #[doc = " note 1 : an error can occur if `src` contains an invalid or incorrectly formatted frame."]
1454 #[doc = " note 2 : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`."]
1455 #[doc = " in this case, `ZSTD_findDecompressedSize` and `ZSTD_decompressBound` return the same value."]
1456 #[doc = " note 3 : when the decompressed size field isn't available, the upper-bound for that frame is calculated by:"]
1457 #[doc = " upper-bound = # blocks * min(128 KB, Window_Size)"]
ZSTD_decompressBound( src: *const ::std::os::raw::c_void, srcSize: usize, ) -> ::std::os::raw::c_ulonglong1458 pub fn ZSTD_decompressBound(
1459 src: *const ::std::os::raw::c_void,
1460 srcSize: usize,
1461 ) -> ::std::os::raw::c_ulonglong;
1462 }
1463 extern "C" {
1464 #[doc = " ZSTD_frameHeaderSize() :"]
1465 #[doc = " srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX."]
1466 #[doc = " @return : size of the Frame Header,"]
1467 #[doc = " or an error code (if srcSize is too small)"]
ZSTD_frameHeaderSize( src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize1468 pub fn ZSTD_frameHeaderSize(
1469 src: *const ::std::os::raw::c_void,
1470 srcSize: usize,
1471 ) -> usize;
1472 }
1473 extern "C" {
1474 #[doc = " ZSTD_getSequences() :"]
1475 #[doc = " Extract sequences from the sequence store"]
1476 #[doc = " zc can be used to insert custom compression params."]
1477 #[doc = " This function invokes ZSTD_compress2"]
1478 #[doc = " @return : number of sequences extracted"]
ZSTD_getSequences( zc: *mut ZSTD_CCtx, outSeqs: *mut ZSTD_Sequence, outSeqsSize: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize1479 pub fn ZSTD_getSequences(
1480 zc: *mut ZSTD_CCtx,
1481 outSeqs: *mut ZSTD_Sequence,
1482 outSeqsSize: usize,
1483 src: *const ::std::os::raw::c_void,
1484 srcSize: usize,
1485 ) -> usize;
1486 }
1487 extern "C" {
1488 #[doc = " ZSTD_estimate*() :"]
1489 #[doc = " These functions make it possible to estimate memory usage of a future"]
1490 #[doc = " {D,C}Ctx, before its creation."]
1491 #[doc = ""]
1492 #[doc = " ZSTD_estimateCCtxSize() will provide a budget large enough for any"]
1493 #[doc = " compression level up to selected one. Unlike ZSTD_estimateCStreamSize*(),"]
1494 #[doc = " this estimate does not include space for a window buffer, so this estimate"]
1495 #[doc = " is guaranteed to be enough for single-shot compressions, but not streaming"]
1496 #[doc = " compressions. It will however assume the input may be arbitrarily large,"]
1497 #[doc = " which is the worst case. If srcSize is known to always be small,"]
1498 #[doc = " ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation."]
1499 #[doc = " ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with"]
1500 #[doc = " ZSTD_getCParams() to create cParams from compressionLevel."]
1501 #[doc = " ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with"]
1502 #[doc = " ZSTD_CCtxParams_setParameter()."]
1503 #[doc = ""]
1504 #[doc = " Note: only single-threaded compression is supported. This function will"]
1505 #[doc = " return an error code if ZSTD_c_nbWorkers is >= 1."]
ZSTD_estimateCCtxSize( compressionLevel: ::std::os::raw::c_int, ) -> usize1506 pub fn ZSTD_estimateCCtxSize(
1507 compressionLevel: ::std::os::raw::c_int,
1508 ) -> usize;
1509 }
1510 extern "C" {
ZSTD_estimateCCtxSize_usingCParams( cParams: ZSTD_compressionParameters, ) -> usize1511 pub fn ZSTD_estimateCCtxSize_usingCParams(
1512 cParams: ZSTD_compressionParameters,
1513 ) -> usize;
1514 }
1515 extern "C" {
ZSTD_estimateCCtxSize_usingCCtxParams( params: *const ZSTD_CCtx_params, ) -> usize1516 pub fn ZSTD_estimateCCtxSize_usingCCtxParams(
1517 params: *const ZSTD_CCtx_params,
1518 ) -> usize;
1519 }
1520 extern "C" {
ZSTD_estimateDCtxSize() -> usize1521 pub fn ZSTD_estimateDCtxSize() -> usize;
1522 }
1523 extern "C" {
1524 #[doc = " ZSTD_estimateCStreamSize() :"]
1525 #[doc = " ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one."]
1526 #[doc = " It will also consider src size to be arbitrarily \"large\", which is worst case."]
1527 #[doc = " If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation."]
1528 #[doc = " ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel."]
1529 #[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."]
1530 #[doc = " Note : CStream size estimation is only correct for single-threaded compression."]
1531 #[doc = " ZSTD_DStream memory budget depends on window Size."]
1532 #[doc = " This information can be passed manually, using ZSTD_estimateDStreamSize,"]
1533 #[doc = " or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame();"]
1534 #[doc = " Note : if streaming is init with function ZSTD_init?Stream_usingDict(),"]
1535 #[doc = " an internal ?Dict will be created, which additional size is not estimated here."]
1536 #[doc = " In this case, get total size by adding ZSTD_estimate?DictSize"]
ZSTD_estimateCStreamSize( compressionLevel: ::std::os::raw::c_int, ) -> usize1537 pub fn ZSTD_estimateCStreamSize(
1538 compressionLevel: ::std::os::raw::c_int,
1539 ) -> usize;
1540 }
1541 extern "C" {
ZSTD_estimateCStreamSize_usingCParams( cParams: ZSTD_compressionParameters, ) -> usize1542 pub fn ZSTD_estimateCStreamSize_usingCParams(
1543 cParams: ZSTD_compressionParameters,
1544 ) -> usize;
1545 }
1546 extern "C" {
ZSTD_estimateCStreamSize_usingCCtxParams( params: *const ZSTD_CCtx_params, ) -> usize1547 pub fn ZSTD_estimateCStreamSize_usingCCtxParams(
1548 params: *const ZSTD_CCtx_params,
1549 ) -> usize;
1550 }
1551 extern "C" {
ZSTD_estimateDStreamSize(windowSize: usize) -> usize1552 pub fn ZSTD_estimateDStreamSize(windowSize: usize) -> usize;
1553 }
1554 extern "C" {
ZSTD_estimateDStreamSize_fromFrame( src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize1555 pub fn ZSTD_estimateDStreamSize_fromFrame(
1556 src: *const ::std::os::raw::c_void,
1557 srcSize: usize,
1558 ) -> usize;
1559 }
1560 extern "C" {
1561 #[doc = " ZSTD_estimate?DictSize() :"]
1562 #[doc = " ZSTD_estimateCDictSize() will bet that src size is relatively \"small\", and content is copied, like ZSTD_createCDict()."]
1563 #[doc = " ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced()."]
1564 #[doc = " Note : dictionaries created by reference (`ZSTD_dlm_byRef`) are logically smaller."]
ZSTD_estimateCDictSize( dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize1565 pub fn ZSTD_estimateCDictSize(
1566 dictSize: usize,
1567 compressionLevel: ::std::os::raw::c_int,
1568 ) -> usize;
1569 }
1570 extern "C" {
ZSTD_estimateCDictSize_advanced( dictSize: usize, cParams: ZSTD_compressionParameters, dictLoadMethod: ZSTD_dictLoadMethod_e, ) -> usize1571 pub fn ZSTD_estimateCDictSize_advanced(
1572 dictSize: usize,
1573 cParams: ZSTD_compressionParameters,
1574 dictLoadMethod: ZSTD_dictLoadMethod_e,
1575 ) -> usize;
1576 }
1577 extern "C" {
ZSTD_estimateDDictSize( dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, ) -> usize1578 pub fn ZSTD_estimateDDictSize(
1579 dictSize: usize,
1580 dictLoadMethod: ZSTD_dictLoadMethod_e,
1581 ) -> usize;
1582 }
1583 extern "C" {
1584 #[doc = " ZSTD_initStatic*() :"]
1585 #[doc = " Initialize an object using a pre-allocated fixed-size buffer."]
1586 #[doc = " workspace: The memory area to emplace the object into."]
1587 #[doc = " Provided pointer *must be 8-bytes aligned*."]
1588 #[doc = " Buffer must outlive object."]
1589 #[doc = " workspaceSize: Use ZSTD_estimate*Size() to determine"]
1590 #[doc = " how large workspace must be to support target scenario."]
1591 #[doc = " @return : pointer to object (same address as workspace, just different type),"]
1592 #[doc = " or NULL if error (size too small, incorrect alignment, etc.)"]
1593 #[doc = " Note : zstd will never resize nor malloc() when using a static buffer."]
1594 #[doc = " If the object requires more memory than available,"]
1595 #[doc = " zstd will just error out (typically ZSTD_error_memory_allocation)."]
1596 #[doc = " Note 2 : there is no corresponding \"free\" function."]
1597 #[doc = " Since workspace is allocated externally, it must be freed externally too."]
1598 #[doc = " Note 3 : cParams : use ZSTD_getCParams() to convert a compression level"]
1599 #[doc = " into its associated cParams."]
1600 #[doc = " Limitation 1 : currently not compatible with internal dictionary creation, triggered by"]
1601 #[doc = " ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict()."]
1602 #[doc = " Limitation 2 : static cctx currently not compatible with multi-threading."]
1603 #[doc = " Limitation 3 : static dctx is incompatible with legacy support."]
ZSTD_initStaticCCtx( workspace: *mut ::std::os::raw::c_void, workspaceSize: usize, ) -> *mut ZSTD_CCtx1604 pub fn ZSTD_initStaticCCtx(
1605 workspace: *mut ::std::os::raw::c_void,
1606 workspaceSize: usize,
1607 ) -> *mut ZSTD_CCtx;
1608 }
1609 extern "C" {
ZSTD_initStaticCStream( workspace: *mut ::std::os::raw::c_void, workspaceSize: usize, ) -> *mut ZSTD_CStream1610 pub fn ZSTD_initStaticCStream(
1611 workspace: *mut ::std::os::raw::c_void,
1612 workspaceSize: usize,
1613 ) -> *mut ZSTD_CStream;
1614 }
1615 extern "C" {
ZSTD_initStaticDCtx( workspace: *mut ::std::os::raw::c_void, workspaceSize: usize, ) -> *mut ZSTD_DCtx1616 pub fn ZSTD_initStaticDCtx(
1617 workspace: *mut ::std::os::raw::c_void,
1618 workspaceSize: usize,
1619 ) -> *mut ZSTD_DCtx;
1620 }
1621 extern "C" {
ZSTD_initStaticDStream( workspace: *mut ::std::os::raw::c_void, workspaceSize: usize, ) -> *mut ZSTD_DStream1622 pub fn ZSTD_initStaticDStream(
1623 workspace: *mut ::std::os::raw::c_void,
1624 workspaceSize: usize,
1625 ) -> *mut ZSTD_DStream;
1626 }
1627 extern "C" {
ZSTD_initStaticCDict( workspace: *mut ::std::os::raw::c_void, workspaceSize: usize, dict: *const ::std::os::raw::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, cParams: ZSTD_compressionParameters, ) -> *const ZSTD_CDict1628 pub fn ZSTD_initStaticCDict(
1629 workspace: *mut ::std::os::raw::c_void,
1630 workspaceSize: usize,
1631 dict: *const ::std::os::raw::c_void,
1632 dictSize: usize,
1633 dictLoadMethod: ZSTD_dictLoadMethod_e,
1634 dictContentType: ZSTD_dictContentType_e,
1635 cParams: ZSTD_compressionParameters,
1636 ) -> *const ZSTD_CDict;
1637 }
1638 extern "C" {
ZSTD_initStaticDDict( workspace: *mut ::std::os::raw::c_void, workspaceSize: usize, dict: *const ::std::os::raw::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, ) -> *const ZSTD_DDict1639 pub fn ZSTD_initStaticDDict(
1640 workspace: *mut ::std::os::raw::c_void,
1641 workspaceSize: usize,
1642 dict: *const ::std::os::raw::c_void,
1643 dictSize: usize,
1644 dictLoadMethod: ZSTD_dictLoadMethod_e,
1645 dictContentType: ZSTD_dictContentType_e,
1646 ) -> *const ZSTD_DDict;
1647 }
1648 #[doc = " Custom memory allocation :"]
1649 #[doc = " These prototypes make it possible to pass your own allocation/free functions."]
1650 #[doc = " ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below."]
1651 #[doc = " All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones."]
1652 pub type ZSTD_allocFunction = ::core::option::Option<
1653 unsafe extern "C" fn(
1654 opaque: *mut ::std::os::raw::c_void,
1655 size: usize,
1656 ) -> *mut ::std::os::raw::c_void,
1657 >;
1658 pub type ZSTD_freeFunction = ::core::option::Option<
1659 unsafe extern "C" fn(
1660 opaque: *mut ::std::os::raw::c_void,
1661 address: *mut ::std::os::raw::c_void,
1662 ),
1663 >;
1664 #[repr(C)]
1665 #[derive(Debug, Copy, Clone)]
1666 pub struct ZSTD_customMem {
1667 pub customAlloc: ZSTD_allocFunction,
1668 pub customFree: ZSTD_freeFunction,
1669 pub opaque: *mut ::std::os::raw::c_void,
1670 }
1671 #[test]
bindgen_test_layout_ZSTD_customMem()1672 fn bindgen_test_layout_ZSTD_customMem() {
1673 assert_eq!(
1674 ::core::mem::size_of::<ZSTD_customMem>(),
1675 24usize,
1676 concat!("Size of: ", stringify!(ZSTD_customMem))
1677 );
1678 assert_eq!(
1679 ::core::mem::align_of::<ZSTD_customMem>(),
1680 8usize,
1681 concat!("Alignment of ", stringify!(ZSTD_customMem))
1682 );
1683 assert_eq!(
1684 unsafe {
1685 &(*(::core::ptr::null::<ZSTD_customMem>())).customAlloc as *const _
1686 as usize
1687 },
1688 0usize,
1689 concat!(
1690 "Offset of field: ",
1691 stringify!(ZSTD_customMem),
1692 "::",
1693 stringify!(customAlloc)
1694 )
1695 );
1696 assert_eq!(
1697 unsafe {
1698 &(*(::core::ptr::null::<ZSTD_customMem>())).customFree as *const _
1699 as usize
1700 },
1701 8usize,
1702 concat!(
1703 "Offset of field: ",
1704 stringify!(ZSTD_customMem),
1705 "::",
1706 stringify!(customFree)
1707 )
1708 );
1709 assert_eq!(
1710 unsafe {
1711 &(*(::core::ptr::null::<ZSTD_customMem>())).opaque as *const _
1712 as usize
1713 },
1714 16usize,
1715 concat!(
1716 "Offset of field: ",
1717 stringify!(ZSTD_customMem),
1718 "::",
1719 stringify!(opaque)
1720 )
1721 );
1722 }
1723 extern "C" {
1724 pub static ZSTD_defaultCMem: ZSTD_customMem;
1725 }
1726 extern "C" {
ZSTD_createCCtx_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_CCtx1727 pub fn ZSTD_createCCtx_advanced(
1728 customMem: ZSTD_customMem,
1729 ) -> *mut ZSTD_CCtx;
1730 }
1731 extern "C" {
ZSTD_createCStream_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_CStream1732 pub fn ZSTD_createCStream_advanced(
1733 customMem: ZSTD_customMem,
1734 ) -> *mut ZSTD_CStream;
1735 }
1736 extern "C" {
ZSTD_createDCtx_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_DCtx1737 pub fn ZSTD_createDCtx_advanced(
1738 customMem: ZSTD_customMem,
1739 ) -> *mut ZSTD_DCtx;
1740 }
1741 extern "C" {
ZSTD_createDStream_advanced( customMem: ZSTD_customMem, ) -> *mut ZSTD_DStream1742 pub fn ZSTD_createDStream_advanced(
1743 customMem: ZSTD_customMem,
1744 ) -> *mut ZSTD_DStream;
1745 }
1746 extern "C" {
ZSTD_createCDict_advanced( dict: *const ::std::os::raw::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, cParams: ZSTD_compressionParameters, customMem: ZSTD_customMem, ) -> *mut ZSTD_CDict1747 pub fn ZSTD_createCDict_advanced(
1748 dict: *const ::std::os::raw::c_void,
1749 dictSize: usize,
1750 dictLoadMethod: ZSTD_dictLoadMethod_e,
1751 dictContentType: ZSTD_dictContentType_e,
1752 cParams: ZSTD_compressionParameters,
1753 customMem: ZSTD_customMem,
1754 ) -> *mut ZSTD_CDict;
1755 }
1756 extern "C" {
ZSTD_createDDict_advanced( dict: *const ::std::os::raw::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, customMem: ZSTD_customMem, ) -> *mut ZSTD_DDict1757 pub fn ZSTD_createDDict_advanced(
1758 dict: *const ::std::os::raw::c_void,
1759 dictSize: usize,
1760 dictLoadMethod: ZSTD_dictLoadMethod_e,
1761 dictContentType: ZSTD_dictContentType_e,
1762 customMem: ZSTD_customMem,
1763 ) -> *mut ZSTD_DDict;
1764 }
1765 extern "C" {
1766 #[doc = " ZSTD_createCDict_byReference() :"]
1767 #[doc = " Create a digested dictionary for compression"]
1768 #[doc = " Dictionary content is just referenced, not duplicated."]
1769 #[doc = " As a consequence, `dictBuffer` **must** outlive CDict,"]
1770 #[doc = " and its content must remain unmodified throughout the lifetime of CDict."]
1771 #[doc = " note: equivalent to ZSTD_createCDict_advanced(), with dictLoadMethod==ZSTD_dlm_byRef"]
ZSTD_createCDict_byReference( dictBuffer: *const ::std::os::raw::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> *mut ZSTD_CDict1772 pub fn ZSTD_createCDict_byReference(
1773 dictBuffer: *const ::std::os::raw::c_void,
1774 dictSize: usize,
1775 compressionLevel: ::std::os::raw::c_int,
1776 ) -> *mut ZSTD_CDict;
1777 }
1778 extern "C" {
1779 #[doc = " ZSTD_getCParams() :"]
1780 #[doc = " @return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize."]
1781 #[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_compressionParameters1782 pub fn ZSTD_getCParams(
1783 compressionLevel: ::std::os::raw::c_int,
1784 estimatedSrcSize: ::std::os::raw::c_ulonglong,
1785 dictSize: usize,
1786 ) -> ZSTD_compressionParameters;
1787 }
1788 extern "C" {
1789 #[doc = " ZSTD_getParams() :"]
1790 #[doc = " same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`."]
1791 #[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_parameters1792 pub fn ZSTD_getParams(
1793 compressionLevel: ::std::os::raw::c_int,
1794 estimatedSrcSize: ::std::os::raw::c_ulonglong,
1795 dictSize: usize,
1796 ) -> ZSTD_parameters;
1797 }
1798 extern "C" {
1799 #[doc = " ZSTD_checkCParams() :"]
1800 #[doc = " Ensure param values remain within authorized range."]
1801 #[doc = " @return 0 on success, or an error code (can be checked with ZSTD_isError())"]
ZSTD_checkCParams(params: ZSTD_compressionParameters) -> usize1802 pub fn ZSTD_checkCParams(params: ZSTD_compressionParameters) -> usize;
1803 }
1804 extern "C" {
1805 #[doc = " ZSTD_adjustCParams() :"]
1806 #[doc = " optimize params for a given `srcSize` and `dictSize`."]
1807 #[doc = " `srcSize` can be unknown, in which case use ZSTD_CONTENTSIZE_UNKNOWN."]
1808 #[doc = " `dictSize` must be `0` when there is no dictionary."]
1809 #[doc = " cPar can be invalid : all parameters will be clamped within valid range in the @return struct."]
1810 #[doc = " This function never fails (wide contract)"]
ZSTD_adjustCParams( cPar: ZSTD_compressionParameters, srcSize: ::std::os::raw::c_ulonglong, dictSize: usize, ) -> ZSTD_compressionParameters1811 pub fn ZSTD_adjustCParams(
1812 cPar: ZSTD_compressionParameters,
1813 srcSize: ::std::os::raw::c_ulonglong,
1814 dictSize: usize,
1815 ) -> ZSTD_compressionParameters;
1816 }
1817 extern "C" {
1818 #[doc = " ZSTD_compress_advanced() :"]
1819 #[doc = " Note : this function is now DEPRECATED."]
1820 #[doc = " It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters."]
1821 #[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 ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, dict: *const ::std::os::raw::c_void, dictSize: usize, params: ZSTD_parameters, ) -> usize1822 pub fn ZSTD_compress_advanced(
1823 cctx: *mut ZSTD_CCtx,
1824 dst: *mut ::std::os::raw::c_void,
1825 dstCapacity: usize,
1826 src: *const ::std::os::raw::c_void,
1827 srcSize: usize,
1828 dict: *const ::std::os::raw::c_void,
1829 dictSize: usize,
1830 params: ZSTD_parameters,
1831 ) -> usize;
1832 }
1833 extern "C" {
1834 #[doc = " ZSTD_compress_usingCDict_advanced() :"]
1835 #[doc = " Note : this function is now REDUNDANT."]
1836 #[doc = " It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters."]
1837 #[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 ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, cdict: *const ZSTD_CDict, fParams: ZSTD_frameParameters, ) -> usize1838 pub fn ZSTD_compress_usingCDict_advanced(
1839 cctx: *mut ZSTD_CCtx,
1840 dst: *mut ::std::os::raw::c_void,
1841 dstCapacity: usize,
1842 src: *const ::std::os::raw::c_void,
1843 srcSize: usize,
1844 cdict: *const ZSTD_CDict,
1845 fParams: ZSTD_frameParameters,
1846 ) -> usize;
1847 }
1848 extern "C" {
1849 #[doc = " ZSTD_CCtx_loadDictionary_byReference() :"]
1850 #[doc = " Same as ZSTD_CCtx_loadDictionary(), but dictionary content is referenced, instead of being copied into CCtx."]
1851 #[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 ::std::os::raw::c_void, dictSize: usize, ) -> usize1852 pub fn ZSTD_CCtx_loadDictionary_byReference(
1853 cctx: *mut ZSTD_CCtx,
1854 dict: *const ::std::os::raw::c_void,
1855 dictSize: usize,
1856 ) -> usize;
1857 }
1858 extern "C" {
1859 #[doc = " ZSTD_CCtx_loadDictionary_advanced() :"]
1860 #[doc = " Same as ZSTD_CCtx_loadDictionary(), but gives finer control over"]
1861 #[doc = " how to load the dictionary (by copy ? by reference ?)"]
1862 #[doc = " and how to interpret it (automatic ? force raw mode ? full mode only ?)"]
ZSTD_CCtx_loadDictionary_advanced( cctx: *mut ZSTD_CCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, ) -> usize1863 pub fn ZSTD_CCtx_loadDictionary_advanced(
1864 cctx: *mut ZSTD_CCtx,
1865 dict: *const ::std::os::raw::c_void,
1866 dictSize: usize,
1867 dictLoadMethod: ZSTD_dictLoadMethod_e,
1868 dictContentType: ZSTD_dictContentType_e,
1869 ) -> usize;
1870 }
1871 extern "C" {
1872 #[doc = " ZSTD_CCtx_refPrefix_advanced() :"]
1873 #[doc = " Same as ZSTD_CCtx_refPrefix(), but gives finer control over"]
1874 #[doc = " how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)"]
ZSTD_CCtx_refPrefix_advanced( cctx: *mut ZSTD_CCtx, prefix: *const ::std::os::raw::c_void, prefixSize: usize, dictContentType: ZSTD_dictContentType_e, ) -> usize1875 pub fn ZSTD_CCtx_refPrefix_advanced(
1876 cctx: *mut ZSTD_CCtx,
1877 prefix: *const ::std::os::raw::c_void,
1878 prefixSize: usize,
1879 dictContentType: ZSTD_dictContentType_e,
1880 ) -> usize;
1881 }
1882 extern "C" {
1883 #[doc = " ZSTD_CCtx_getParameter() :"]
1884 #[doc = " Get the requested compression parameter value, selected by enum ZSTD_cParameter,"]
1885 #[doc = " and store it into int* value."]
1886 #[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, ) -> usize1887 pub fn ZSTD_CCtx_getParameter(
1888 cctx: *mut ZSTD_CCtx,
1889 param: ZSTD_cParameter,
1890 value: *mut ::std::os::raw::c_int,
1891 ) -> usize;
1892 }
1893 extern "C" {
1894 #[doc = " ZSTD_CCtx_params :"]
1895 #[doc = " Quick howto :"]
1896 #[doc = " - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure"]
1897 #[doc = " - ZSTD_CCtxParams_setParameter() : Push parameters one by one into"]
1898 #[doc = " an existing ZSTD_CCtx_params structure."]
1899 #[doc = " This is similar to"]
1900 #[doc = " ZSTD_CCtx_setParameter()."]
1901 #[doc = " - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to"]
1902 #[doc = " an existing CCtx."]
1903 #[doc = " These parameters will be applied to"]
1904 #[doc = " all subsequent frames."]
1905 #[doc = " - ZSTD_compressStream2() : Do compression using the CCtx."]
1906 #[doc = " - ZSTD_freeCCtxParams() : Free the memory."]
1907 #[doc = ""]
1908 #[doc = " This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams()"]
1909 #[doc = " for static allocation of CCtx for single-threaded compression."]
ZSTD_createCCtxParams() -> *mut ZSTD_CCtx_params1910 pub fn ZSTD_createCCtxParams() -> *mut ZSTD_CCtx_params;
1911 }
1912 extern "C" {
ZSTD_freeCCtxParams(params: *mut ZSTD_CCtx_params) -> usize1913 pub fn ZSTD_freeCCtxParams(params: *mut ZSTD_CCtx_params) -> usize;
1914 }
1915 extern "C" {
1916 #[doc = " ZSTD_CCtxParams_reset() :"]
1917 #[doc = " Reset params to default values."]
ZSTD_CCtxParams_reset(params: *mut ZSTD_CCtx_params) -> usize1918 pub fn ZSTD_CCtxParams_reset(params: *mut ZSTD_CCtx_params) -> usize;
1919 }
1920 extern "C" {
1921 #[doc = " ZSTD_CCtxParams_init() :"]
1922 #[doc = " Initializes the compression parameters of cctxParams according to"]
1923 #[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, ) -> usize1924 pub fn ZSTD_CCtxParams_init(
1925 cctxParams: *mut ZSTD_CCtx_params,
1926 compressionLevel: ::std::os::raw::c_int,
1927 ) -> usize;
1928 }
1929 extern "C" {
1930 #[doc = " ZSTD_CCtxParams_init_advanced() :"]
1931 #[doc = " Initializes the compression and frame parameters of cctxParams according to"]
1932 #[doc = " params. All other parameters are reset to their default values."]
ZSTD_CCtxParams_init_advanced( cctxParams: *mut ZSTD_CCtx_params, params: ZSTD_parameters, ) -> usize1933 pub fn ZSTD_CCtxParams_init_advanced(
1934 cctxParams: *mut ZSTD_CCtx_params,
1935 params: ZSTD_parameters,
1936 ) -> usize;
1937 }
1938 extern "C" {
1939 #[doc = " ZSTD_CCtxParams_setParameter() :"]
1940 #[doc = " Similar to ZSTD_CCtx_setParameter."]
1941 #[doc = " Set one compression parameter, selected by enum ZSTD_cParameter."]
1942 #[doc = " Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_setParametersUsingCCtxParams()."]
1943 #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
ZSTD_CCtxParams_setParameter( params: *mut ZSTD_CCtx_params, param: ZSTD_cParameter, value: ::std::os::raw::c_int, ) -> usize1944 pub fn ZSTD_CCtxParams_setParameter(
1945 params: *mut ZSTD_CCtx_params,
1946 param: ZSTD_cParameter,
1947 value: ::std::os::raw::c_int,
1948 ) -> usize;
1949 }
1950 extern "C" {
1951 #[doc = " ZSTD_CCtxParams_getParameter() :"]
1952 #[doc = " Similar to ZSTD_CCtx_getParameter."]
1953 #[doc = " Get the requested value of one compression parameter, selected by enum ZSTD_cParameter."]
1954 #[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, ) -> usize1955 pub fn ZSTD_CCtxParams_getParameter(
1956 params: *mut ZSTD_CCtx_params,
1957 param: ZSTD_cParameter,
1958 value: *mut ::std::os::raw::c_int,
1959 ) -> usize;
1960 }
1961 extern "C" {
1962 #[doc = " ZSTD_CCtx_setParametersUsingCCtxParams() :"]
1963 #[doc = " Apply a set of ZSTD_CCtx_params to the compression context."]
1964 #[doc = " This can be done even after compression is started,"]
1965 #[doc = " if nbWorkers==0, this will have no impact until a new compression is started."]
1966 #[doc = " if nbWorkers>=1, new parameters will be picked up at next job,"]
1967 #[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, ) -> usize1968 pub fn ZSTD_CCtx_setParametersUsingCCtxParams(
1969 cctx: *mut ZSTD_CCtx,
1970 params: *const ZSTD_CCtx_params,
1971 ) -> usize;
1972 }
1973 extern "C" {
1974 #[doc = " ZSTD_compressStream2_simpleArgs() :"]
1975 #[doc = " Same as ZSTD_compressStream2(),"]
1976 #[doc = " but using only integral types as arguments."]
1977 #[doc = " This variant might be helpful for binders from dynamic languages"]
1978 #[doc = " which have troubles handling structures containing memory pointers."]
ZSTD_compressStream2_simpleArgs( cctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, dstPos: *mut usize, src: *const ::std::os::raw::c_void, srcSize: usize, srcPos: *mut usize, endOp: ZSTD_EndDirective, ) -> usize1979 pub fn ZSTD_compressStream2_simpleArgs(
1980 cctx: *mut ZSTD_CCtx,
1981 dst: *mut ::std::os::raw::c_void,
1982 dstCapacity: usize,
1983 dstPos: *mut usize,
1984 src: *const ::std::os::raw::c_void,
1985 srcSize: usize,
1986 srcPos: *mut usize,
1987 endOp: ZSTD_EndDirective,
1988 ) -> usize;
1989 }
1990 extern "C" {
1991 #[doc = " ZSTD_isFrame() :"]
1992 #[doc = " Tells if the content of `buffer` starts with a valid Frame Identifier."]
1993 #[doc = " Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0."]
1994 #[doc = " Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled."]
1995 #[doc = " Note 3 : Skippable Frame Identifiers are considered valid."]
ZSTD_isFrame( buffer: *const ::std::os::raw::c_void, size: usize, ) -> ::std::os::raw::c_uint1996 pub fn ZSTD_isFrame(
1997 buffer: *const ::std::os::raw::c_void,
1998 size: usize,
1999 ) -> ::std::os::raw::c_uint;
2000 }
2001 extern "C" {
2002 #[doc = " ZSTD_createDDict_byReference() :"]
2003 #[doc = " Create a digested dictionary, ready to start decompression operation without startup delay."]
2004 #[doc = " Dictionary content is referenced, and therefore stays in dictBuffer."]
2005 #[doc = " It is important that dictBuffer outlives DDict,"]
2006 #[doc = " it must remain read accessible throughout the lifetime of DDict"]
ZSTD_createDDict_byReference( dictBuffer: *const ::std::os::raw::c_void, dictSize: usize, ) -> *mut ZSTD_DDict2007 pub fn ZSTD_createDDict_byReference(
2008 dictBuffer: *const ::std::os::raw::c_void,
2009 dictSize: usize,
2010 ) -> *mut ZSTD_DDict;
2011 }
2012 extern "C" {
2013 #[doc = " ZSTD_DCtx_loadDictionary_byReference() :"]
2014 #[doc = " Same as ZSTD_DCtx_loadDictionary(),"]
2015 #[doc = " but references `dict` content instead of copying it into `dctx`."]
2016 #[doc = " This saves memory if `dict` remains around.,"]
2017 #[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 ::std::os::raw::c_void, dictSize: usize, ) -> usize2018 pub fn ZSTD_DCtx_loadDictionary_byReference(
2019 dctx: *mut ZSTD_DCtx,
2020 dict: *const ::std::os::raw::c_void,
2021 dictSize: usize,
2022 ) -> usize;
2023 }
2024 extern "C" {
2025 #[doc = " ZSTD_DCtx_loadDictionary_advanced() :"]
2026 #[doc = " Same as ZSTD_DCtx_loadDictionary(),"]
2027 #[doc = " but gives direct control over"]
2028 #[doc = " how to load the dictionary (by copy ? by reference ?)"]
2029 #[doc = " and how to interpret it (automatic ? force raw mode ? full mode only ?)."]
ZSTD_DCtx_loadDictionary_advanced( dctx: *mut ZSTD_DCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, dictLoadMethod: ZSTD_dictLoadMethod_e, dictContentType: ZSTD_dictContentType_e, ) -> usize2030 pub fn ZSTD_DCtx_loadDictionary_advanced(
2031 dctx: *mut ZSTD_DCtx,
2032 dict: *const ::std::os::raw::c_void,
2033 dictSize: usize,
2034 dictLoadMethod: ZSTD_dictLoadMethod_e,
2035 dictContentType: ZSTD_dictContentType_e,
2036 ) -> usize;
2037 }
2038 extern "C" {
2039 #[doc = " ZSTD_DCtx_refPrefix_advanced() :"]
2040 #[doc = " Same as ZSTD_DCtx_refPrefix(), but gives finer control over"]
2041 #[doc = " how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)"]
ZSTD_DCtx_refPrefix_advanced( dctx: *mut ZSTD_DCtx, prefix: *const ::std::os::raw::c_void, prefixSize: usize, dictContentType: ZSTD_dictContentType_e, ) -> usize2042 pub fn ZSTD_DCtx_refPrefix_advanced(
2043 dctx: *mut ZSTD_DCtx,
2044 prefix: *const ::std::os::raw::c_void,
2045 prefixSize: usize,
2046 dictContentType: ZSTD_dictContentType_e,
2047 ) -> usize;
2048 }
2049 extern "C" {
2050 #[doc = " ZSTD_DCtx_setMaxWindowSize() :"]
2051 #[doc = " Refuses allocating internal buffers for frames requiring a window size larger than provided limit."]
2052 #[doc = " This protects a decoder context from reserving too much memory for itself (potential attack scenario)."]
2053 #[doc = " This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode."]
2054 #[doc = " By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT)"]
2055 #[doc = " @return : 0, or an error code (which can be tested using ZSTD_isError())."]
ZSTD_DCtx_setMaxWindowSize( dctx: *mut ZSTD_DCtx, maxWindowSize: usize, ) -> usize2056 pub fn ZSTD_DCtx_setMaxWindowSize(
2057 dctx: *mut ZSTD_DCtx,
2058 maxWindowSize: usize,
2059 ) -> usize;
2060 }
2061 extern "C" {
2062 #[doc = " ZSTD_DCtx_setFormat() :"]
2063 #[doc = " Instruct the decoder context about what kind of data to decode next."]
2064 #[doc = " This instruction is mandatory to decode data without a fully-formed header,"]
2065 #[doc = " such ZSTD_f_zstd1_magicless for example."]
2066 #[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, ) -> usize2067 pub fn ZSTD_DCtx_setFormat(
2068 dctx: *mut ZSTD_DCtx,
2069 format: ZSTD_format_e,
2070 ) -> usize;
2071 }
2072 extern "C" {
2073 #[doc = " ZSTD_decompressStream_simpleArgs() :"]
2074 #[doc = " Same as ZSTD_decompressStream(),"]
2075 #[doc = " but using only integral types as arguments."]
2076 #[doc = " This can be helpful for binders from dynamic languages"]
2077 #[doc = " which have troubles handling structures containing memory pointers."]
ZSTD_decompressStream_simpleArgs( dctx: *mut ZSTD_DCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, dstPos: *mut usize, src: *const ::std::os::raw::c_void, srcSize: usize, srcPos: *mut usize, ) -> usize2078 pub fn ZSTD_decompressStream_simpleArgs(
2079 dctx: *mut ZSTD_DCtx,
2080 dst: *mut ::std::os::raw::c_void,
2081 dstCapacity: usize,
2082 dstPos: *mut usize,
2083 src: *const ::std::os::raw::c_void,
2084 srcSize: usize,
2085 srcPos: *mut usize,
2086 ) -> usize;
2087 }
2088 extern "C" {
2089 #[doc = " ZSTD_initCStream_srcSize() :"]
2090 #[doc = " This function is deprecated, and equivalent to:"]
2091 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2092 #[doc = " ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)"]
2093 #[doc = " ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
2094 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2095 #[doc = ""]
2096 #[doc = " pledgedSrcSize must be correct. If it is not known at init time, use"]
2097 #[doc = " ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs,"]
2098 #[doc = " \"0\" also disables frame content size field. It may be enabled in the future."]
2099 #[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, ) -> usize2100 pub fn ZSTD_initCStream_srcSize(
2101 zcs: *mut ZSTD_CStream,
2102 compressionLevel: ::std::os::raw::c_int,
2103 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2104 ) -> usize;
2105 }
2106 extern "C" {
2107 #[doc = " ZSTD_initCStream_usingDict() :"]
2108 #[doc = " This function is deprecated, and is equivalent to:"]
2109 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2110 #[doc = " ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
2111 #[doc = " ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);"]
2112 #[doc = ""]
2113 #[doc = " Creates of an internal CDict (incompatible with static CCtx), except if"]
2114 #[doc = " dict == NULL or dictSize < 8, in which case no dict is used."]
2115 #[doc = " Note: dict is loaded with ZSTD_dct_auto (treated as a full zstd dictionary if"]
2116 #[doc = " it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy."]
2117 #[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 ::std::os::raw::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize2118 pub fn ZSTD_initCStream_usingDict(
2119 zcs: *mut ZSTD_CStream,
2120 dict: *const ::std::os::raw::c_void,
2121 dictSize: usize,
2122 compressionLevel: ::std::os::raw::c_int,
2123 ) -> usize;
2124 }
2125 extern "C" {
2126 #[doc = " ZSTD_initCStream_advanced() :"]
2127 #[doc = " This function is deprecated, and is approximately equivalent to:"]
2128 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2129 #[doc = " // Pseudocode: Set each zstd parameter and leave the rest as-is."]
2130 #[doc = " for ((param, value) : params) {"]
2131 #[doc = " ZSTD_CCtx_setParameter(zcs, param, value);"]
2132 #[doc = " }"]
2133 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2134 #[doc = " ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);"]
2135 #[doc = ""]
2136 #[doc = " dict is loaded with ZSTD_dct_auto and ZSTD_dlm_byCopy."]
2137 #[doc = " pledgedSrcSize must be correct."]
2138 #[doc = " If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN."]
2139 #[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 ::std::os::raw::c_void, dictSize: usize, params: ZSTD_parameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2140 pub fn ZSTD_initCStream_advanced(
2141 zcs: *mut ZSTD_CStream,
2142 dict: *const ::std::os::raw::c_void,
2143 dictSize: usize,
2144 params: ZSTD_parameters,
2145 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2146 ) -> usize;
2147 }
2148 extern "C" {
2149 #[doc = " ZSTD_initCStream_usingCDict() :"]
2150 #[doc = " This function is deprecated, and equivalent to:"]
2151 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2152 #[doc = " ZSTD_CCtx_refCDict(zcs, cdict);"]
2153 #[doc = ""]
2154 #[doc = " note : cdict will just be referenced, and must outlive compression session"]
2155 #[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, ) -> usize2156 pub fn ZSTD_initCStream_usingCDict(
2157 zcs: *mut ZSTD_CStream,
2158 cdict: *const ZSTD_CDict,
2159 ) -> usize;
2160 }
2161 extern "C" {
2162 #[doc = " ZSTD_initCStream_usingCDict_advanced() :"]
2163 #[doc = " This function is DEPRECATED, and is approximately equivalent to:"]
2164 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2165 #[doc = " // Pseudocode: Set each zstd frame parameter and leave the rest as-is."]
2166 #[doc = " for ((fParam, value) : fParams) {"]
2167 #[doc = " ZSTD_CCtx_setParameter(zcs, fParam, value);"]
2168 #[doc = " }"]
2169 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2170 #[doc = " ZSTD_CCtx_refCDict(zcs, cdict);"]
2171 #[doc = ""]
2172 #[doc = " same as ZSTD_initCStream_usingCDict(), with control over frame parameters."]
2173 #[doc = " pledgedSrcSize must be correct. If srcSize is not known at init time, use"]
2174 #[doc = " value ZSTD_CONTENTSIZE_UNKNOWN."]
2175 #[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, ) -> usize2176 pub fn ZSTD_initCStream_usingCDict_advanced(
2177 zcs: *mut ZSTD_CStream,
2178 cdict: *const ZSTD_CDict,
2179 fParams: ZSTD_frameParameters,
2180 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2181 ) -> usize;
2182 }
2183 extern "C" {
2184 #[doc = " ZSTD_resetCStream() :"]
2185 #[doc = " This function is deprecated, and is equivalent to:"]
2186 #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
2187 #[doc = " ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);"]
2188 #[doc = ""]
2189 #[doc = " start a new frame, using same parameters from previous frame."]
2190 #[doc = " This is typically useful to skip dictionary loading stage, since it will re-use it in-place."]
2191 #[doc = " Note that zcs must be init at least once before using ZSTD_resetCStream()."]
2192 #[doc = " If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN."]
2193 #[doc = " If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end."]
2194 #[doc = " For the time being, pledgedSrcSize==0 is interpreted as \"srcSize unknown\" for compatibility with older programs,"]
2195 #[doc = " but it will change to mean \"empty\" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead."]
2196 #[doc = " @return : 0, or an error code (which can be tested using ZSTD_isError())"]
2197 #[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, ) -> usize2198 pub fn ZSTD_resetCStream(
2199 zcs: *mut ZSTD_CStream,
2200 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2201 ) -> usize;
2202 }
2203 #[repr(C)]
2204 #[derive(Debug, Copy, Clone)]
2205 pub struct ZSTD_frameProgression {
2206 pub ingested: ::std::os::raw::c_ulonglong,
2207 pub consumed: ::std::os::raw::c_ulonglong,
2208 pub produced: ::std::os::raw::c_ulonglong,
2209 pub flushed: ::std::os::raw::c_ulonglong,
2210 pub currentJobID: ::std::os::raw::c_uint,
2211 pub nbActiveWorkers: ::std::os::raw::c_uint,
2212 }
2213 #[test]
bindgen_test_layout_ZSTD_frameProgression()2214 fn bindgen_test_layout_ZSTD_frameProgression() {
2215 assert_eq!(
2216 ::core::mem::size_of::<ZSTD_frameProgression>(),
2217 40usize,
2218 concat!("Size of: ", stringify!(ZSTD_frameProgression))
2219 );
2220 assert_eq!(
2221 ::core::mem::align_of::<ZSTD_frameProgression>(),
2222 8usize,
2223 concat!("Alignment of ", stringify!(ZSTD_frameProgression))
2224 );
2225 assert_eq!(
2226 unsafe {
2227 &(*(::core::ptr::null::<ZSTD_frameProgression>())).ingested
2228 as *const _ as usize
2229 },
2230 0usize,
2231 concat!(
2232 "Offset of field: ",
2233 stringify!(ZSTD_frameProgression),
2234 "::",
2235 stringify!(ingested)
2236 )
2237 );
2238 assert_eq!(
2239 unsafe {
2240 &(*(::core::ptr::null::<ZSTD_frameProgression>())).consumed
2241 as *const _ as usize
2242 },
2243 8usize,
2244 concat!(
2245 "Offset of field: ",
2246 stringify!(ZSTD_frameProgression),
2247 "::",
2248 stringify!(consumed)
2249 )
2250 );
2251 assert_eq!(
2252 unsafe {
2253 &(*(::core::ptr::null::<ZSTD_frameProgression>())).produced
2254 as *const _ as usize
2255 },
2256 16usize,
2257 concat!(
2258 "Offset of field: ",
2259 stringify!(ZSTD_frameProgression),
2260 "::",
2261 stringify!(produced)
2262 )
2263 );
2264 assert_eq!(
2265 unsafe {
2266 &(*(::core::ptr::null::<ZSTD_frameProgression>())).flushed
2267 as *const _ as usize
2268 },
2269 24usize,
2270 concat!(
2271 "Offset of field: ",
2272 stringify!(ZSTD_frameProgression),
2273 "::",
2274 stringify!(flushed)
2275 )
2276 );
2277 assert_eq!(
2278 unsafe {
2279 &(*(::core::ptr::null::<ZSTD_frameProgression>())).currentJobID
2280 as *const _ as usize
2281 },
2282 32usize,
2283 concat!(
2284 "Offset of field: ",
2285 stringify!(ZSTD_frameProgression),
2286 "::",
2287 stringify!(currentJobID)
2288 )
2289 );
2290 assert_eq!(
2291 unsafe {
2292 &(*(::core::ptr::null::<ZSTD_frameProgression>())).nbActiveWorkers
2293 as *const _ as usize
2294 },
2295 36usize,
2296 concat!(
2297 "Offset of field: ",
2298 stringify!(ZSTD_frameProgression),
2299 "::",
2300 stringify!(nbActiveWorkers)
2301 )
2302 );
2303 }
2304 extern "C" {
ZSTD_getFrameProgression( cctx: *const ZSTD_CCtx, ) -> ZSTD_frameProgression2305 pub fn ZSTD_getFrameProgression(
2306 cctx: *const ZSTD_CCtx,
2307 ) -> ZSTD_frameProgression;
2308 }
2309 extern "C" {
2310 #[doc = " ZSTD_toFlushNow() :"]
2311 #[doc = " Tell how many bytes are ready to be flushed immediately."]
2312 #[doc = " Useful for multithreading scenarios (nbWorkers >= 1)."]
2313 #[doc = " Probe the oldest active job, defined as oldest job not yet entirely flushed,"]
2314 #[doc = " and check its output buffer."]
2315 #[doc = " @return : amount of data stored in oldest job and ready to be flushed immediately."]
2316 #[doc = " if @return == 0, it means either :"]
2317 #[doc = " + there is no active job (could be checked with ZSTD_frameProgression()), or"]
2318 #[doc = " + oldest job is still actively compressing data,"]
2319 #[doc = " but everything it has produced has also been flushed so far,"]
2320 #[doc = " therefore flush speed is limited by production speed of oldest job"]
2321 #[doc = " irrespective of the speed of concurrent (and newer) jobs."]
ZSTD_toFlushNow(cctx: *mut ZSTD_CCtx) -> usize2322 pub fn ZSTD_toFlushNow(cctx: *mut ZSTD_CCtx) -> usize;
2323 }
2324 extern "C" {
2325 #[doc = " This function is deprecated, and is equivalent to:"]
2326 #[doc = ""]
2327 #[doc = " ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);"]
2328 #[doc = " ZSTD_DCtx_loadDictionary(zds, dict, dictSize);"]
2329 #[doc = ""]
2330 #[doc = " note: no dictionary will be used if dict == NULL or dictSize < 8"]
2331 #[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 ::std::os::raw::c_void, dictSize: usize, ) -> usize2332 pub fn ZSTD_initDStream_usingDict(
2333 zds: *mut ZSTD_DStream,
2334 dict: *const ::std::os::raw::c_void,
2335 dictSize: usize,
2336 ) -> usize;
2337 }
2338 extern "C" {
2339 #[doc = " This function is deprecated, and is equivalent to:"]
2340 #[doc = ""]
2341 #[doc = " ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);"]
2342 #[doc = " ZSTD_DCtx_refDDict(zds, ddict);"]
2343 #[doc = ""]
2344 #[doc = " note : ddict is referenced, it must outlive decompression session"]
2345 #[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, ) -> usize2346 pub fn ZSTD_initDStream_usingDDict(
2347 zds: *mut ZSTD_DStream,
2348 ddict: *const ZSTD_DDict,
2349 ) -> usize;
2350 }
2351 extern "C" {
2352 #[doc = " This function is deprecated, and is equivalent to:"]
2353 #[doc = ""]
2354 #[doc = " ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);"]
2355 #[doc = ""]
2356 #[doc = " re-use decompression parameters from previous init; saves dictionary loading"]
2357 #[doc = " Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x"]
ZSTD_resetDStream(zds: *mut ZSTD_DStream) -> usize2358 pub fn ZSTD_resetDStream(zds: *mut ZSTD_DStream) -> usize;
2359 }
2360 extern "C" {
2361 #[doc = "Buffer-less streaming compression (synchronous mode)"]
2362 #[doc = ""]
2363 #[doc = "A ZSTD_CCtx object is required to track streaming operations."]
2364 #[doc = "Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource."]
2365 #[doc = "ZSTD_CCtx object can be re-used multiple times within successive compression operations."]
2366 #[doc = ""]
2367 #[doc = "Start by initializing a context."]
2368 #[doc = "Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression,"]
2369 #[doc = "or ZSTD_compressBegin_advanced(), for finer parameter control."]
2370 #[doc = "It's also possible to duplicate a reference context which has already been initialized, using ZSTD_copyCCtx()"]
2371 #[doc = ""]
2372 #[doc = "Then, consume your input using ZSTD_compressContinue()."]
2373 #[doc = "There are some important considerations to keep in mind when using this advanced function :"]
2374 #[doc = "- ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only."]
2375 #[doc = "- Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks."]
2376 #[doc = "- Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario."]
2377 #[doc = "Worst case evaluation is provided by ZSTD_compressBound()."]
2378 #[doc = "ZSTD_compressContinue() doesn't guarantee recover after a failed compression."]
2379 #[doc = "- ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog)."]
2380 #[doc = "It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks)"]
2381 #[doc = "- ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps."]
2382 #[doc = "In which case, it will \"discard\" the relevant memory section from its history."]
2383 #[doc = ""]
2384 #[doc = "Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum."]
2385 #[doc = "It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame."]
2386 #[doc = "Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders."]
2387 #[doc = ""]
2388 #[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, ) -> usize2389 pub fn ZSTD_compressBegin(
2390 cctx: *mut ZSTD_CCtx,
2391 compressionLevel: ::std::os::raw::c_int,
2392 ) -> usize;
2393 }
2394 extern "C" {
ZSTD_compressBegin_usingDict( cctx: *mut ZSTD_CCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize2395 pub fn ZSTD_compressBegin_usingDict(
2396 cctx: *mut ZSTD_CCtx,
2397 dict: *const ::std::os::raw::c_void,
2398 dictSize: usize,
2399 compressionLevel: ::std::os::raw::c_int,
2400 ) -> usize;
2401 }
2402 extern "C" {
ZSTD_compressBegin_advanced( cctx: *mut ZSTD_CCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, params: ZSTD_parameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2403 pub fn ZSTD_compressBegin_advanced(
2404 cctx: *mut ZSTD_CCtx,
2405 dict: *const ::std::os::raw::c_void,
2406 dictSize: usize,
2407 params: ZSTD_parameters,
2408 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2409 ) -> usize;
2410 }
2411 extern "C" {
ZSTD_compressBegin_usingCDict( cctx: *mut ZSTD_CCtx, cdict: *const ZSTD_CDict, ) -> usize2412 pub fn ZSTD_compressBegin_usingCDict(
2413 cctx: *mut ZSTD_CCtx,
2414 cdict: *const ZSTD_CDict,
2415 ) -> usize;
2416 }
2417 extern "C" {
ZSTD_compressBegin_usingCDict_advanced( cctx: *mut ZSTD_CCtx, cdict: *const ZSTD_CDict, fParams: ZSTD_frameParameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2418 pub fn ZSTD_compressBegin_usingCDict_advanced(
2419 cctx: *mut ZSTD_CCtx,
2420 cdict: *const ZSTD_CDict,
2421 fParams: ZSTD_frameParameters,
2422 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2423 ) -> usize;
2424 }
2425 extern "C" {
ZSTD_copyCCtx( cctx: *mut ZSTD_CCtx, preparedCCtx: *const ZSTD_CCtx, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2426 pub fn ZSTD_copyCCtx(
2427 cctx: *mut ZSTD_CCtx,
2428 preparedCCtx: *const ZSTD_CCtx,
2429 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2430 ) -> usize;
2431 }
2432 extern "C" {
ZSTD_compressContinue( cctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize2433 pub fn ZSTD_compressContinue(
2434 cctx: *mut ZSTD_CCtx,
2435 dst: *mut ::std::os::raw::c_void,
2436 dstCapacity: usize,
2437 src: *const ::std::os::raw::c_void,
2438 srcSize: usize,
2439 ) -> usize;
2440 }
2441 extern "C" {
ZSTD_compressEnd( cctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize2442 pub fn ZSTD_compressEnd(
2443 cctx: *mut ZSTD_CCtx,
2444 dst: *mut ::std::os::raw::c_void,
2445 dstCapacity: usize,
2446 src: *const ::std::os::raw::c_void,
2447 srcSize: usize,
2448 ) -> usize;
2449 }
2450 #[repr(u32)]
2451 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2452 pub enum ZSTD_frameType_e {
2453 ZSTD_frame = 0,
2454 ZSTD_skippableFrame = 1,
2455 }
2456 #[repr(C)]
2457 #[derive(Debug, Copy, Clone)]
2458 pub struct ZSTD_frameHeader {
2459 pub frameContentSize: ::std::os::raw::c_ulonglong,
2460 pub windowSize: ::std::os::raw::c_ulonglong,
2461 pub blockSizeMax: ::std::os::raw::c_uint,
2462 pub frameType: ZSTD_frameType_e,
2463 pub headerSize: ::std::os::raw::c_uint,
2464 pub dictID: ::std::os::raw::c_uint,
2465 pub checksumFlag: ::std::os::raw::c_uint,
2466 }
2467 #[test]
bindgen_test_layout_ZSTD_frameHeader()2468 fn bindgen_test_layout_ZSTD_frameHeader() {
2469 assert_eq!(
2470 ::core::mem::size_of::<ZSTD_frameHeader>(),
2471 40usize,
2472 concat!("Size of: ", stringify!(ZSTD_frameHeader))
2473 );
2474 assert_eq!(
2475 ::core::mem::align_of::<ZSTD_frameHeader>(),
2476 8usize,
2477 concat!("Alignment of ", stringify!(ZSTD_frameHeader))
2478 );
2479 assert_eq!(
2480 unsafe {
2481 &(*(::core::ptr::null::<ZSTD_frameHeader>())).frameContentSize
2482 as *const _ as usize
2483 },
2484 0usize,
2485 concat!(
2486 "Offset of field: ",
2487 stringify!(ZSTD_frameHeader),
2488 "::",
2489 stringify!(frameContentSize)
2490 )
2491 );
2492 assert_eq!(
2493 unsafe {
2494 &(*(::core::ptr::null::<ZSTD_frameHeader>())).windowSize
2495 as *const _ as usize
2496 },
2497 8usize,
2498 concat!(
2499 "Offset of field: ",
2500 stringify!(ZSTD_frameHeader),
2501 "::",
2502 stringify!(windowSize)
2503 )
2504 );
2505 assert_eq!(
2506 unsafe {
2507 &(*(::core::ptr::null::<ZSTD_frameHeader>())).blockSizeMax
2508 as *const _ as usize
2509 },
2510 16usize,
2511 concat!(
2512 "Offset of field: ",
2513 stringify!(ZSTD_frameHeader),
2514 "::",
2515 stringify!(blockSizeMax)
2516 )
2517 );
2518 assert_eq!(
2519 unsafe {
2520 &(*(::core::ptr::null::<ZSTD_frameHeader>())).frameType as *const _
2521 as usize
2522 },
2523 20usize,
2524 concat!(
2525 "Offset of field: ",
2526 stringify!(ZSTD_frameHeader),
2527 "::",
2528 stringify!(frameType)
2529 )
2530 );
2531 assert_eq!(
2532 unsafe {
2533 &(*(::core::ptr::null::<ZSTD_frameHeader>())).headerSize
2534 as *const _ as usize
2535 },
2536 24usize,
2537 concat!(
2538 "Offset of field: ",
2539 stringify!(ZSTD_frameHeader),
2540 "::",
2541 stringify!(headerSize)
2542 )
2543 );
2544 assert_eq!(
2545 unsafe {
2546 &(*(::core::ptr::null::<ZSTD_frameHeader>())).dictID as *const _
2547 as usize
2548 },
2549 28usize,
2550 concat!(
2551 "Offset of field: ",
2552 stringify!(ZSTD_frameHeader),
2553 "::",
2554 stringify!(dictID)
2555 )
2556 );
2557 assert_eq!(
2558 unsafe {
2559 &(*(::core::ptr::null::<ZSTD_frameHeader>())).checksumFlag
2560 as *const _ as usize
2561 },
2562 32usize,
2563 concat!(
2564 "Offset of field: ",
2565 stringify!(ZSTD_frameHeader),
2566 "::",
2567 stringify!(checksumFlag)
2568 )
2569 );
2570 }
2571 extern "C" {
2572 #[doc = " ZSTD_getFrameHeader() :"]
2573 #[doc = " decode Frame Header, or requires larger `srcSize`."]
2574 #[doc = " @return : 0, `zfhPtr` is correctly filled,"]
2575 #[doc = " >0, `srcSize` is too small, value is wanted `srcSize` amount,"]
2576 #[doc = " or an error code, which can be tested using ZSTD_isError()"]
ZSTD_getFrameHeader( zfhPtr: *mut ZSTD_frameHeader, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize2577 pub fn ZSTD_getFrameHeader(
2578 zfhPtr: *mut ZSTD_frameHeader,
2579 src: *const ::std::os::raw::c_void,
2580 srcSize: usize,
2581 ) -> usize;
2582 }
2583 extern "C" {
2584 #[doc = " ZSTD_getFrameHeader_advanced() :"]
2585 #[doc = " same as ZSTD_getFrameHeader(),"]
2586 #[doc = " with added capability to select a format (like ZSTD_f_zstd1_magicless)"]
ZSTD_getFrameHeader_advanced( zfhPtr: *mut ZSTD_frameHeader, src: *const ::std::os::raw::c_void, srcSize: usize, format: ZSTD_format_e, ) -> usize2587 pub fn ZSTD_getFrameHeader_advanced(
2588 zfhPtr: *mut ZSTD_frameHeader,
2589 src: *const ::std::os::raw::c_void,
2590 srcSize: usize,
2591 format: ZSTD_format_e,
2592 ) -> usize;
2593 }
2594 extern "C" {
ZSTD_decodingBufferSize_min( windowSize: ::std::os::raw::c_ulonglong, frameContentSize: ::std::os::raw::c_ulonglong, ) -> usize2595 pub fn ZSTD_decodingBufferSize_min(
2596 windowSize: ::std::os::raw::c_ulonglong,
2597 frameContentSize: ::std::os::raw::c_ulonglong,
2598 ) -> usize;
2599 }
2600 extern "C" {
ZSTD_decompressBegin(dctx: *mut ZSTD_DCtx) -> usize2601 pub fn ZSTD_decompressBegin(dctx: *mut ZSTD_DCtx) -> usize;
2602 }
2603 extern "C" {
ZSTD_decompressBegin_usingDict( dctx: *mut ZSTD_DCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, ) -> usize2604 pub fn ZSTD_decompressBegin_usingDict(
2605 dctx: *mut ZSTD_DCtx,
2606 dict: *const ::std::os::raw::c_void,
2607 dictSize: usize,
2608 ) -> usize;
2609 }
2610 extern "C" {
ZSTD_decompressBegin_usingDDict( dctx: *mut ZSTD_DCtx, ddict: *const ZSTD_DDict, ) -> usize2611 pub fn ZSTD_decompressBegin_usingDDict(
2612 dctx: *mut ZSTD_DCtx,
2613 ddict: *const ZSTD_DDict,
2614 ) -> usize;
2615 }
2616 extern "C" {
ZSTD_nextSrcSizeToDecompress(dctx: *mut ZSTD_DCtx) -> usize2617 pub fn ZSTD_nextSrcSizeToDecompress(dctx: *mut ZSTD_DCtx) -> usize;
2618 }
2619 extern "C" {
ZSTD_decompressContinue( dctx: *mut ZSTD_DCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize2620 pub fn ZSTD_decompressContinue(
2621 dctx: *mut ZSTD_DCtx,
2622 dst: *mut ::std::os::raw::c_void,
2623 dstCapacity: usize,
2624 src: *const ::std::os::raw::c_void,
2625 srcSize: usize,
2626 ) -> usize;
2627 }
2628 extern "C" {
ZSTD_copyDCtx(dctx: *mut ZSTD_DCtx, preparedDCtx: *const ZSTD_DCtx)2629 pub fn ZSTD_copyDCtx(dctx: *mut ZSTD_DCtx, preparedDCtx: *const ZSTD_DCtx);
2630 }
2631 #[repr(u32)]
2632 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2633 pub enum ZSTD_nextInputType_e {
2634 ZSTDnit_frameHeader = 0,
2635 ZSTDnit_blockHeader = 1,
2636 ZSTDnit_block = 2,
2637 ZSTDnit_lastBlock = 3,
2638 ZSTDnit_checksum = 4,
2639 ZSTDnit_skippableFrame = 5,
2640 }
2641 extern "C" {
ZSTD_nextInputType(dctx: *mut ZSTD_DCtx) -> ZSTD_nextInputType_e2642 pub fn ZSTD_nextInputType(dctx: *mut ZSTD_DCtx) -> ZSTD_nextInputType_e;
2643 }
2644 extern "C" {
2645 #[doc = "Block functions produce and decode raw zstd blocks, without frame metadata."]
2646 #[doc = "Frame metadata cost is typically ~12 bytes, which can be non-negligible for very small blocks (< 100 bytes)."]
2647 #[doc = "But users will have to take in charge needed metadata to regenerate data, such as compressed and content sizes."]
2648 #[doc = ""]
2649 #[doc = "A few rules to respect :"]
2650 #[doc = "- Compressing and decompressing require a context structure"]
2651 #[doc = "+ Use ZSTD_createCCtx() and ZSTD_createDCtx()"]
2652 #[doc = "- It is necessary to init context before starting"]
2653 #[doc = "+ compression : any ZSTD_compressBegin*() variant, including with dictionary"]
2654 #[doc = "+ decompression : any ZSTD_decompressBegin*() variant, including with dictionary"]
2655 #[doc = "+ copyCCtx() and copyDCtx() can be used too"]
2656 #[doc = "- Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB"]
2657 #[doc = "+ If input is larger than a block size, it's necessary to split input data into multiple blocks"]
2658 #[doc = "+ For inputs larger than a single block, consider using regular ZSTD_compress() instead."]
2659 #[doc = "Frame metadata is not that costly, and quickly becomes negligible as source size grows larger than a block."]
2660 #[doc = "- When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero) !"]
2661 #[doc = "===> In which case, nothing is produced into `dst` !"]
2662 #[doc = "+ User __must__ test for such outcome and deal directly with uncompressed data"]
2663 #[doc = "+ A block cannot be declared incompressible if ZSTD_compressBlock() return value was != 0."]
2664 #[doc = "Doing so would mess up with statistics history, leading to potential data corruption."]
2665 #[doc = "+ ZSTD_decompressBlock() _doesn't accept uncompressed data as input_ !!"]
2666 #[doc = "+ In case of multiple successive blocks, should some of them be uncompressed,"]
2667 #[doc = "decoder must be informed of their existence in order to follow proper history."]
2668 #[doc = "Use ZSTD_insertBlock() for such a case."]
ZSTD_getBlockSize(cctx: *const ZSTD_CCtx) -> usize2669 pub fn ZSTD_getBlockSize(cctx: *const ZSTD_CCtx) -> usize;
2670 }
2671 extern "C" {
ZSTD_compressBlock( cctx: *mut ZSTD_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize2672 pub fn ZSTD_compressBlock(
2673 cctx: *mut ZSTD_CCtx,
2674 dst: *mut ::std::os::raw::c_void,
2675 dstCapacity: usize,
2676 src: *const ::std::os::raw::c_void,
2677 srcSize: usize,
2678 ) -> usize;
2679 }
2680 extern "C" {
ZSTD_decompressBlock( dctx: *mut ZSTD_DCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, ) -> usize2681 pub fn ZSTD_decompressBlock(
2682 dctx: *mut ZSTD_DCtx,
2683 dst: *mut ::std::os::raw::c_void,
2684 dstCapacity: usize,
2685 src: *const ::std::os::raw::c_void,
2686 srcSize: usize,
2687 ) -> usize;
2688 }
2689 extern "C" {
ZSTD_insertBlock( dctx: *mut ZSTD_DCtx, blockStart: *const ::std::os::raw::c_void, blockSize: usize, ) -> usize2690 pub fn ZSTD_insertBlock(
2691 dctx: *mut ZSTD_DCtx,
2692 blockStart: *const ::std::os::raw::c_void,
2693 blockSize: usize,
2694 ) -> usize;
2695 }
2696 extern "C" {
2697 #[doc = " ZDICT_trainFromBuffer():"]
2698 #[doc = " Train a dictionary from an array of samples."]
2699 #[doc = " Redirect towards ZDICT_optimizeTrainFromBuffer_fastCover() single-threaded, with d=8, steps=4,"]
2700 #[doc = " f=20, and accel=1."]
2701 #[doc = " Samples must be stored concatenated in a single flat buffer `samplesBuffer`,"]
2702 #[doc = " supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order."]
2703 #[doc = " The resulting dictionary will be saved into `dictBuffer`."]
2704 #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
2705 #[doc = " or an error code, which can be tested with ZDICT_isError()."]
2706 #[doc = " Note: Dictionary training will fail if there are not enough samples to construct a"]
2707 #[doc = " dictionary, or if most of the samples are too small (< 8 bytes being the lower limit)."]
2708 #[doc = " If dictionary training fails, you should use zstd without a dictionary, as the dictionary"]
2709 #[doc = " would've been ineffective anyways. If you believe your samples would benefit from a dictionary"]
2710 #[doc = " please open an issue with details, and we can look into it."]
2711 #[doc = " Note: ZDICT_trainFromBuffer()'s memory usage is about 6 MB."]
2712 #[doc = " Tips: In general, a reasonable dictionary has a size of ~ 100 KB."]
2713 #[doc = " It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`."]
2714 #[doc = " In general, it's recommended to provide a few thousands samples, though this can vary a lot."]
2715 #[doc = " It's recommended that total size of all samples be about ~x100 times the target size of dictionary."]
ZDICT_trainFromBuffer( dictBuffer: *mut ::std::os::raw::c_void, dictBufferCapacity: usize, samplesBuffer: *const ::std::os::raw::c_void, samplesSizes: *const usize, nbSamples: ::std::os::raw::c_uint, ) -> usize2716 pub fn ZDICT_trainFromBuffer(
2717 dictBuffer: *mut ::std::os::raw::c_void,
2718 dictBufferCapacity: usize,
2719 samplesBuffer: *const ::std::os::raw::c_void,
2720 samplesSizes: *const usize,
2721 nbSamples: ::std::os::raw::c_uint,
2722 ) -> usize;
2723 }
2724 extern "C" {
ZDICT_getDictID( dictBuffer: *const ::std::os::raw::c_void, dictSize: usize, ) -> ::std::os::raw::c_uint2725 pub fn ZDICT_getDictID(
2726 dictBuffer: *const ::std::os::raw::c_void,
2727 dictSize: usize,
2728 ) -> ::std::os::raw::c_uint;
2729 }
2730 extern "C" {
ZDICT_isError(errorCode: usize) -> ::std::os::raw::c_uint2731 pub fn ZDICT_isError(errorCode: usize) -> ::std::os::raw::c_uint;
2732 }
2733 extern "C" {
ZDICT_getErrorName( errorCode: usize, ) -> *const ::std::os::raw::c_char2734 pub fn ZDICT_getErrorName(
2735 errorCode: usize,
2736 ) -> *const ::std::os::raw::c_char;
2737 }
2738 #[repr(C)]
2739 #[derive(Debug, Copy, Clone)]
2740 pub struct ZSTDMT_CCtx_s {
2741 _unused: [u8; 0],
2742 }
2743 pub type ZSTDMT_CCtx = ZSTDMT_CCtx_s;
2744 extern "C" {
ZSTDMT_createCCtx( nbWorkers: ::std::os::raw::c_uint, ) -> *mut ZSTDMT_CCtx2745 pub fn ZSTDMT_createCCtx(
2746 nbWorkers: ::std::os::raw::c_uint,
2747 ) -> *mut ZSTDMT_CCtx;
2748 }
2749 extern "C" {
ZSTDMT_createCCtx_advanced( nbWorkers: ::std::os::raw::c_uint, cMem: ZSTD_customMem, ) -> *mut ZSTDMT_CCtx2750 pub fn ZSTDMT_createCCtx_advanced(
2751 nbWorkers: ::std::os::raw::c_uint,
2752 cMem: ZSTD_customMem,
2753 ) -> *mut ZSTDMT_CCtx;
2754 }
2755 extern "C" {
ZSTDMT_freeCCtx(mtctx: *mut ZSTDMT_CCtx) -> usize2756 pub fn ZSTDMT_freeCCtx(mtctx: *mut ZSTDMT_CCtx) -> usize;
2757 }
2758 extern "C" {
ZSTDMT_sizeof_CCtx(mtctx: *mut ZSTDMT_CCtx) -> usize2759 pub fn ZSTDMT_sizeof_CCtx(mtctx: *mut ZSTDMT_CCtx) -> usize;
2760 }
2761 extern "C" {
ZSTDMT_compressCCtx( mtctx: *mut ZSTDMT_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, compressionLevel: ::std::os::raw::c_int, ) -> usize2762 pub fn ZSTDMT_compressCCtx(
2763 mtctx: *mut ZSTDMT_CCtx,
2764 dst: *mut ::std::os::raw::c_void,
2765 dstCapacity: usize,
2766 src: *const ::std::os::raw::c_void,
2767 srcSize: usize,
2768 compressionLevel: ::std::os::raw::c_int,
2769 ) -> usize;
2770 }
2771 extern "C" {
ZSTDMT_initCStream( mtctx: *mut ZSTDMT_CCtx, compressionLevel: ::std::os::raw::c_int, ) -> usize2772 pub fn ZSTDMT_initCStream(
2773 mtctx: *mut ZSTDMT_CCtx,
2774 compressionLevel: ::std::os::raw::c_int,
2775 ) -> usize;
2776 }
2777 extern "C" {
ZSTDMT_resetCStream( mtctx: *mut ZSTDMT_CCtx, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2778 pub fn ZSTDMT_resetCStream(
2779 mtctx: *mut ZSTDMT_CCtx,
2780 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2781 ) -> usize;
2782 }
2783 extern "C" {
ZSTDMT_nextInputSizeHint(mtctx: *const ZSTDMT_CCtx) -> usize2784 pub fn ZSTDMT_nextInputSizeHint(mtctx: *const ZSTDMT_CCtx) -> usize;
2785 }
2786 extern "C" {
ZSTDMT_compressStream( mtctx: *mut ZSTDMT_CCtx, output: *mut ZSTD_outBuffer, input: *mut ZSTD_inBuffer, ) -> usize2787 pub fn ZSTDMT_compressStream(
2788 mtctx: *mut ZSTDMT_CCtx,
2789 output: *mut ZSTD_outBuffer,
2790 input: *mut ZSTD_inBuffer,
2791 ) -> usize;
2792 }
2793 extern "C" {
ZSTDMT_flushStream( mtctx: *mut ZSTDMT_CCtx, output: *mut ZSTD_outBuffer, ) -> usize2794 pub fn ZSTDMT_flushStream(
2795 mtctx: *mut ZSTDMT_CCtx,
2796 output: *mut ZSTD_outBuffer,
2797 ) -> usize;
2798 }
2799 extern "C" {
ZSTDMT_endStream( mtctx: *mut ZSTDMT_CCtx, output: *mut ZSTD_outBuffer, ) -> usize2800 pub fn ZSTDMT_endStream(
2801 mtctx: *mut ZSTDMT_CCtx,
2802 output: *mut ZSTD_outBuffer,
2803 ) -> usize;
2804 }
2805 extern "C" {
ZSTDMT_compress_advanced( mtctx: *mut ZSTDMT_CCtx, dst: *mut ::std::os::raw::c_void, dstCapacity: usize, src: *const ::std::os::raw::c_void, srcSize: usize, cdict: *const ZSTD_CDict, params: ZSTD_parameters, overlapLog: ::std::os::raw::c_int, ) -> usize2806 pub fn ZSTDMT_compress_advanced(
2807 mtctx: *mut ZSTDMT_CCtx,
2808 dst: *mut ::std::os::raw::c_void,
2809 dstCapacity: usize,
2810 src: *const ::std::os::raw::c_void,
2811 srcSize: usize,
2812 cdict: *const ZSTD_CDict,
2813 params: ZSTD_parameters,
2814 overlapLog: ::std::os::raw::c_int,
2815 ) -> usize;
2816 }
2817 extern "C" {
ZSTDMT_initCStream_advanced( mtctx: *mut ZSTDMT_CCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, params: ZSTD_parameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2818 pub fn ZSTDMT_initCStream_advanced(
2819 mtctx: *mut ZSTDMT_CCtx,
2820 dict: *const ::std::os::raw::c_void,
2821 dictSize: usize,
2822 params: ZSTD_parameters,
2823 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2824 ) -> usize;
2825 }
2826 extern "C" {
ZSTDMT_initCStream_usingCDict( mtctx: *mut ZSTDMT_CCtx, cdict: *const ZSTD_CDict, fparams: ZSTD_frameParameters, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2827 pub fn ZSTDMT_initCStream_usingCDict(
2828 mtctx: *mut ZSTDMT_CCtx,
2829 cdict: *const ZSTD_CDict,
2830 fparams: ZSTD_frameParameters,
2831 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2832 ) -> usize;
2833 }
2834 #[repr(u32)]
2835 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2836 pub enum ZSTDMT_parameter {
2837 ZSTDMT_p_jobSize = 0,
2838 ZSTDMT_p_overlapLog = 1,
2839 ZSTDMT_p_rsyncable = 2,
2840 }
2841 extern "C" {
ZSTDMT_setMTCtxParameter( mtctx: *mut ZSTDMT_CCtx, parameter: ZSTDMT_parameter, value: ::std::os::raw::c_int, ) -> usize2842 pub fn ZSTDMT_setMTCtxParameter(
2843 mtctx: *mut ZSTDMT_CCtx,
2844 parameter: ZSTDMT_parameter,
2845 value: ::std::os::raw::c_int,
2846 ) -> usize;
2847 }
2848 extern "C" {
ZSTDMT_getMTCtxParameter( mtctx: *mut ZSTDMT_CCtx, parameter: ZSTDMT_parameter, value: *mut ::std::os::raw::c_int, ) -> usize2849 pub fn ZSTDMT_getMTCtxParameter(
2850 mtctx: *mut ZSTDMT_CCtx,
2851 parameter: ZSTDMT_parameter,
2852 value: *mut ::std::os::raw::c_int,
2853 ) -> usize;
2854 }
2855 extern "C" {
2856 #[doc = " ZSTDMT_compressStream_generic() :"]
2857 #[doc = " Combines ZSTDMT_compressStream() with optional ZSTDMT_flushStream() or ZSTDMT_endStream()"]
2858 #[doc = " depending on flush directive."]
2859 #[doc = " @return : minimum amount of data still to be flushed"]
2860 #[doc = " 0 if fully flushed"]
2861 #[doc = " or an error code"]
2862 #[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, ) -> usize2863 pub fn ZSTDMT_compressStream_generic(
2864 mtctx: *mut ZSTDMT_CCtx,
2865 output: *mut ZSTD_outBuffer,
2866 input: *mut ZSTD_inBuffer,
2867 endOp: ZSTD_EndDirective,
2868 ) -> usize;
2869 }
2870 extern "C" {
2871 #[doc = " ZSTDMT_toFlushNow()"]
2872 #[doc = " Tell how many bytes are ready to be flushed immediately."]
2873 #[doc = " Probe the oldest active job (not yet entirely flushed) and check its output buffer."]
2874 #[doc = " If return 0, it means there is no active job,"]
2875 #[doc = " or, it means oldest job is still active, but everything produced has been flushed so far,"]
2876 #[doc = " therefore flushing is limited by speed of oldest job."]
ZSTDMT_toFlushNow(mtctx: *mut ZSTDMT_CCtx) -> usize2877 pub fn ZSTDMT_toFlushNow(mtctx: *mut ZSTDMT_CCtx) -> usize;
2878 }
2879 extern "C" {
2880 #[doc = " ZSTDMT_CCtxParam_setMTCtxParameter()"]
2881 #[doc = " like ZSTDMT_setMTCtxParameter(), but into a ZSTD_CCtx_Params"]
ZSTDMT_CCtxParam_setMTCtxParameter( params: *mut ZSTD_CCtx_params, parameter: ZSTDMT_parameter, value: ::std::os::raw::c_int, ) -> usize2882 pub fn ZSTDMT_CCtxParam_setMTCtxParameter(
2883 params: *mut ZSTD_CCtx_params,
2884 parameter: ZSTDMT_parameter,
2885 value: ::std::os::raw::c_int,
2886 ) -> usize;
2887 }
2888 extern "C" {
2889 #[doc = " ZSTDMT_CCtxParam_setNbWorkers()"]
2890 #[doc = " Set nbWorkers, and clamp it."]
2891 #[doc = " Also reset jobSize and overlapLog"]
ZSTDMT_CCtxParam_setNbWorkers( params: *mut ZSTD_CCtx_params, nbWorkers: ::std::os::raw::c_uint, ) -> usize2892 pub fn ZSTDMT_CCtxParam_setNbWorkers(
2893 params: *mut ZSTD_CCtx_params,
2894 nbWorkers: ::std::os::raw::c_uint,
2895 ) -> usize;
2896 }
2897 extern "C" {
2898 #[doc = " ZSTDMT_updateCParams_whileCompressing() :"]
2899 #[doc = " Updates only a selected set of compression parameters, to remain compatible with current frame."]
2900 #[doc = " New parameters will be applied to next compression job."]
ZSTDMT_updateCParams_whileCompressing( mtctx: *mut ZSTDMT_CCtx, cctxParams: *const ZSTD_CCtx_params, )2901 pub fn ZSTDMT_updateCParams_whileCompressing(
2902 mtctx: *mut ZSTDMT_CCtx,
2903 cctxParams: *const ZSTD_CCtx_params,
2904 );
2905 }
2906 extern "C" {
2907 #[doc = " ZSTDMT_getFrameProgression():"]
2908 #[doc = " tells how much data has been consumed (input) and produced (output) for current frame."]
2909 #[doc = " able to count progression inside worker threads."]
ZSTDMT_getFrameProgression( mtctx: *mut ZSTDMT_CCtx, ) -> ZSTD_frameProgression2910 pub fn ZSTDMT_getFrameProgression(
2911 mtctx: *mut ZSTDMT_CCtx,
2912 ) -> ZSTD_frameProgression;
2913 }
2914 extern "C" {
2915 #[doc = " ZSTDMT_initCStream_internal() :"]
2916 #[doc = " Private use only. Init streaming operation."]
2917 #[doc = " expects params to be valid."]
2918 #[doc = " must receive dict, or cdict, or none, but not both."]
2919 #[doc = " @return : 0, or an error code"]
ZSTDMT_initCStream_internal( zcs: *mut ZSTDMT_CCtx, dict: *const ::std::os::raw::c_void, dictSize: usize, dictContentType: ZSTD_dictContentType_e, cdict: *const ZSTD_CDict, params: ZSTD_CCtx_params, pledgedSrcSize: ::std::os::raw::c_ulonglong, ) -> usize2920 pub fn ZSTDMT_initCStream_internal(
2921 zcs: *mut ZSTDMT_CCtx,
2922 dict: *const ::std::os::raw::c_void,
2923 dictSize: usize,
2924 dictContentType: ZSTD_dictContentType_e,
2925 cdict: *const ZSTD_CDict,
2926 params: ZSTD_CCtx_params,
2927 pledgedSrcSize: ::std::os::raw::c_ulonglong,
2928 ) -> usize;
2929 }
2930