blosc2_src/
bindings.rs

1/* automatically generated by rust-bindgen 0.65.1 */
2
3pub const BLOSC2_VERSION_MAJOR: u32 = 2;
4pub const BLOSC2_VERSION_MINOR: u32 = 11;
5pub const BLOSC2_VERSION_RELEASE: u32 = 0;
6pub const BLOSC2_VERSION_STRING: &[u8; 7usize] = b"2.11.0\0";
7pub const BLOSC2_VERSION_DATE: &[u8; 22usize] = b"$Date:: 2023-11-04 #$\0";
8pub const BLOSC2_MAX_DIM: u32 = 8;
9pub const BLOSC_BLOSCLZ_COMPNAME: &[u8; 8usize] = b"blosclz\0";
10pub const BLOSC_LZ4_COMPNAME: &[u8; 4usize] = b"lz4\0";
11pub const BLOSC_LZ4HC_COMPNAME: &[u8; 6usize] = b"lz4hc\0";
12pub const BLOSC_ZLIB_COMPNAME: &[u8; 5usize] = b"zlib\0";
13pub const BLOSC_ZSTD_COMPNAME: &[u8; 5usize] = b"zstd\0";
14pub const BLOSC_BLOSCLZ_LIBNAME: &[u8; 8usize] = b"BloscLZ\0";
15pub const BLOSC_LZ4_LIBNAME: &[u8; 4usize] = b"LZ4\0";
16pub const BLOSC_ZLIB_LIBNAME: &[u8; 5usize] = b"Zlib\0";
17pub const BLOSC_ZSTD_LIBNAME: &[u8; 5usize] = b"Zstd\0";
18pub const BLOSC2_MAX_METALAYERS: u32 = 16;
19pub const BLOSC2_METALAYER_NAME_MAXLEN: u32 = 31;
20pub const BLOSC2_MAX_VLMETALAYERS: u32 = 8192;
21pub const BLOSC2_VLMETALAYERS_NAME_MAXLEN: u32 = 31;
22
23#[repr(C)]
24#[derive(Debug, Copy, Clone)]
25pub struct blosc2_stdio_file {
26    pub file: *mut FILE,
27}
28#[test]
29fn bindgen_test_layout_blosc2_stdio_file() {
30    const UNINIT: ::std::mem::MaybeUninit<blosc2_stdio_file> = ::std::mem::MaybeUninit::uninit();
31    let ptr = UNINIT.as_ptr();
32    assert_eq!(
33        ::std::mem::size_of::<blosc2_stdio_file>(),
34        8usize,
35        concat!("Size of: ", stringify!(blosc2_stdio_file))
36    );
37    assert_eq!(
38        ::std::mem::align_of::<blosc2_stdio_file>(),
39        8usize,
40        concat!("Alignment of ", stringify!(blosc2_stdio_file))
41    );
42    assert_eq!(
43        unsafe { ::std::ptr::addr_of!((*ptr).file) as usize - ptr as usize },
44        0usize,
45        concat!(
46            "Offset of field: ",
47            stringify!(blosc2_stdio_file),
48            "::",
49            stringify!(file)
50        )
51    );
52}
53extern "C" {
54    pub fn blosc2_stdio_open(
55        urlpath: *const ::std::os::raw::c_char,
56        mode: *const ::std::os::raw::c_char,
57        params: *mut ::std::os::raw::c_void,
58    ) -> *mut ::std::os::raw::c_void;
59}
60extern "C" {
61    pub fn blosc2_stdio_close(stream: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
62}
63extern "C" {
64    pub fn blosc2_stdio_tell(stream: *mut ::std::os::raw::c_void) -> i64;
65}
66extern "C" {
67    pub fn blosc2_stdio_seek(
68        stream: *mut ::std::os::raw::c_void,
69        offset: i64,
70        whence: ::std::os::raw::c_int,
71    ) -> ::std::os::raw::c_int;
72}
73extern "C" {
74    pub fn blosc2_stdio_write(
75        ptr: *const ::std::os::raw::c_void,
76        size: i64,
77        nitems: i64,
78        stream: *mut ::std::os::raw::c_void,
79    ) -> i64;
80}
81extern "C" {
82    pub fn blosc2_stdio_read(
83        ptr: *mut ::std::os::raw::c_void,
84        size: i64,
85        nitems: i64,
86        stream: *mut ::std::os::raw::c_void,
87    ) -> i64;
88}
89extern "C" {
90    pub fn blosc2_stdio_truncate(
91        stream: *mut ::std::os::raw::c_void,
92        size: i64,
93    ) -> ::std::os::raw::c_int;
94}
95
96#[cfg(windows)]
97pub type blosc_timestamp_t = LARGE_INTEGER;
98#[cfg(not(windows))]
99pub type blosc_timestamp_t = timespec;
100
101pub const BLOSC1_VERSION_FORMAT_PRE1: _bindgen_ty_4 = 1;
102pub const BLOSC1_VERSION_FORMAT: _bindgen_ty_4 = 2;
103pub const BLOSC2_VERSION_FORMAT_ALPHA: _bindgen_ty_4 = 3;
104pub const BLOSC2_VERSION_FORMAT_BETA1: _bindgen_ty_4 = 4;
105pub const BLOSC2_VERSION_FORMAT_STABLE: _bindgen_ty_4 = 5;
106pub const BLOSC2_VERSION_FORMAT: _bindgen_ty_4 = 5;
107pub type _bindgen_ty_4 = ::std::os::raw::c_int;
108pub const BLOSC2_VERSION_FRAME_FORMAT_BETA2: _bindgen_ty_5 = 1;
109pub const BLOSC2_VERSION_FRAME_FORMAT_RC1: _bindgen_ty_5 = 2;
110pub const BLOSC2_VERSION_FRAME_FORMAT: _bindgen_ty_5 = 2;
111pub type _bindgen_ty_5 = ::std::os::raw::c_int;
112#[repr(C)]
113#[derive(Debug, Copy, Clone)]
114pub struct blosc2_instr {
115    pub cratio: f32,
116    pub cspeed: f32,
117    pub filter_speed: f32,
118    pub flags: [u8; 4usize],
119}
120#[test]
121fn bindgen_test_layout_blosc2_instr() {
122    const UNINIT: ::std::mem::MaybeUninit<blosc2_instr> = ::std::mem::MaybeUninit::uninit();
123    let ptr = UNINIT.as_ptr();
124    assert_eq!(
125        ::std::mem::size_of::<blosc2_instr>(),
126        16usize,
127        concat!("Size of: ", stringify!(blosc2_instr))
128    );
129    assert_eq!(
130        ::std::mem::align_of::<blosc2_instr>(),
131        4usize,
132        concat!("Alignment of ", stringify!(blosc2_instr))
133    );
134    assert_eq!(
135        unsafe { ::std::ptr::addr_of!((*ptr).cratio) as usize - ptr as usize },
136        0usize,
137        concat!(
138            "Offset of field: ",
139            stringify!(blosc2_instr),
140            "::",
141            stringify!(cratio)
142        )
143    );
144    assert_eq!(
145        unsafe { ::std::ptr::addr_of!((*ptr).cspeed) as usize - ptr as usize },
146        4usize,
147        concat!(
148            "Offset of field: ",
149            stringify!(blosc2_instr),
150            "::",
151            stringify!(cspeed)
152        )
153    );
154    assert_eq!(
155        unsafe { ::std::ptr::addr_of!((*ptr).filter_speed) as usize - ptr as usize },
156        8usize,
157        concat!(
158            "Offset of field: ",
159            stringify!(blosc2_instr),
160            "::",
161            stringify!(filter_speed)
162        )
163    );
164    assert_eq!(
165        unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
166        12usize,
167        concat!(
168            "Offset of field: ",
169            stringify!(blosc2_instr),
170            "::",
171            stringify!(flags)
172        )
173    );
174}
175pub const BLOSC_MIN_HEADER_LENGTH: _bindgen_ty_6 = 16;
176pub const BLOSC_EXTENDED_HEADER_LENGTH: _bindgen_ty_6 = 32;
177pub const BLOSC2_MAX_OVERHEAD: _bindgen_ty_6 = 32;
178pub const BLOSC2_MAX_BUFFERSIZE: _bindgen_ty_6 = 2147483615;
179pub const BLOSC_MAX_TYPESIZE: _bindgen_ty_6 = 255;
180pub const BLOSC_MIN_BUFFERSIZE: _bindgen_ty_6 = 32;
181pub type _bindgen_ty_6 = ::std::os::raw::c_int;
182pub const BLOSC2_DEFINED_TUNER_START: _bindgen_ty_7 = 0;
183pub const BLOSC2_DEFINED_TUNER_STOP: _bindgen_ty_7 = 31;
184pub const BLOSC2_GLOBAL_REGISTERED_TUNER_START: _bindgen_ty_7 = 32;
185pub const BLOSC2_GLOBAL_REGISTERED_TUNER_STOP: _bindgen_ty_7 = 159;
186pub const BLOSC2_GLOBAL_REGISTERED_TUNERS: _bindgen_ty_7 = 0;
187pub const BLOSC2_USER_REGISTERED_TUNER_START: _bindgen_ty_7 = 160;
188pub const BLOSC2_USER_REGISTERED_TUNER_STOP: _bindgen_ty_7 = 255;
189pub type _bindgen_ty_7 = ::std::os::raw::c_int;
190pub const BLOSC_STUNE: _bindgen_ty_8 = 0;
191pub const BLOSC_LAST_TUNER: _bindgen_ty_8 = 1;
192pub const BLOSC_LAST_REGISTERED_TUNE: _bindgen_ty_8 = 31;
193#[doc = " @brief Codes for the different tuners shipped with Blosc"]
194pub type _bindgen_ty_8 = ::std::os::raw::c_int;
195pub const BLOSC2_DEFINED_FILTERS_START: _bindgen_ty_9 = 0;
196pub const BLOSC2_DEFINED_FILTERS_STOP: _bindgen_ty_9 = 31;
197pub const BLOSC2_GLOBAL_REGISTERED_FILTERS_START: _bindgen_ty_9 = 32;
198pub const BLOSC2_GLOBAL_REGISTERED_FILTERS_STOP: _bindgen_ty_9 = 159;
199pub const BLOSC2_GLOBAL_REGISTERED_FILTERS: _bindgen_ty_9 = 4;
200pub const BLOSC2_USER_REGISTERED_FILTERS_START: _bindgen_ty_9 = 160;
201pub const BLOSC2_USER_REGISTERED_FILTERS_STOP: _bindgen_ty_9 = 255;
202pub const BLOSC2_MAX_FILTERS: _bindgen_ty_9 = 6;
203pub const BLOSC2_MAX_UDFILTERS: _bindgen_ty_9 = 16;
204pub type _bindgen_ty_9 = ::std::os::raw::c_int;
205#[doc = "!< No shuffle (for compatibility with Blosc1)."]
206pub const BLOSC_NOSHUFFLE: _bindgen_ty_10 = 0;
207#[doc = "!< No filter."]
208pub const BLOSC_NOFILTER: _bindgen_ty_10 = 0;
209#[doc = "!< Byte-wise shuffle."]
210pub const BLOSC_SHUFFLE: _bindgen_ty_10 = 1;
211#[doc = "!< Bit-wise shuffle."]
212pub const BLOSC_BITSHUFFLE: _bindgen_ty_10 = 2;
213#[doc = "!< Delta filter."]
214pub const BLOSC_DELTA: _bindgen_ty_10 = 3;
215#[doc = "!< Truncate mantissa precision; positive values in cparams.filters_meta will keep bits; negative values will reduce bits."]
216pub const BLOSC_TRUNC_PREC: _bindgen_ty_10 = 4;
217#[doc = "!< sentinel"]
218pub const BLOSC_LAST_FILTER: _bindgen_ty_10 = 5;
219pub const BLOSC_LAST_REGISTERED_FILTER: _bindgen_ty_10 = 35;
220#[doc = " @brief Codes for filters.\n\n @sa #blosc1_compress"]
221pub type _bindgen_ty_10 = ::std::os::raw::c_int;
222#[doc = "!< byte-wise shuffle"]
223pub const BLOSC_DOSHUFFLE: _bindgen_ty_11 = 1;
224#[doc = "!< plain copy"]
225pub const BLOSC_MEMCPYED: _bindgen_ty_11 = 2;
226#[doc = "!< bit-wise shuffle"]
227pub const BLOSC_DOBITSHUFFLE: _bindgen_ty_11 = 4;
228#[doc = "!< delta coding"]
229pub const BLOSC_DODELTA: _bindgen_ty_11 = 8;
230#[doc = " @brief Codes for internal flags (see blosc1_cbuffer_metainfo)"]
231pub type _bindgen_ty_11 = ::std::os::raw::c_int;
232#[doc = "!< use dictionaries with codec"]
233pub const BLOSC2_USEDICT: _bindgen_ty_12 = 1;
234#[doc = "!< data is in big-endian ordering"]
235pub const BLOSC2_BIGENDIAN: _bindgen_ty_12 = 2;
236#[doc = "!< codec is instrumented (mainly for development)"]
237pub const BLOSC2_INSTR_CODEC: _bindgen_ty_12 = 128;
238#[doc = " @brief Codes for new internal flags in Blosc2"]
239pub type _bindgen_ty_12 = ::std::os::raw::c_int;
240#[doc = "!< maximum size for compression dicts"]
241pub const BLOSC2_MAXDICTSIZE: _bindgen_ty_13 = 131072;
242#[doc = "!< maximum size for blocks"]
243pub const BLOSC2_MAXBLOCKSIZE: _bindgen_ty_13 = 536866816;
244#[doc = " @brief Values for different Blosc2 capabilities"]
245pub type _bindgen_ty_13 = ::std::os::raw::c_int;
246pub const BLOSC2_DEFINED_CODECS_START: _bindgen_ty_14 = 0;
247pub const BLOSC2_DEFINED_CODECS_STOP: _bindgen_ty_14 = 31;
248pub const BLOSC2_GLOBAL_REGISTERED_CODECS_START: _bindgen_ty_14 = 32;
249pub const BLOSC2_GLOBAL_REGISTERED_CODECS_STOP: _bindgen_ty_14 = 159;
250pub const BLOSC2_GLOBAL_REGISTERED_CODECS: _bindgen_ty_14 = 5;
251pub const BLOSC2_USER_REGISTERED_CODECS_START: _bindgen_ty_14 = 160;
252pub const BLOSC2_USER_REGISTERED_CODECS_STOP: _bindgen_ty_14 = 255;
253pub type _bindgen_ty_14 = ::std::os::raw::c_int;
254pub const BLOSC_BLOSCLZ: _bindgen_ty_15 = 0;
255pub const BLOSC_LZ4: _bindgen_ty_15 = 1;
256pub const BLOSC_LZ4HC: _bindgen_ty_15 = 2;
257pub const BLOSC_ZLIB: _bindgen_ty_15 = 4;
258pub const BLOSC_ZSTD: _bindgen_ty_15 = 5;
259pub const BLOSC_LAST_CODEC: _bindgen_ty_15 = 6;
260pub const BLOSC_LAST_REGISTERED_CODEC: _bindgen_ty_15 = 36;
261#[doc = " @brief Codes for the different compressors shipped with Blosc"]
262pub type _bindgen_ty_15 = ::std::os::raw::c_int;
263pub const BLOSC_BLOSCLZ_LIB: _bindgen_ty_16 = 0;
264pub const BLOSC_LZ4_LIB: _bindgen_ty_16 = 1;
265pub const BLOSC_ZLIB_LIB: _bindgen_ty_16 = 3;
266pub const BLOSC_ZSTD_LIB: _bindgen_ty_16 = 4;
267pub const BLOSC_UDCODEC_LIB: _bindgen_ty_16 = 6;
268#[doc = "!< compressor library in super-chunk header"]
269pub const BLOSC_SCHUNK_LIB: _bindgen_ty_16 = 7;
270#[doc = " @brief Codes for compression libraries shipped with Blosc (code must be < 8)"]
271pub type _bindgen_ty_16 = ::std::os::raw::c_int;
272pub const BLOSC_BLOSCLZ_FORMAT: _bindgen_ty_17 = 0;
273pub const BLOSC_LZ4_FORMAT: _bindgen_ty_17 = 1;
274pub const BLOSC_LZ4HC_FORMAT: _bindgen_ty_17 = 1;
275pub const BLOSC_ZLIB_FORMAT: _bindgen_ty_17 = 3;
276pub const BLOSC_ZSTD_FORMAT: _bindgen_ty_17 = 4;
277pub const BLOSC_UDCODEC_FORMAT: _bindgen_ty_17 = 6;
278#[doc = " @brief The codes for compressor formats shipped with Blosc"]
279pub type _bindgen_ty_17 = ::std::os::raw::c_int;
280pub const BLOSC_BLOSCLZ_VERSION_FORMAT: _bindgen_ty_18 = 1;
281pub const BLOSC_LZ4_VERSION_FORMAT: _bindgen_ty_18 = 1;
282pub const BLOSC_LZ4HC_VERSION_FORMAT: _bindgen_ty_18 = 1;
283pub const BLOSC_ZLIB_VERSION_FORMAT: _bindgen_ty_18 = 1;
284pub const BLOSC_ZSTD_VERSION_FORMAT: _bindgen_ty_18 = 1;
285pub const BLOSC_UDCODEC_VERSION_FORMAT: _bindgen_ty_18 = 1;
286#[doc = " @brief The version formats for compressors shipped with Blosc.\n All versions here starts at 1"]
287pub type _bindgen_ty_18 = ::std::os::raw::c_int;
288pub const BLOSC_ALWAYS_SPLIT: _bindgen_ty_19 = 1;
289pub const BLOSC_NEVER_SPLIT: _bindgen_ty_19 = 2;
290pub const BLOSC_AUTO_SPLIT: _bindgen_ty_19 = 3;
291pub const BLOSC_FORWARD_COMPAT_SPLIT: _bindgen_ty_19 = 4;
292pub type _bindgen_ty_19 = ::std::os::raw::c_int;
293#[doc = "!< the version for the chunk format"]
294pub const BLOSC2_CHUNK_VERSION: _bindgen_ty_20 = 0;
295#[doc = "!< the version for the format of internal codec"]
296pub const BLOSC2_CHUNK_VERSIONLZ: _bindgen_ty_20 = 1;
297#[doc = "!< flags and codec info"]
298pub const BLOSC2_CHUNK_FLAGS: _bindgen_ty_20 = 2;
299#[doc = "!< (uint8) the number of bytes of the atomic type"]
300pub const BLOSC2_CHUNK_TYPESIZE: _bindgen_ty_20 = 3;
301#[doc = "!< (int32) uncompressed size of the buffer (this header is not included)"]
302pub const BLOSC2_CHUNK_NBYTES: _bindgen_ty_20 = 4;
303#[doc = "!< (int32) size of internal blocks"]
304pub const BLOSC2_CHUNK_BLOCKSIZE: _bindgen_ty_20 = 8;
305#[doc = "!< (int32) compressed size of the buffer (including this header)"]
306pub const BLOSC2_CHUNK_CBYTES: _bindgen_ty_20 = 12;
307#[doc = "!< the codecs for the filter pipeline (1 byte per code)"]
308pub const BLOSC2_CHUNK_FILTER_CODES: _bindgen_ty_20 = 16;
309#[doc = "!< meta info for the filter pipeline (1 byte per code)"]
310pub const BLOSC2_CHUNK_FILTER_META: _bindgen_ty_20 = 24;
311#[doc = "!< flags specific for Blosc2 functionality"]
312pub const BLOSC2_CHUNK_BLOSC2_FLAGS: _bindgen_ty_20 = 31;
313#[doc = " @brief Offsets for fields in Blosc2 chunk header."]
314pub type _bindgen_ty_20 = ::std::os::raw::c_int;
315#[doc = "!< no special value"]
316pub const BLOSC2_NO_SPECIAL: _bindgen_ty_21 = 0;
317#[doc = "!< zero special value"]
318pub const BLOSC2_SPECIAL_ZERO: _bindgen_ty_21 = 1;
319#[doc = "!< NaN special value"]
320pub const BLOSC2_SPECIAL_NAN: _bindgen_ty_21 = 2;
321#[doc = "!< generic special value"]
322pub const BLOSC2_SPECIAL_VALUE: _bindgen_ty_21 = 3;
323#[doc = "!< non initialized values"]
324pub const BLOSC2_SPECIAL_UNINIT: _bindgen_ty_21 = 4;
325#[doc = "!< last valid ID for special value (update this adequately)"]
326pub const BLOSC2_SPECIAL_LASTID: _bindgen_ty_21 = 4;
327#[doc = "!< special value mask (prev IDs cannot be larger than this)"]
328pub const BLOSC2_SPECIAL_MASK: _bindgen_ty_21 = 7;
329#[doc = " @brief Run lengths for special values for chunks/frames"]
330pub type _bindgen_ty_21 = ::std::os::raw::c_int;
331pub const BLOSC2_ERROR_SUCCESS: _bindgen_ty_22 = 0;
332pub const BLOSC2_ERROR_FAILURE: _bindgen_ty_22 = -1;
333pub const BLOSC2_ERROR_STREAM: _bindgen_ty_22 = -2;
334pub const BLOSC2_ERROR_DATA: _bindgen_ty_22 = -3;
335pub const BLOSC2_ERROR_MEMORY_ALLOC: _bindgen_ty_22 = -4;
336#[doc = "!< Not enough space to read"]
337pub const BLOSC2_ERROR_READ_BUFFER: _bindgen_ty_22 = -5;
338#[doc = "!< Not enough space to write"]
339pub const BLOSC2_ERROR_WRITE_BUFFER: _bindgen_ty_22 = -6;
340#[doc = "!< Codec not supported"]
341pub const BLOSC2_ERROR_CODEC_SUPPORT: _bindgen_ty_22 = -7;
342#[doc = "!< Invalid parameter supplied to codec"]
343pub const BLOSC2_ERROR_CODEC_PARAM: _bindgen_ty_22 = -8;
344#[doc = "!< Codec dictionary error"]
345pub const BLOSC2_ERROR_CODEC_DICT: _bindgen_ty_22 = -9;
346#[doc = "!< Version not supported"]
347pub const BLOSC2_ERROR_VERSION_SUPPORT: _bindgen_ty_22 = -10;
348#[doc = "!< Invalid value in header"]
349pub const BLOSC2_ERROR_INVALID_HEADER: _bindgen_ty_22 = -11;
350#[doc = "!< Invalid parameter supplied to function"]
351pub const BLOSC2_ERROR_INVALID_PARAM: _bindgen_ty_22 = -12;
352#[doc = "!< File read failure"]
353pub const BLOSC2_ERROR_FILE_READ: _bindgen_ty_22 = -13;
354#[doc = "!< File write failure"]
355pub const BLOSC2_ERROR_FILE_WRITE: _bindgen_ty_22 = -14;
356#[doc = "!< File open failure"]
357pub const BLOSC2_ERROR_FILE_OPEN: _bindgen_ty_22 = -15;
358#[doc = "!< Not found"]
359pub const BLOSC2_ERROR_NOT_FOUND: _bindgen_ty_22 = -16;
360#[doc = "!< Bad run length encoding"]
361pub const BLOSC2_ERROR_RUN_LENGTH: _bindgen_ty_22 = -17;
362#[doc = "!< Filter pipeline error"]
363pub const BLOSC2_ERROR_FILTER_PIPELINE: _bindgen_ty_22 = -18;
364#[doc = "!< Chunk insert failure"]
365pub const BLOSC2_ERROR_CHUNK_INSERT: _bindgen_ty_22 = -19;
366#[doc = "!< Chunk append failure"]
367pub const BLOSC2_ERROR_CHUNK_APPEND: _bindgen_ty_22 = -20;
368#[doc = "!< Chunk update failure"]
369pub const BLOSC2_ERROR_CHUNK_UPDATE: _bindgen_ty_22 = -21;
370#[doc = "!< Sizes larger than 2gb not supported"]
371pub const BLOSC2_ERROR_2GB_LIMIT: _bindgen_ty_22 = -22;
372#[doc = "!< Super-chunk copy failure"]
373pub const BLOSC2_ERROR_SCHUNK_COPY: _bindgen_ty_22 = -23;
374#[doc = "!< Wrong type for frame"]
375pub const BLOSC2_ERROR_FRAME_TYPE: _bindgen_ty_22 = -24;
376#[doc = "!< File truncate failure"]
377pub const BLOSC2_ERROR_FILE_TRUNCATE: _bindgen_ty_22 = -25;
378#[doc = "!< Thread or thread context creation failure"]
379pub const BLOSC2_ERROR_THREAD_CREATE: _bindgen_ty_22 = -26;
380#[doc = "!< Postfilter failure"]
381pub const BLOSC2_ERROR_POSTFILTER: _bindgen_ty_22 = -27;
382#[doc = "!< Special frame failure"]
383pub const BLOSC2_ERROR_FRAME_SPECIAL: _bindgen_ty_22 = -28;
384#[doc = "!< Special super-chunk failure"]
385pub const BLOSC2_ERROR_SCHUNK_SPECIAL: _bindgen_ty_22 = -29;
386#[doc = "!< IO plugin error"]
387pub const BLOSC2_ERROR_PLUGIN_IO: _bindgen_ty_22 = -30;
388#[doc = "!< Remove file failure"]
389pub const BLOSC2_ERROR_FILE_REMOVE: _bindgen_ty_22 = -31;
390#[doc = "!< Pointer is null"]
391pub const BLOSC2_ERROR_NULL_POINTER: _bindgen_ty_22 = -32;
392#[doc = "!< Invalid index"]
393pub const BLOSC2_ERROR_INVALID_INDEX: _bindgen_ty_22 = -33;
394#[doc = "!< Metalayer has not been found"]
395pub const BLOSC2_ERROR_METALAYER_NOT_FOUND: _bindgen_ty_22 = -34;
396#[doc = "!< Max buffer size exceeded"]
397pub const BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED: _bindgen_ty_22 = -35;
398#[doc = "!< Tuner failure"]
399pub const BLOSC2_ERROR_TUNER: _bindgen_ty_22 = -36;
400#[doc = " @brief Error codes\n Each time an error code is added here, its corresponding message error should be added in\n print_error()"]
401pub type _bindgen_ty_22 = ::std::os::raw::c_int;
402extern "C" {
403    #[doc = " @brief Initialize the Blosc library environment.\n\n You must call this previous to any other Blosc call, unless you want\n Blosc to be used simultaneously in a multi-threaded environment, in\n which case you can use the #blosc2_compress_ctx #blosc2_decompress_ctx pair.\n\n @sa #blosc2_destroy"]
404    pub fn blosc2_init();
405}
406extern "C" {
407    #[doc = " @brief Destroy the Blosc library environment.\n\n You must call this after to you are done with all the Blosc calls,\n unless you have not used blosc2_init() before.\n\n @sa #blosc2_init"]
408    pub fn blosc2_destroy();
409}
410extern "C" {
411    #[doc = " @brief Compress a block of data in the @p src buffer and returns the size of\n compressed block.\n\n @remark Compression is memory safe and guaranteed not to write @p dest\n more than what is specified in @p destsize.\n There is not a minimum for @p src buffer size @p nbytes.\n\n @warning The @p src buffer and the @p dest buffer can not overlap.\n\n @param clevel The desired compression level and must be a number\n between 0 (no compression) and 9 (maximum compression).\n @param doshuffle Specifies whether the shuffle compression preconditioner\n should be applied or not. #BLOSC_NOFILTER means not applying filters,\n #BLOSC_SHUFFLE means applying shuffle at a byte level and\n #BLOSC_BITSHUFFLE at a bit level (slower but *may* achieve better\n compression).\n @param typesize Is the number of bytes for the atomic type in binary\n @p src buffer.  This is mainly useful for the shuffle preconditioner.\n For implementation reasons, only a 1 < typesize < 256 will allow the\n shuffle filter to work.  When typesize is not in this range, shuffle\n will be silently disabled.\n @param nbytes The number of bytes to compress in the @p src buffer.\n @param src The buffer containing the data to compress.\n @param dest The buffer where the compressed data will be put,\n must have at least the size of @p destsize.\n @param destsize The size of the dest buffer. Blosc\n guarantees that if you set @p destsize to, at least,\n (@p nbytes + #BLOSC2_MAX_OVERHEAD), the compression will always succeed.\n\n @return The number of bytes compressed.\n If @p src buffer cannot be compressed into @p destsize, the return\n value is zero and you should discard the contents of the @p dest\n buffer. A negative return value means that an internal error happened. This\n should never happen. If you see this, please report it back\n together with the buffer data causing this and compression settings.\n\n\n @par Environment variables\n @parblock\n\n This function honors different environment variables to control\n internal parameters without the need of doing that programmatically.\n Here are the ones supported:\n\n * **BLOSC_CLEVEL=(INTEGER)**: This will overwrite the @p clevel parameter\n before the compression process starts.\n\n * **BLOSC_SHUFFLE=[NOSHUFFLE | SHUFFLE | BITSHUFFLE]**: This will\n overwrite the @p doshuffle parameter before the compression process\n starts.\n\n * **BLOSC_DELTA=(1|0)**: This will call #blosc2_set_delta() before the\n compression process starts.\n\n * **BLOSC_TYPESIZE=(INTEGER)**: This will overwrite the @p typesize\n parameter before the compression process starts.\n\n * **BLOSC_COMPRESSOR=[BLOSCLZ | LZ4 | LZ4HC | ZLIB | ZSTD]**:\n This will call #blosc1_set_compressor before the compression process starts.\n\n * **BLOSC_NTHREADS=(INTEGER)**: This will call\n #blosc2_set_nthreads before the compression process starts.\n\n * **BLOSC_SPLITMODE=(ALWAYS | NEVER | AUTO | FORWARD_COMPAT)**:\n This will call #blosc1_set_splitmode() before the compression process starts.\n\n * **BLOSC_BLOCKSIZE=(INTEGER)**: This will call\n #blosc1_set_blocksize before the compression process starts.\n *NOTE:* The *blocksize* is a critical parameter with\n important restrictions in the allowed values, so use this with care.\n\n * **BLOSC_NOLOCK=(ANY VALUE)**: This will call #blosc2_compress_ctx under\n the hood, with the *compressor*, *blocksize* and\n *numinternalthreads* parameters set to the same as the last calls to\n #blosc1_set_compressor, #blosc1_set_blocksize and\n #blosc2_set_nthreads. *BLOSC_CLEVEL*, *BLOSC_SHUFFLE*, *BLOSC_DELTA* and\n *BLOSC_TYPESIZE* environment vars will also be honored.\n\n @endparblock\n\n @sa #blosc1_decompress"]
412    pub fn blosc1_compress(
413        clevel: ::std::os::raw::c_int,
414        doshuffle: ::std::os::raw::c_int,
415        typesize: usize,
416        nbytes: usize,
417        src: *const ::std::os::raw::c_void,
418        dest: *mut ::std::os::raw::c_void,
419        destsize: usize,
420    ) -> ::std::os::raw::c_int;
421}
422extern "C" {
423    #[doc = " @brief Decompress a block of compressed data in @p src, put the result in\n @p dest and returns the size of the decompressed block.\n\n @warning The @p src buffer and the @p dest buffer can not overlap.\n\n @remark Decompression is memory safe and guaranteed not to write the @p dest\n buffer more than what is specified in @p destsize.\n\n @remark In case you want to keep under control the number of bytes read from\n source, you can call #blosc1_cbuffer_sizes first to check whether the\n @p nbytes (i.e. the number of bytes to be read from @p src buffer by this\n function) in the compressed buffer is ok with you.\n\n @param src The buffer to be decompressed.\n @param dest The buffer where the decompressed data will be put.\n @param destsize The size of the @p dest buffer.\n\n @return The number of bytes decompressed.\n If an error occurs, e.g. the compressed data is corrupted or the\n output buffer is not large enough, then a negative value\n will be returned instead.\n\n @par Environment variables\n @parblock\n This function honors different environment variables to control\n internal parameters without the need of doing that programmatically.\n Here are the ones supported:\n\n * **BLOSC_NTHREADS=(INTEGER)**: This will call\n #blosc2_set_nthreads before the proper decompression\n process starts.\n\n * **BLOSC_NOLOCK=(ANY VALUE)**: This will call #blosc2_decompress_ctx\n under the hood, with the *numinternalthreads* parameter set to the\n same value as the last call to #blosc2_set_nthreads.\n\n @endparblock\n\n @sa #blosc1_compress"]
424    pub fn blosc1_decompress(
425        src: *const ::std::os::raw::c_void,
426        dest: *mut ::std::os::raw::c_void,
427        destsize: usize,
428    ) -> ::std::os::raw::c_int;
429}
430extern "C" {
431    #[doc = " @brief Get @p nitems (of @p typesize size) in @p src buffer starting in @p start.\n The items are returned in @p dest buffer, which has to have enough\n space for storing all items.\n\n @param src The compressed buffer from data will be decompressed.\n @param start The position of the first item (of @p typesize size) from where data\n will be retrieved.\n @param nitems The number of items (of @p typesize size) that will be retrieved.\n @param dest The buffer where the decompressed data retrieved will be put.\n\n @return The number of bytes copied to @p dest or a negative value if\n some error happens."]
432    pub fn blosc1_getitem(
433        src: *const ::std::os::raw::c_void,
434        start: ::std::os::raw::c_int,
435        nitems: ::std::os::raw::c_int,
436        dest: *mut ::std::os::raw::c_void,
437    ) -> ::std::os::raw::c_int;
438}
439extern "C" {
440    #[doc = " @brief Get @p nitems (of @p typesize size) in @p src buffer starting in @p start.\n The items are returned in @p dest buffer. The dest buffer should have enough space\n for storing all items. This function is a more secure version of #blosc1_getitem.\n\n @param src The compressed buffer holding the data to be retrieved.\n @param srcsize Size of the compressed buffer.\n @param start The position of the first item (of @p typesize size) from where data\n will be retrieved.\n @param nitems The number of items (of @p typesize size) that will be retrieved.\n @param dest The buffer where the retrieved data will be stored decompressed.\n @param destsize Size of the buffer where retrieved data will be stored.\n\n @return The number of bytes copied to @p dest or a negative value if\n some error happens."]
441    pub fn blosc2_getitem(
442        src: *const ::std::os::raw::c_void,
443        srcsize: i32,
444        start: ::std::os::raw::c_int,
445        nitems: ::std::os::raw::c_int,
446        dest: *mut ::std::os::raw::c_void,
447        destsize: i32,
448    ) -> ::std::os::raw::c_int;
449}
450#[doc = "Pointer to a callback function that executes `dojob(jobdata + i*jobdata_elsize)` for `i = 0 to numjobs-1`,\npossibly in parallel threads (but not returning until all `dojob` calls have returned).   This allows the\ncaller to provide a custom threading backend as an alternative to the default Blosc-managed threads.\n`callback_data` is passed through from `blosc2_set_threads_callback`."]
451pub type blosc_threads_callback = ::std::option::Option<
452    unsafe extern "C" fn(
453        callback_data: *mut ::std::os::raw::c_void,
454        dojob: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
455        numjobs: ::std::os::raw::c_int,
456        jobdata_elsize: usize,
457        jobdata: *mut ::std::os::raw::c_void,
458    ),
459>;
460extern "C" {
461    #[doc = "Set the threading backend for parallel compression/decompression to use `callback` to execute work\ninstead of using the Blosc-managed threads.   This function is *not* thread-safe and should be called\nbefore any other Blosc function: it affects all Blosc contexts.  Passing `NULL` uses the default\nBlosc threading backend.  The `callback_data` argument is passed through to the callback."]
462    pub fn blosc2_set_threads_callback(
463        callback: blosc_threads_callback,
464        callback_data: *mut ::std::os::raw::c_void,
465    );
466}
467extern "C" {
468    #[doc = " @brief Returns the current number of threads that are used for\n compression/decompression."]
469    pub fn blosc2_get_nthreads() -> i16;
470}
471extern "C" {
472    #[doc = " @brief Initialize a pool of threads for compression/decompression. If\n @p nthreads is 1, then the serial version is chosen and a possible\n previous existing pool is ended. If this is not called, @p nthreads\n is set to 1 internally.\n\n @param nthreads The number of threads to use.\n\n @return The previous number of threads."]
473    pub fn blosc2_set_nthreads(nthreads: i16) -> i16;
474}
475extern "C" {
476    #[doc = " @brief Get the current compressor that is used for compression.\n\n @return The string identifying the compressor being used."]
477    pub fn blosc1_get_compressor() -> *const ::std::os::raw::c_char;
478}
479extern "C" {
480    #[doc = " @brief Select the compressor to be used. The supported ones are \"blosclz\",\n \"lz4\", \"lz4hc\", \"zlib\" and \"ztsd\". If this function is not\n called, then \"blosclz\" will be used.\n\n @param compname The name identifier of the compressor to be set.\n\n @return The code for the compressor (>=0). In case the compressor\n is not recognized, or there is not support for it in this build,\n it returns a -1."]
481    pub fn blosc1_set_compressor(compname: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
482}
483extern "C" {
484    #[doc = " @brief Select the delta coding filter to be used.\n\n @param dodelta A value >0 will activate the delta filter.\n If 0, it will be de-activated\n\n This call should always succeed."]
485    pub fn blosc2_set_delta(dodelta: ::std::os::raw::c_int);
486}
487extern "C" {
488    #[doc = " @brief Get the compressor name associated with the compressor code.\n\n @param compcode The code identifying the compressor\n @param compname The pointer to a string where the compressor name will be put.\n\n @return The compressor code. If the compressor code is not recognized,\n or there is not support for it in this build, -1 is returned."]
489    pub fn blosc2_compcode_to_compname(
490        compcode: ::std::os::raw::c_int,
491        compname: *mut *const ::std::os::raw::c_char,
492    ) -> ::std::os::raw::c_int;
493}
494extern "C" {
495    #[doc = " @brief Get the compressor code associated with the compressor name.\n\n @param compname The string containing the compressor name.\n\n @return The compressor code. If the compressor name is not recognized,\n or there is not support for it in this build, -1 is returned instead."]
496    pub fn blosc2_compname_to_compcode(
497        compname: *const ::std::os::raw::c_char,
498    ) -> ::std::os::raw::c_int;
499}
500extern "C" {
501    #[doc = " @brief Get a list of compressors supported in the current build.\n\n @return The comma separated string with the list of compressor names\n supported.\n\n This function does not leak, so you should not free() the returned\n list.\n\n This function should always succeed."]
502    pub fn blosc2_list_compressors() -> *const ::std::os::raw::c_char;
503}
504extern "C" {
505    #[doc = " @brief Get the version of Blosc in string format.\n\n @return The string with the current Blosc version.\n Useful for dynamic libraries."]
506    pub fn blosc2_get_version_string() -> *const ::std::os::raw::c_char;
507}
508extern "C" {
509    #[doc = " @brief Get info from compression libraries included in the current build.\n\n @param compname The compressor name that you want info from.\n @param complib The pointer to a string where the\n compression library name, if available, will be put.\n @param version The pointer to a string where the\n compression library version, if available, will be put.\n\n @warning You are in charge of the @p complib and @p version strings,\n you should free() them so as to avoid leaks.\n\n @return The code for the compression library (>=0). If it is not supported,\n this function returns -1."]
510    pub fn blosc2_get_complib_info(
511        compname: *const ::std::os::raw::c_char,
512        complib: *mut *mut ::std::os::raw::c_char,
513        version: *mut *mut ::std::os::raw::c_char,
514    ) -> ::std::os::raw::c_int;
515}
516extern "C" {
517    #[doc = " @brief Free possible memory temporaries and thread resources. Use this\n when you are not going to use Blosc for a long while.\n\n @return A 0 if succeeds, in case of problems releasing the resources,\n it returns a negative number."]
518    pub fn blosc2_free_resources() -> ::std::os::raw::c_int;
519}
520extern "C" {
521    #[doc = " @brief Get information about a compressed buffer, namely the number of\n uncompressed bytes (@p nbytes) and compressed (@p cbytes). It also\n returns the @p blocksize (which is used internally for doing the\n compression by blocks).\n\n @param cbuffer The buffer of compressed data.\n @param nbytes The pointer where the number of uncompressed bytes will be put.\n @param cbytes The pointer where the number of compressed bytes will be put.\n @param blocksize The pointer where the block size will be put.\n\n You only need to pass the first BLOSC_MIN_HEADER_LENGTH bytes of a\n compressed buffer for this call to work.\n\n This function should always succeed."]
522    pub fn blosc1_cbuffer_sizes(
523        cbuffer: *const ::std::os::raw::c_void,
524        nbytes: *mut usize,
525        cbytes: *mut usize,
526        blocksize: *mut usize,
527    );
528}
529extern "C" {
530    #[doc = " @brief Get information about a compressed buffer, namely the number of\n uncompressed bytes (@p nbytes) and compressed (@p cbytes). It also\n returns the @p blocksize (which is used internally for doing the\n compression by blocks).\n\n @param cbuffer The buffer of compressed data.\n @param nbytes The pointer where the number of uncompressed bytes will be put.\n @param cbytes The pointer where the number of compressed bytes will be put.\n @param blocksize The pointer where the block size will be put.\n\n @note: if any of the nbytes, cbytes or blocksize is NULL, it will not be returned.\n\n You only need to pass the first BLOSC_MIN_HEADER_LENGTH bytes of a\n compressed buffer for this call to work.\n\n @return On failure, returns negative value."]
531    pub fn blosc2_cbuffer_sizes(
532        cbuffer: *const ::std::os::raw::c_void,
533        nbytes: *mut i32,
534        cbytes: *mut i32,
535        blocksize: *mut i32,
536    ) -> ::std::os::raw::c_int;
537}
538extern "C" {
539    #[doc = " @brief Checks that the compressed buffer starting at @p cbuffer of length @p cbytes\n may contain valid blosc compressed data, and that it is safe to call\n blosc1_decompress/blosc1_getitem.\n On success, returns 0 and sets @p nbytes to the size of the uncompressed data.\n This does not guarantee that the decompression function won't return an error,\n but does guarantee that it is safe to attempt decompression.\n\n @param cbuffer The buffer of compressed data.\n @param cbytes The number of compressed bytes.\n @param nbytes The pointer where the number of uncompressed bytes will be put.\n\n @return On failure, returns negative value."]
540    pub fn blosc1_cbuffer_validate(
541        cbuffer: *const ::std::os::raw::c_void,
542        cbytes: usize,
543        nbytes: *mut usize,
544    ) -> ::std::os::raw::c_int;
545}
546extern "C" {
547    #[doc = " @brief Get information about a compressed buffer, namely the type size\n (@p typesize), as well as some internal @p flags.\n\n @param cbuffer The buffer of compressed data.\n @param typesize The pointer where the type size will be put.\n @param flags The pointer of the integer where the additional info is encoded.\n The @p flags is a set of bits, where the currently used ones are:\n   * bit 0: whether the shuffle filter has been applied or not\n   * bit 1: whether the internal buffer is a pure memcpy or not\n   * bit 2: whether the bitshuffle filter has been applied or not\n   * bit 3: whether the delta coding filter has been applied or not\n\n You can use the @p BLOSC_DOSHUFFLE, @p BLOSC_DOBITSHUFFLE, @p BLOSC_DODELTA\n and @p BLOSC_MEMCPYED symbols for extracting the interesting bits\n (e.g. @p flags & @p BLOSC_DOSHUFFLE says whether the buffer is byte-shuffled\n or not).\n\n This function should always succeed."]
548    pub fn blosc1_cbuffer_metainfo(
549        cbuffer: *const ::std::os::raw::c_void,
550        typesize: *mut usize,
551        flags: *mut ::std::os::raw::c_int,
552    );
553}
554extern "C" {
555    #[doc = " @brief Get information about a compressed buffer, namely the internal\n Blosc format version (@p version) and the format for the internal\n Lempel-Ziv compressor used (@p versionlz).\n\n @param cbuffer The buffer of compressed data.\n @param version The pointer where the Blosc format version will be put.\n @param versionlz The pointer where the Lempel-Ziv version will be put.\n\n This function should always succeed."]
556    pub fn blosc2_cbuffer_versions(
557        cbuffer: *const ::std::os::raw::c_void,
558        version: *mut ::std::os::raw::c_int,
559        versionlz: *mut ::std::os::raw::c_int,
560    );
561}
562extern "C" {
563    #[doc = " @brief Get the compressor library/format used in a compressed buffer.\n\n @param cbuffer The buffer of compressed data.\n\n @return The string identifying the compressor library/format used.\n\n This function should always succeed."]
564    pub fn blosc2_cbuffer_complib(
565        cbuffer: *const ::std::os::raw::c_void,
566    ) -> *const ::std::os::raw::c_char;
567}
568pub const BLOSC2_IO_FILESYSTEM: _bindgen_ty_23 = 0;
569pub const BLOSC_IO_LAST_BLOSC_DEFINED: _bindgen_ty_23 = 1;
570pub const BLOSC_IO_LAST_REGISTERED: _bindgen_ty_23 = 32;
571#[doc = "Structures and functions related with user-defined input/output."]
572pub type _bindgen_ty_23 = ::std::os::raw::c_int;
573pub const BLOSC2_IO_BLOSC_DEFINED: _bindgen_ty_24 = 32;
574pub const BLOSC2_IO_REGISTERED: _bindgen_ty_24 = 160;
575pub const BLOSC2_IO_USER_DEFINED: _bindgen_ty_24 = 256;
576pub type _bindgen_ty_24 = ::std::os::raw::c_int;
577pub type blosc2_open_cb = ::std::option::Option<
578    unsafe extern "C" fn(
579        urlpath: *const ::std::os::raw::c_char,
580        mode: *const ::std::os::raw::c_char,
581        params: *mut ::std::os::raw::c_void,
582    ) -> *mut ::std::os::raw::c_void,
583>;
584pub type blosc2_close_cb = ::std::option::Option<
585    unsafe extern "C" fn(stream: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
586>;
587pub type blosc2_tell_cb =
588    ::std::option::Option<unsafe extern "C" fn(stream: *mut ::std::os::raw::c_void) -> i64>;
589pub type blosc2_seek_cb = ::std::option::Option<
590    unsafe extern "C" fn(
591        stream: *mut ::std::os::raw::c_void,
592        offset: i64,
593        whence: ::std::os::raw::c_int,
594    ) -> ::std::os::raw::c_int,
595>;
596pub type blosc2_write_cb = ::std::option::Option<
597    unsafe extern "C" fn(
598        ptr: *const ::std::os::raw::c_void,
599        size: i64,
600        nitems: i64,
601        stream: *mut ::std::os::raw::c_void,
602    ) -> i64,
603>;
604pub type blosc2_read_cb = ::std::option::Option<
605    unsafe extern "C" fn(
606        ptr: *mut ::std::os::raw::c_void,
607        size: i64,
608        nitems: i64,
609        stream: *mut ::std::os::raw::c_void,
610    ) -> i64,
611>;
612pub type blosc2_truncate_cb = ::std::option::Option<
613    unsafe extern "C" fn(stream: *mut ::std::os::raw::c_void, size: i64) -> ::std::os::raw::c_int,
614>;
615#[repr(C)]
616#[derive(Debug, Copy, Clone)]
617pub struct blosc2_io_cb {
618    pub id: u8,
619    pub name: *mut ::std::os::raw::c_char,
620    pub open: blosc2_open_cb,
621    pub close: blosc2_close_cb,
622    pub tell: blosc2_tell_cb,
623    pub seek: blosc2_seek_cb,
624    pub write: blosc2_write_cb,
625    pub read: blosc2_read_cb,
626    pub truncate: blosc2_truncate_cb,
627}
628#[test]
629fn bindgen_test_layout_blosc2_io_cb() {
630    const UNINIT: ::std::mem::MaybeUninit<blosc2_io_cb> = ::std::mem::MaybeUninit::uninit();
631    let ptr = UNINIT.as_ptr();
632    assert_eq!(
633        ::std::mem::size_of::<blosc2_io_cb>(),
634        72usize,
635        concat!("Size of: ", stringify!(blosc2_io_cb))
636    );
637    assert_eq!(
638        ::std::mem::align_of::<blosc2_io_cb>(),
639        8usize,
640        concat!("Alignment of ", stringify!(blosc2_io_cb))
641    );
642    assert_eq!(
643        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
644        0usize,
645        concat!(
646            "Offset of field: ",
647            stringify!(blosc2_io_cb),
648            "::",
649            stringify!(id)
650        )
651    );
652    assert_eq!(
653        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
654        8usize,
655        concat!(
656            "Offset of field: ",
657            stringify!(blosc2_io_cb),
658            "::",
659            stringify!(name)
660        )
661    );
662    assert_eq!(
663        unsafe { ::std::ptr::addr_of!((*ptr).open) as usize - ptr as usize },
664        16usize,
665        concat!(
666            "Offset of field: ",
667            stringify!(blosc2_io_cb),
668            "::",
669            stringify!(open)
670        )
671    );
672    assert_eq!(
673        unsafe { ::std::ptr::addr_of!((*ptr).close) as usize - ptr as usize },
674        24usize,
675        concat!(
676            "Offset of field: ",
677            stringify!(blosc2_io_cb),
678            "::",
679            stringify!(close)
680        )
681    );
682    assert_eq!(
683        unsafe { ::std::ptr::addr_of!((*ptr).tell) as usize - ptr as usize },
684        32usize,
685        concat!(
686            "Offset of field: ",
687            stringify!(blosc2_io_cb),
688            "::",
689            stringify!(tell)
690        )
691    );
692    assert_eq!(
693        unsafe { ::std::ptr::addr_of!((*ptr).seek) as usize - ptr as usize },
694        40usize,
695        concat!(
696            "Offset of field: ",
697            stringify!(blosc2_io_cb),
698            "::",
699            stringify!(seek)
700        )
701    );
702    assert_eq!(
703        unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize },
704        48usize,
705        concat!(
706            "Offset of field: ",
707            stringify!(blosc2_io_cb),
708            "::",
709            stringify!(write)
710        )
711    );
712    assert_eq!(
713        unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
714        56usize,
715        concat!(
716            "Offset of field: ",
717            stringify!(blosc2_io_cb),
718            "::",
719            stringify!(read)
720        )
721    );
722    assert_eq!(
723        unsafe { ::std::ptr::addr_of!((*ptr).truncate) as usize - ptr as usize },
724        64usize,
725        concat!(
726            "Offset of field: ",
727            stringify!(blosc2_io_cb),
728            "::",
729            stringify!(truncate)
730        )
731    );
732}
733#[repr(C)]
734#[derive(Debug, Copy, Clone)]
735pub struct blosc2_io {
736    pub id: u8,
737    pub name: *const ::std::os::raw::c_char,
738    pub params: *mut ::std::os::raw::c_void,
739}
740#[test]
741fn bindgen_test_layout_blosc2_io() {
742    const UNINIT: ::std::mem::MaybeUninit<blosc2_io> = ::std::mem::MaybeUninit::uninit();
743    let ptr = UNINIT.as_ptr();
744    assert_eq!(
745        ::std::mem::size_of::<blosc2_io>(),
746        24usize,
747        concat!("Size of: ", stringify!(blosc2_io))
748    );
749    assert_eq!(
750        ::std::mem::align_of::<blosc2_io>(),
751        8usize,
752        concat!("Alignment of ", stringify!(blosc2_io))
753    );
754    assert_eq!(
755        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
756        0usize,
757        concat!(
758            "Offset of field: ",
759            stringify!(blosc2_io),
760            "::",
761            stringify!(id)
762        )
763    );
764    assert_eq!(
765        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
766        8usize,
767        concat!(
768            "Offset of field: ",
769            stringify!(blosc2_io),
770            "::",
771            stringify!(name)
772        )
773    );
774    assert_eq!(
775        unsafe { ::std::ptr::addr_of!((*ptr).params) as usize - ptr as usize },
776        16usize,
777        concat!(
778            "Offset of field: ",
779            stringify!(blosc2_io),
780            "::",
781            stringify!(params)
782        )
783    );
784}
785extern "C" {
786    pub static BLOSC2_IO_DEFAULTS: blosc2_io;
787}
788extern "C" {
789    #[doc = " @brief Register a user-defined input/output callbacks in Blosc.\n\n @param io The callbacks API to register.\n\n @return 0 if succeeds. Else a negative code is returned."]
790    pub fn blosc2_register_io_cb(io: *const blosc2_io_cb) -> ::std::os::raw::c_int;
791}
792extern "C" {
793    pub fn blosc2_get_io_cb(id: u8) -> *mut blosc2_io_cb;
794}
795#[repr(C)]
796#[derive(Debug, Copy, Clone)]
797pub struct blosc2_context_s {
798    _unused: [u8; 0],
799}
800#[doc = "Structures and functions related with contexts."]
801pub type blosc2_context = blosc2_context_s;
802#[repr(C)]
803#[derive(Debug, Copy, Clone)]
804pub struct blosc2_tuner {
805    pub init: ::std::option::Option<
806        unsafe extern "C" fn(
807            config: *mut ::std::os::raw::c_void,
808            cctx: *mut blosc2_context,
809            dctx: *mut blosc2_context,
810        ) -> ::std::os::raw::c_int,
811    >,
812    pub next_blocksize: ::std::option::Option<
813        unsafe extern "C" fn(context: *mut blosc2_context) -> ::std::os::raw::c_int,
814    >,
815    pub next_cparams: ::std::option::Option<
816        unsafe extern "C" fn(context: *mut blosc2_context) -> ::std::os::raw::c_int,
817    >,
818    pub update: ::std::option::Option<
819        unsafe extern "C" fn(context: *mut blosc2_context, ctime: f64) -> ::std::os::raw::c_int,
820    >,
821    pub free: ::std::option::Option<
822        unsafe extern "C" fn(context: *mut blosc2_context) -> ::std::os::raw::c_int,
823    >,
824    pub id: ::std::os::raw::c_int,
825    pub name: *mut ::std::os::raw::c_char,
826}
827#[test]
828fn bindgen_test_layout_blosc2_tuner() {
829    const UNINIT: ::std::mem::MaybeUninit<blosc2_tuner> = ::std::mem::MaybeUninit::uninit();
830    let ptr = UNINIT.as_ptr();
831    assert_eq!(
832        ::std::mem::size_of::<blosc2_tuner>(),
833        56usize,
834        concat!("Size of: ", stringify!(blosc2_tuner))
835    );
836    assert_eq!(
837        ::std::mem::align_of::<blosc2_tuner>(),
838        8usize,
839        concat!("Alignment of ", stringify!(blosc2_tuner))
840    );
841    assert_eq!(
842        unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize },
843        0usize,
844        concat!(
845            "Offset of field: ",
846            stringify!(blosc2_tuner),
847            "::",
848            stringify!(init)
849        )
850    );
851    assert_eq!(
852        unsafe { ::std::ptr::addr_of!((*ptr).next_blocksize) as usize - ptr as usize },
853        8usize,
854        concat!(
855            "Offset of field: ",
856            stringify!(blosc2_tuner),
857            "::",
858            stringify!(next_blocksize)
859        )
860    );
861    assert_eq!(
862        unsafe { ::std::ptr::addr_of!((*ptr).next_cparams) as usize - ptr as usize },
863        16usize,
864        concat!(
865            "Offset of field: ",
866            stringify!(blosc2_tuner),
867            "::",
868            stringify!(next_cparams)
869        )
870    );
871    assert_eq!(
872        unsafe { ::std::ptr::addr_of!((*ptr).update) as usize - ptr as usize },
873        24usize,
874        concat!(
875            "Offset of field: ",
876            stringify!(blosc2_tuner),
877            "::",
878            stringify!(update)
879        )
880    );
881    assert_eq!(
882        unsafe { ::std::ptr::addr_of!((*ptr).free) as usize - ptr as usize },
883        32usize,
884        concat!(
885            "Offset of field: ",
886            stringify!(blosc2_tuner),
887            "::",
888            stringify!(free)
889        )
890    );
891    assert_eq!(
892        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
893        40usize,
894        concat!(
895            "Offset of field: ",
896            stringify!(blosc2_tuner),
897            "::",
898            stringify!(id)
899        )
900    );
901    assert_eq!(
902        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
903        48usize,
904        concat!(
905            "Offset of field: ",
906            stringify!(blosc2_tuner),
907            "::",
908            stringify!(name)
909        )
910    );
911}
912#[doc = " @brief The parameters for a prefilter function.\n"]
913#[repr(C)]
914#[derive(Debug, Copy, Clone)]
915pub struct blosc2_prefilter_params {
916    pub user_data: *mut ::std::os::raw::c_void,
917    pub input: *const u8,
918    pub output: *mut u8,
919    pub output_size: i32,
920    pub output_typesize: i32,
921    pub output_offset: i32,
922    pub nchunk: i64,
923    pub nblock: i32,
924    pub tid: i32,
925    pub ttmp: *mut u8,
926    pub ttmp_nbytes: usize,
927    pub ctx: *mut blosc2_context,
928}
929#[test]
930fn bindgen_test_layout_blosc2_prefilter_params() {
931    const UNINIT: ::std::mem::MaybeUninit<blosc2_prefilter_params> =
932        ::std::mem::MaybeUninit::uninit();
933    let ptr = UNINIT.as_ptr();
934    assert_eq!(
935        ::std::mem::size_of::<blosc2_prefilter_params>(),
936        80usize,
937        concat!("Size of: ", stringify!(blosc2_prefilter_params))
938    );
939    assert_eq!(
940        ::std::mem::align_of::<blosc2_prefilter_params>(),
941        8usize,
942        concat!("Alignment of ", stringify!(blosc2_prefilter_params))
943    );
944    assert_eq!(
945        unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize },
946        0usize,
947        concat!(
948            "Offset of field: ",
949            stringify!(blosc2_prefilter_params),
950            "::",
951            stringify!(user_data)
952        )
953    );
954    assert_eq!(
955        unsafe { ::std::ptr::addr_of!((*ptr).input) as usize - ptr as usize },
956        8usize,
957        concat!(
958            "Offset of field: ",
959            stringify!(blosc2_prefilter_params),
960            "::",
961            stringify!(input)
962        )
963    );
964    assert_eq!(
965        unsafe { ::std::ptr::addr_of!((*ptr).output) as usize - ptr as usize },
966        16usize,
967        concat!(
968            "Offset of field: ",
969            stringify!(blosc2_prefilter_params),
970            "::",
971            stringify!(output)
972        )
973    );
974    assert_eq!(
975        unsafe { ::std::ptr::addr_of!((*ptr).output_size) as usize - ptr as usize },
976        24usize,
977        concat!(
978            "Offset of field: ",
979            stringify!(blosc2_prefilter_params),
980            "::",
981            stringify!(output_size)
982        )
983    );
984    assert_eq!(
985        unsafe { ::std::ptr::addr_of!((*ptr).output_typesize) as usize - ptr as usize },
986        28usize,
987        concat!(
988            "Offset of field: ",
989            stringify!(blosc2_prefilter_params),
990            "::",
991            stringify!(output_typesize)
992        )
993    );
994    assert_eq!(
995        unsafe { ::std::ptr::addr_of!((*ptr).output_offset) as usize - ptr as usize },
996        32usize,
997        concat!(
998            "Offset of field: ",
999            stringify!(blosc2_prefilter_params),
1000            "::",
1001            stringify!(output_offset)
1002        )
1003    );
1004    assert_eq!(
1005        unsafe { ::std::ptr::addr_of!((*ptr).nchunk) as usize - ptr as usize },
1006        40usize,
1007        concat!(
1008            "Offset of field: ",
1009            stringify!(blosc2_prefilter_params),
1010            "::",
1011            stringify!(nchunk)
1012        )
1013    );
1014    assert_eq!(
1015        unsafe { ::std::ptr::addr_of!((*ptr).nblock) as usize - ptr as usize },
1016        48usize,
1017        concat!(
1018            "Offset of field: ",
1019            stringify!(blosc2_prefilter_params),
1020            "::",
1021            stringify!(nblock)
1022        )
1023    );
1024    assert_eq!(
1025        unsafe { ::std::ptr::addr_of!((*ptr).tid) as usize - ptr as usize },
1026        52usize,
1027        concat!(
1028            "Offset of field: ",
1029            stringify!(blosc2_prefilter_params),
1030            "::",
1031            stringify!(tid)
1032        )
1033    );
1034    assert_eq!(
1035        unsafe { ::std::ptr::addr_of!((*ptr).ttmp) as usize - ptr as usize },
1036        56usize,
1037        concat!(
1038            "Offset of field: ",
1039            stringify!(blosc2_prefilter_params),
1040            "::",
1041            stringify!(ttmp)
1042        )
1043    );
1044    assert_eq!(
1045        unsafe { ::std::ptr::addr_of!((*ptr).ttmp_nbytes) as usize - ptr as usize },
1046        64usize,
1047        concat!(
1048            "Offset of field: ",
1049            stringify!(blosc2_prefilter_params),
1050            "::",
1051            stringify!(ttmp_nbytes)
1052        )
1053    );
1054    assert_eq!(
1055        unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize },
1056        72usize,
1057        concat!(
1058            "Offset of field: ",
1059            stringify!(blosc2_prefilter_params),
1060            "::",
1061            stringify!(ctx)
1062        )
1063    );
1064}
1065#[doc = " @brief The parameters for a postfilter function.\n"]
1066#[repr(C)]
1067#[derive(Debug, Copy, Clone)]
1068pub struct blosc2_postfilter_params {
1069    pub user_data: *mut ::std::os::raw::c_void,
1070    pub input: *const u8,
1071    pub output: *mut u8,
1072    pub size: i32,
1073    pub typesize: i32,
1074    pub offset: i32,
1075    pub nchunk: i64,
1076    pub nblock: i32,
1077    pub tid: i32,
1078    pub ttmp: *mut u8,
1079    pub ttmp_nbytes: usize,
1080    pub ctx: *mut blosc2_context,
1081}
1082#[test]
1083fn bindgen_test_layout_blosc2_postfilter_params() {
1084    const UNINIT: ::std::mem::MaybeUninit<blosc2_postfilter_params> =
1085        ::std::mem::MaybeUninit::uninit();
1086    let ptr = UNINIT.as_ptr();
1087    assert_eq!(
1088        ::std::mem::size_of::<blosc2_postfilter_params>(),
1089        80usize,
1090        concat!("Size of: ", stringify!(blosc2_postfilter_params))
1091    );
1092    assert_eq!(
1093        ::std::mem::align_of::<blosc2_postfilter_params>(),
1094        8usize,
1095        concat!("Alignment of ", stringify!(blosc2_postfilter_params))
1096    );
1097    assert_eq!(
1098        unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize },
1099        0usize,
1100        concat!(
1101            "Offset of field: ",
1102            stringify!(blosc2_postfilter_params),
1103            "::",
1104            stringify!(user_data)
1105        )
1106    );
1107    assert_eq!(
1108        unsafe { ::std::ptr::addr_of!((*ptr).input) as usize - ptr as usize },
1109        8usize,
1110        concat!(
1111            "Offset of field: ",
1112            stringify!(blosc2_postfilter_params),
1113            "::",
1114            stringify!(input)
1115        )
1116    );
1117    assert_eq!(
1118        unsafe { ::std::ptr::addr_of!((*ptr).output) as usize - ptr as usize },
1119        16usize,
1120        concat!(
1121            "Offset of field: ",
1122            stringify!(blosc2_postfilter_params),
1123            "::",
1124            stringify!(output)
1125        )
1126    );
1127    assert_eq!(
1128        unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
1129        24usize,
1130        concat!(
1131            "Offset of field: ",
1132            stringify!(blosc2_postfilter_params),
1133            "::",
1134            stringify!(size)
1135        )
1136    );
1137    assert_eq!(
1138        unsafe { ::std::ptr::addr_of!((*ptr).typesize) as usize - ptr as usize },
1139        28usize,
1140        concat!(
1141            "Offset of field: ",
1142            stringify!(blosc2_postfilter_params),
1143            "::",
1144            stringify!(typesize)
1145        )
1146    );
1147    assert_eq!(
1148        unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize },
1149        32usize,
1150        concat!(
1151            "Offset of field: ",
1152            stringify!(blosc2_postfilter_params),
1153            "::",
1154            stringify!(offset)
1155        )
1156    );
1157    assert_eq!(
1158        unsafe { ::std::ptr::addr_of!((*ptr).nchunk) as usize - ptr as usize },
1159        40usize,
1160        concat!(
1161            "Offset of field: ",
1162            stringify!(blosc2_postfilter_params),
1163            "::",
1164            stringify!(nchunk)
1165        )
1166    );
1167    assert_eq!(
1168        unsafe { ::std::ptr::addr_of!((*ptr).nblock) as usize - ptr as usize },
1169        48usize,
1170        concat!(
1171            "Offset of field: ",
1172            stringify!(blosc2_postfilter_params),
1173            "::",
1174            stringify!(nblock)
1175        )
1176    );
1177    assert_eq!(
1178        unsafe { ::std::ptr::addr_of!((*ptr).tid) as usize - ptr as usize },
1179        52usize,
1180        concat!(
1181            "Offset of field: ",
1182            stringify!(blosc2_postfilter_params),
1183            "::",
1184            stringify!(tid)
1185        )
1186    );
1187    assert_eq!(
1188        unsafe { ::std::ptr::addr_of!((*ptr).ttmp) as usize - ptr as usize },
1189        56usize,
1190        concat!(
1191            "Offset of field: ",
1192            stringify!(blosc2_postfilter_params),
1193            "::",
1194            stringify!(ttmp)
1195        )
1196    );
1197    assert_eq!(
1198        unsafe { ::std::ptr::addr_of!((*ptr).ttmp_nbytes) as usize - ptr as usize },
1199        64usize,
1200        concat!(
1201            "Offset of field: ",
1202            stringify!(blosc2_postfilter_params),
1203            "::",
1204            stringify!(ttmp_nbytes)
1205        )
1206    );
1207    assert_eq!(
1208        unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize },
1209        72usize,
1210        concat!(
1211            "Offset of field: ",
1212            stringify!(blosc2_postfilter_params),
1213            "::",
1214            stringify!(ctx)
1215        )
1216    );
1217}
1218#[doc = " @brief The type of the prefilter function.\n\n If the function call is successful, the return value should be 0; else, a negative value."]
1219pub type blosc2_prefilter_fn = ::std::option::Option<
1220    unsafe extern "C" fn(params: *mut blosc2_prefilter_params) -> ::std::os::raw::c_int,
1221>;
1222#[doc = " @brief The type of the postfilter function.\n\n If the function call is successful, the return value should be 0; else, a negative value."]
1223pub type blosc2_postfilter_fn = ::std::option::Option<
1224    unsafe extern "C" fn(params: *mut blosc2_postfilter_params) -> ::std::os::raw::c_int,
1225>;
1226#[doc = " @brief The parameters for creating a context for compression purposes.\n\n In parenthesis it is shown the default value used internally when a 0\n (zero) in the fields of the struct is passed to a function."]
1227#[repr(C)]
1228#[derive(Debug, Copy, Clone)]
1229pub struct blosc2_cparams {
1230    pub compcode: u8,
1231    pub compcode_meta: u8,
1232    pub clevel: u8,
1233    pub use_dict: ::std::os::raw::c_int,
1234    pub typesize: i32,
1235    pub nthreads: i16,
1236    pub blocksize: i32,
1237    pub splitmode: i32,
1238    pub schunk: *mut ::std::os::raw::c_void,
1239    pub filters: [u8; 6usize],
1240    pub filters_meta: [u8; 6usize],
1241    pub prefilter: blosc2_prefilter_fn,
1242    pub preparams: *mut blosc2_prefilter_params,
1243    pub tuner_params: *mut ::std::os::raw::c_void,
1244    pub tuner_id: ::std::os::raw::c_int,
1245    pub instr_codec: bool,
1246    pub codec_params: *mut ::std::os::raw::c_void,
1247    pub filter_params: [*mut ::std::os::raw::c_void; 6usize],
1248}
1249#[test]
1250fn bindgen_test_layout_blosc2_cparams() {
1251    const UNINIT: ::std::mem::MaybeUninit<blosc2_cparams> = ::std::mem::MaybeUninit::uninit();
1252    let ptr = UNINIT.as_ptr();
1253    assert_eq!(
1254        ::std::mem::size_of::<blosc2_cparams>(),
1255        136usize,
1256        concat!("Size of: ", stringify!(blosc2_cparams))
1257    );
1258    assert_eq!(
1259        ::std::mem::align_of::<blosc2_cparams>(),
1260        8usize,
1261        concat!("Alignment of ", stringify!(blosc2_cparams))
1262    );
1263    assert_eq!(
1264        unsafe { ::std::ptr::addr_of!((*ptr).compcode) as usize - ptr as usize },
1265        0usize,
1266        concat!(
1267            "Offset of field: ",
1268            stringify!(blosc2_cparams),
1269            "::",
1270            stringify!(compcode)
1271        )
1272    );
1273    assert_eq!(
1274        unsafe { ::std::ptr::addr_of!((*ptr).compcode_meta) as usize - ptr as usize },
1275        1usize,
1276        concat!(
1277            "Offset of field: ",
1278            stringify!(blosc2_cparams),
1279            "::",
1280            stringify!(compcode_meta)
1281        )
1282    );
1283    assert_eq!(
1284        unsafe { ::std::ptr::addr_of!((*ptr).clevel) as usize - ptr as usize },
1285        2usize,
1286        concat!(
1287            "Offset of field: ",
1288            stringify!(blosc2_cparams),
1289            "::",
1290            stringify!(clevel)
1291        )
1292    );
1293    assert_eq!(
1294        unsafe { ::std::ptr::addr_of!((*ptr).use_dict) as usize - ptr as usize },
1295        4usize,
1296        concat!(
1297            "Offset of field: ",
1298            stringify!(blosc2_cparams),
1299            "::",
1300            stringify!(use_dict)
1301        )
1302    );
1303    assert_eq!(
1304        unsafe { ::std::ptr::addr_of!((*ptr).typesize) as usize - ptr as usize },
1305        8usize,
1306        concat!(
1307            "Offset of field: ",
1308            stringify!(blosc2_cparams),
1309            "::",
1310            stringify!(typesize)
1311        )
1312    );
1313    assert_eq!(
1314        unsafe { ::std::ptr::addr_of!((*ptr).nthreads) as usize - ptr as usize },
1315        12usize,
1316        concat!(
1317            "Offset of field: ",
1318            stringify!(blosc2_cparams),
1319            "::",
1320            stringify!(nthreads)
1321        )
1322    );
1323    assert_eq!(
1324        unsafe { ::std::ptr::addr_of!((*ptr).blocksize) as usize - ptr as usize },
1325        16usize,
1326        concat!(
1327            "Offset of field: ",
1328            stringify!(blosc2_cparams),
1329            "::",
1330            stringify!(blocksize)
1331        )
1332    );
1333    assert_eq!(
1334        unsafe { ::std::ptr::addr_of!((*ptr).splitmode) as usize - ptr as usize },
1335        20usize,
1336        concat!(
1337            "Offset of field: ",
1338            stringify!(blosc2_cparams),
1339            "::",
1340            stringify!(splitmode)
1341        )
1342    );
1343    assert_eq!(
1344        unsafe { ::std::ptr::addr_of!((*ptr).schunk) as usize - ptr as usize },
1345        24usize,
1346        concat!(
1347            "Offset of field: ",
1348            stringify!(blosc2_cparams),
1349            "::",
1350            stringify!(schunk)
1351        )
1352    );
1353    assert_eq!(
1354        unsafe { ::std::ptr::addr_of!((*ptr).filters) as usize - ptr as usize },
1355        32usize,
1356        concat!(
1357            "Offset of field: ",
1358            stringify!(blosc2_cparams),
1359            "::",
1360            stringify!(filters)
1361        )
1362    );
1363    assert_eq!(
1364        unsafe { ::std::ptr::addr_of!((*ptr).filters_meta) as usize - ptr as usize },
1365        38usize,
1366        concat!(
1367            "Offset of field: ",
1368            stringify!(blosc2_cparams),
1369            "::",
1370            stringify!(filters_meta)
1371        )
1372    );
1373    assert_eq!(
1374        unsafe { ::std::ptr::addr_of!((*ptr).prefilter) as usize - ptr as usize },
1375        48usize,
1376        concat!(
1377            "Offset of field: ",
1378            stringify!(blosc2_cparams),
1379            "::",
1380            stringify!(prefilter)
1381        )
1382    );
1383    assert_eq!(
1384        unsafe { ::std::ptr::addr_of!((*ptr).preparams) as usize - ptr as usize },
1385        56usize,
1386        concat!(
1387            "Offset of field: ",
1388            stringify!(blosc2_cparams),
1389            "::",
1390            stringify!(preparams)
1391        )
1392    );
1393    assert_eq!(
1394        unsafe { ::std::ptr::addr_of!((*ptr).tuner_params) as usize - ptr as usize },
1395        64usize,
1396        concat!(
1397            "Offset of field: ",
1398            stringify!(blosc2_cparams),
1399            "::",
1400            stringify!(tuner_params)
1401        )
1402    );
1403    assert_eq!(
1404        unsafe { ::std::ptr::addr_of!((*ptr).tuner_id) as usize - ptr as usize },
1405        72usize,
1406        concat!(
1407            "Offset of field: ",
1408            stringify!(blosc2_cparams),
1409            "::",
1410            stringify!(tuner_id)
1411        )
1412    );
1413    assert_eq!(
1414        unsafe { ::std::ptr::addr_of!((*ptr).instr_codec) as usize - ptr as usize },
1415        76usize,
1416        concat!(
1417            "Offset of field: ",
1418            stringify!(blosc2_cparams),
1419            "::",
1420            stringify!(instr_codec)
1421        )
1422    );
1423    assert_eq!(
1424        unsafe { ::std::ptr::addr_of!((*ptr).codec_params) as usize - ptr as usize },
1425        80usize,
1426        concat!(
1427            "Offset of field: ",
1428            stringify!(blosc2_cparams),
1429            "::",
1430            stringify!(codec_params)
1431        )
1432    );
1433    assert_eq!(
1434        unsafe { ::std::ptr::addr_of!((*ptr).filter_params) as usize - ptr as usize },
1435        88usize,
1436        concat!(
1437            "Offset of field: ",
1438            stringify!(blosc2_cparams),
1439            "::",
1440            stringify!(filter_params)
1441        )
1442    );
1443}
1444#[doc = "@brief The parameters for creating a context for decompression purposes.\n\nIn parenthesis it is shown the default value used internally when a 0\n(zero) in the fields of the struct is passed to a function."]
1445#[repr(C)]
1446#[derive(Debug, Copy, Clone)]
1447pub struct blosc2_dparams {
1448    pub nthreads: i16,
1449    pub schunk: *mut ::std::os::raw::c_void,
1450    pub postfilter: blosc2_postfilter_fn,
1451    pub postparams: *mut blosc2_postfilter_params,
1452}
1453#[test]
1454fn bindgen_test_layout_blosc2_dparams() {
1455    const UNINIT: ::std::mem::MaybeUninit<blosc2_dparams> = ::std::mem::MaybeUninit::uninit();
1456    let ptr = UNINIT.as_ptr();
1457    assert_eq!(
1458        ::std::mem::size_of::<blosc2_dparams>(),
1459        32usize,
1460        concat!("Size of: ", stringify!(blosc2_dparams))
1461    );
1462    assert_eq!(
1463        ::std::mem::align_of::<blosc2_dparams>(),
1464        8usize,
1465        concat!("Alignment of ", stringify!(blosc2_dparams))
1466    );
1467    assert_eq!(
1468        unsafe { ::std::ptr::addr_of!((*ptr).nthreads) as usize - ptr as usize },
1469        0usize,
1470        concat!(
1471            "Offset of field: ",
1472            stringify!(blosc2_dparams),
1473            "::",
1474            stringify!(nthreads)
1475        )
1476    );
1477    assert_eq!(
1478        unsafe { ::std::ptr::addr_of!((*ptr).schunk) as usize - ptr as usize },
1479        8usize,
1480        concat!(
1481            "Offset of field: ",
1482            stringify!(blosc2_dparams),
1483            "::",
1484            stringify!(schunk)
1485        )
1486    );
1487    assert_eq!(
1488        unsafe { ::std::ptr::addr_of!((*ptr).postfilter) as usize - ptr as usize },
1489        16usize,
1490        concat!(
1491            "Offset of field: ",
1492            stringify!(blosc2_dparams),
1493            "::",
1494            stringify!(postfilter)
1495        )
1496    );
1497    assert_eq!(
1498        unsafe { ::std::ptr::addr_of!((*ptr).postparams) as usize - ptr as usize },
1499        24usize,
1500        concat!(
1501            "Offset of field: ",
1502            stringify!(blosc2_dparams),
1503            "::",
1504            stringify!(postparams)
1505        )
1506    );
1507}
1508extern "C" {
1509    #[doc = " @brief Create a context for @a *_ctx() compression functions.\n\n @param cparams The blosc2_cparams struct with the compression parameters.\n\n @return A pointer to the new context. NULL is returned if this fails.\n\n @note This supports the same environment variables than #blosc2_compress\n for overriding the programmatic compression values.\n\n @sa #blosc2_compress"]
1510    pub fn blosc2_create_cctx(cparams: blosc2_cparams) -> *mut blosc2_context;
1511}
1512extern "C" {
1513    #[doc = " @brief Create a context for *_ctx() decompression functions.\n\n @param dparams The blosc2_dparams struct with the decompression parameters.\n\n @return A pointer to the new context. NULL is returned if this fails.\n\n @note This supports the same environment variables than #blosc2_decompress\n for overriding the programmatic decompression values.\n\n @sa #blosc2_decompress\n"]
1514    pub fn blosc2_create_dctx(dparams: blosc2_dparams) -> *mut blosc2_context;
1515}
1516extern "C" {
1517    #[doc = " @brief Free the resources associated with a context.\n\n @param context The context to free.\n\n This function should always succeed and is valid for contexts meant for\n both compression and decompression."]
1518    pub fn blosc2_free_ctx(context: *mut blosc2_context);
1519}
1520extern "C" {
1521    #[doc = " @brief Create a @p cparams associated to a context.\n\n @param ctx The context from where to extract the compression parameters.\n @param cparams The pointer where the compression params will be stored.\n\n @return 0 if succeeds. Else a negative code is returned."]
1522    pub fn blosc2_ctx_get_cparams(
1523        ctx: *mut blosc2_context,
1524        cparams: *mut blosc2_cparams,
1525    ) -> ::std::os::raw::c_int;
1526}
1527extern "C" {
1528    #[doc = " @brief Create a @p dparams associated to a context.\n\n @param ctx The context from where to extract the decompression parameters.\n @param dparams The pointer where the decompression params will be stored.\n\n @return 0 if succeeds. Else a negative code is returned."]
1529    pub fn blosc2_ctx_get_dparams(
1530        ctx: *mut blosc2_context,
1531        dparams: *mut blosc2_dparams,
1532    ) -> ::std::os::raw::c_int;
1533}
1534extern "C" {
1535    #[doc = " @brief Set a maskout so as to avoid decompressing specified blocks.\n\n @param ctx The decompression context to update.\n\n @param maskout The boolean mask for the blocks where decompression\n is to be avoided.\n\n @remark The maskout is valid for contexts *only* meant for decompressing\n a chunk via #blosc2_decompress_ctx.  Once a call to #blosc2_decompress_ctx\n is done, this mask is reset so that next call to #blosc2_decompress_ctx\n will decompress the whole chunk.\n\n @param nblocks The number of blocks in maskout above.\n\n @return If success, a 0 is returned.  An error is signaled with a negative int.\n"]
1536    pub fn blosc2_set_maskout(
1537        ctx: *mut blosc2_context,
1538        maskout: *mut bool,
1539        nblocks: ::std::os::raw::c_int,
1540    ) -> ::std::os::raw::c_int;
1541}
1542extern "C" {
1543    pub fn blosc2_compress(
1544        clevel: ::std::os::raw::c_int,
1545        doshuffle: ::std::os::raw::c_int,
1546        typesize: i32,
1547        src: *const ::std::os::raw::c_void,
1548        srcsize: i32,
1549        dest: *mut ::std::os::raw::c_void,
1550        destsize: i32,
1551    ) -> ::std::os::raw::c_int;
1552}
1553extern "C" {
1554    #[doc = " @brief Decompress a block of compressed data in @p src, put the result in\n @p dest and returns the size of the decompressed block.\n\n @warning The @p src buffer and the @p dest buffer can not overlap.\n\n @remark Decompression is memory safe and guaranteed not to write the @p dest\n buffer more than what is specified in @p destsize.\n\n @remark In case you want to keep under control the number of bytes read from\n source, you can call #blosc1_cbuffer_sizes first to check whether the\n @p nbytes (i.e. the number of bytes to be read from @p src buffer by this\n function) in the compressed buffer is ok with you.\n\n @param src The buffer to be decompressed.\n @param srcsize The size of the buffer to be decompressed.\n @param dest The buffer where the decompressed data will be put.\n @param destsize The size of the @p dest buffer.\n\n @return The number of bytes decompressed.\n If an error occurs, e.g. the compressed data is corrupted or the\n output buffer is not large enough, then a negative value\n will be returned instead."]
1555    pub fn blosc2_decompress(
1556        src: *const ::std::os::raw::c_void,
1557        srcsize: i32,
1558        dest: *mut ::std::os::raw::c_void,
1559        destsize: i32,
1560    ) -> ::std::os::raw::c_int;
1561}
1562extern "C" {
1563    #[doc = " @brief Context interface to Blosc compression. This does not require a call\n to #blosc2_init and can be called from multithreaded applications\n without the global lock being used, so allowing Blosc be executed\n simultaneously in those scenarios.\n\n @param context A blosc2_context struct with the different compression params.\n @param src The buffer containing the data to be compressed.\n @param srcsize The number of bytes to be compressed from the @p src buffer.\n @param dest The buffer where the compressed data will be put.\n @param destsize The size in bytes of the @p dest buffer.\n\n @return The number of bytes compressed.\n If @p src buffer cannot be compressed into @p destsize, the return\n value is zero and you should discard the contents of the @p dest\n buffer.  A negative return value means that an internal error happened.\n It could happen that context is not meant for compression (which is stated in stderr).\n Otherwise, please report it back together with the buffer data causing this\n and compression settings."]
1564    pub fn blosc2_compress_ctx(
1565        context: *mut blosc2_context,
1566        src: *const ::std::os::raw::c_void,
1567        srcsize: i32,
1568        dest: *mut ::std::os::raw::c_void,
1569        destsize: i32,
1570    ) -> ::std::os::raw::c_int;
1571}
1572extern "C" {
1573    #[doc = " @brief Context interface to Blosc decompression. This does not require a\n call to #blosc2_init and can be called from multithreaded\n applications without the global lock being used, so allowing Blosc\n be executed simultaneously in those scenarios.\n\n @param context The blosc2_context struct with the different compression params.\n @param src The buffer of compressed data.\n @param srcsize The length of buffer of compressed data.\n @param dest The buffer where the decompressed data will be put.\n @param destsize The size in bytes of the @p dest buffer.\n\n @warning The @p src buffer and the @p dest buffer can not overlap.\n\n @remark Decompression is memory safe and guaranteed not to write the @p dest\n buffer more than what is specified in @p destsize.\n\n @remark In case you want to keep under control the number of bytes read from\n source, you can call #blosc1_cbuffer_sizes first to check the @p nbytes\n (i.e. the number of bytes to be read from @p src buffer by this function)\n in the compressed buffer.\n\n @remark If #blosc2_set_maskout is called prior to this function, its\n @p block_maskout parameter will be honored for just *one single* shot;\n i.e. the maskout in context will be automatically reset to NULL, so\n mask won't be used next time (unless #blosc2_set_maskout is called again).\n\n @return The number of bytes decompressed (i.e. the maskout blocks are not\n counted). If an error occurs, e.g. the compressed data is corrupted,\n @p destsize is not large enough or context is not meant for decompression,\n then a negative value will be returned instead."]
1574    pub fn blosc2_decompress_ctx(
1575        context: *mut blosc2_context,
1576        src: *const ::std::os::raw::c_void,
1577        srcsize: i32,
1578        dest: *mut ::std::os::raw::c_void,
1579        destsize: i32,
1580    ) -> ::std::os::raw::c_int;
1581}
1582extern "C" {
1583    #[doc = " @brief Create a chunk made of zeros.\n\n @param cparams The compression parameters.\n @param nbytes The size (in bytes) of the chunk.\n @param dest The buffer where the data chunk will be put.\n @param destsize The size (in bytes) of the @p dest buffer;\n must be BLOSC_EXTENDED_HEADER_LENGTH at least.\n\n @return The number of bytes compressed (BLOSC_EXTENDED_HEADER_LENGTH).\n If negative, there has been an error and @p dest is unusable."]
1584    pub fn blosc2_chunk_zeros(
1585        cparams: blosc2_cparams,
1586        nbytes: i32,
1587        dest: *mut ::std::os::raw::c_void,
1588        destsize: i32,
1589    ) -> ::std::os::raw::c_int;
1590}
1591extern "C" {
1592    #[doc = " @brief Create a chunk made of nans.\n\n @param cparams The compression parameters;\n only 4 bytes (float) and 8 bytes (double) are supported.\n @param nbytes The size (in bytes) of the chunk.\n @param dest The buffer where the data chunk will be put.\n @param destsize The size (in bytes) of the @p dest buffer;\n must be BLOSC_EXTENDED_HEADER_LENGTH at least.\n\n @note Whether the NaNs are floats or doubles will be given by the typesize.\n\n @return The number of bytes compressed (BLOSC_EXTENDED_HEADER_LENGTH).\n If negative, there has been an error and @p dest is unusable."]
1593    pub fn blosc2_chunk_nans(
1594        cparams: blosc2_cparams,
1595        nbytes: i32,
1596        dest: *mut ::std::os::raw::c_void,
1597        destsize: i32,
1598    ) -> ::std::os::raw::c_int;
1599}
1600extern "C" {
1601    #[doc = " @brief Create a chunk made of repeated values.\n\n @param cparams The compression parameters.\n @param nbytes The size (in bytes) of the chunk.\n @param dest The buffer where the data chunk will be put.\n @param destsize The size (in bytes) of the @p dest buffer.\n @param repeatval A pointer to the repeated value (little endian).\n The size of the value is given by @p cparams.typesize param.\n\n @return The number of bytes compressed (BLOSC_EXTENDED_HEADER_LENGTH + typesize).\n If negative, there has been an error and @p dest is unusable."]
1602    pub fn blosc2_chunk_repeatval(
1603        cparams: blosc2_cparams,
1604        nbytes: i32,
1605        dest: *mut ::std::os::raw::c_void,
1606        destsize: i32,
1607        repeatval: *const ::std::os::raw::c_void,
1608    ) -> ::std::os::raw::c_int;
1609}
1610extern "C" {
1611    #[doc = " @brief Create a chunk made of uninitialized values.\n\n @param cparams The compression parameters.\n @param nbytes The size (in bytes) of the chunk.\n @param dest The buffer where the data chunk will be put.\n @param destsize The size (in bytes) of the @p dest buffer;\n must be BLOSC_EXTENDED_HEADER_LENGTH at least.\n\n @return The number of bytes compressed (BLOSC_EXTENDED_HEADER_LENGTH).\n If negative, there has been an error and @p dest is unusable."]
1612    pub fn blosc2_chunk_uninit(
1613        cparams: blosc2_cparams,
1614        nbytes: i32,
1615        dest: *mut ::std::os::raw::c_void,
1616        destsize: i32,
1617    ) -> ::std::os::raw::c_int;
1618}
1619extern "C" {
1620    #[doc = " @brief Context interface counterpart for #blosc1_getitem.\n\n @param context Context pointer.\n @param src The compressed buffer from data will be decompressed.\n @param srcsize Compressed buffer length.\n @param start The position of the first item (of @p typesize size) from where data\n will be retrieved.\n @param nitems The number of items (of @p typesize size) that will be retrieved.\n @param dest The buffer where the decompressed data retrieved will be put.\n @param destsize Output buffer length.\n\n @return The number of bytes copied to @p dest or a negative value if\n some error happens."]
1621    pub fn blosc2_getitem_ctx(
1622        context: *mut blosc2_context,
1623        src: *const ::std::os::raw::c_void,
1624        srcsize: i32,
1625        start: ::std::os::raw::c_int,
1626        nitems: ::std::os::raw::c_int,
1627        dest: *mut ::std::os::raw::c_void,
1628        destsize: i32,
1629    ) -> ::std::os::raw::c_int;
1630}
1631#[doc = " @brief This struct is meant for holding storage parameters for a\n for a blosc2 container, allowing to specify, for example, how to interpret\n the contents included in the schunk."]
1632#[repr(C)]
1633#[derive(Debug, Copy, Clone)]
1634pub struct blosc2_storage {
1635    pub contiguous: bool,
1636    pub urlpath: *mut ::std::os::raw::c_char,
1637    pub cparams: *mut blosc2_cparams,
1638    pub dparams: *mut blosc2_dparams,
1639    pub io: *mut blosc2_io,
1640}
1641#[test]
1642fn bindgen_test_layout_blosc2_storage() {
1643    const UNINIT: ::std::mem::MaybeUninit<blosc2_storage> = ::std::mem::MaybeUninit::uninit();
1644    let ptr = UNINIT.as_ptr();
1645    assert_eq!(
1646        ::std::mem::size_of::<blosc2_storage>(),
1647        40usize,
1648        concat!("Size of: ", stringify!(blosc2_storage))
1649    );
1650    assert_eq!(
1651        ::std::mem::align_of::<blosc2_storage>(),
1652        8usize,
1653        concat!("Alignment of ", stringify!(blosc2_storage))
1654    );
1655    assert_eq!(
1656        unsafe { ::std::ptr::addr_of!((*ptr).contiguous) as usize - ptr as usize },
1657        0usize,
1658        concat!(
1659            "Offset of field: ",
1660            stringify!(blosc2_storage),
1661            "::",
1662            stringify!(contiguous)
1663        )
1664    );
1665    assert_eq!(
1666        unsafe { ::std::ptr::addr_of!((*ptr).urlpath) as usize - ptr as usize },
1667        8usize,
1668        concat!(
1669            "Offset of field: ",
1670            stringify!(blosc2_storage),
1671            "::",
1672            stringify!(urlpath)
1673        )
1674    );
1675    assert_eq!(
1676        unsafe { ::std::ptr::addr_of!((*ptr).cparams) as usize - ptr as usize },
1677        16usize,
1678        concat!(
1679            "Offset of field: ",
1680            stringify!(blosc2_storage),
1681            "::",
1682            stringify!(cparams)
1683        )
1684    );
1685    assert_eq!(
1686        unsafe { ::std::ptr::addr_of!((*ptr).dparams) as usize - ptr as usize },
1687        24usize,
1688        concat!(
1689            "Offset of field: ",
1690            stringify!(blosc2_storage),
1691            "::",
1692            stringify!(dparams)
1693        )
1694    );
1695    assert_eq!(
1696        unsafe { ::std::ptr::addr_of!((*ptr).io) as usize - ptr as usize },
1697        32usize,
1698        concat!(
1699            "Offset of field: ",
1700            stringify!(blosc2_storage),
1701            "::",
1702            stringify!(io)
1703        )
1704    );
1705}
1706extern "C" {
1707    #[doc = " @brief Default struct for #blosc2_storage meant for user initialization."]
1708    pub static BLOSC2_STORAGE_DEFAULTS: blosc2_storage;
1709}
1710#[repr(C)]
1711#[derive(Debug, Copy, Clone)]
1712pub struct blosc2_frame_s {
1713    _unused: [u8; 0],
1714}
1715pub type blosc2_frame = blosc2_frame_s;
1716#[doc = " @brief This struct is meant to store metadata information inside\n a #blosc2_schunk, allowing to specify, for example, how to interpret\n the contents included in the schunk."]
1717#[repr(C)]
1718#[derive(Debug, Copy, Clone)]
1719pub struct blosc2_metalayer {
1720    #[doc = "!< The metalayer identifier for Blosc client (e.g. Blosc2 NDim)."]
1721    pub name: *mut ::std::os::raw::c_char,
1722    #[doc = "!< The serialized (msgpack preferably) content of the metalayer."]
1723    pub content: *mut u8,
1724    #[doc = "!< The length in bytes of the content."]
1725    pub content_len: i32,
1726}
1727#[test]
1728fn bindgen_test_layout_blosc2_metalayer() {
1729    const UNINIT: ::std::mem::MaybeUninit<blosc2_metalayer> = ::std::mem::MaybeUninit::uninit();
1730    let ptr = UNINIT.as_ptr();
1731    assert_eq!(
1732        ::std::mem::size_of::<blosc2_metalayer>(),
1733        24usize,
1734        concat!("Size of: ", stringify!(blosc2_metalayer))
1735    );
1736    assert_eq!(
1737        ::std::mem::align_of::<blosc2_metalayer>(),
1738        8usize,
1739        concat!("Alignment of ", stringify!(blosc2_metalayer))
1740    );
1741    assert_eq!(
1742        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
1743        0usize,
1744        concat!(
1745            "Offset of field: ",
1746            stringify!(blosc2_metalayer),
1747            "::",
1748            stringify!(name)
1749        )
1750    );
1751    assert_eq!(
1752        unsafe { ::std::ptr::addr_of!((*ptr).content) as usize - ptr as usize },
1753        8usize,
1754        concat!(
1755            "Offset of field: ",
1756            stringify!(blosc2_metalayer),
1757            "::",
1758            stringify!(content)
1759        )
1760    );
1761    assert_eq!(
1762        unsafe { ::std::ptr::addr_of!((*ptr).content_len) as usize - ptr as usize },
1763        16usize,
1764        concat!(
1765            "Offset of field: ",
1766            stringify!(blosc2_metalayer),
1767            "::",
1768            stringify!(content_len)
1769        )
1770    );
1771}
1772#[doc = " @brief This struct is the standard container for Blosc 2 compressed data.\n\n This is essentially a container for Blosc 1 chunks of compressed data,\n and it allows to overcome the 32-bit limitation in Blosc 1. Optionally,\n a #blosc2_frame can be attached so as to store the compressed chunks contiguously."]
1773#[repr(C)]
1774#[derive(Debug, Copy, Clone)]
1775pub struct blosc2_schunk {
1776    pub version: u8,
1777    pub compcode: u8,
1778    pub compcode_meta: u8,
1779    pub clevel: u8,
1780    pub splitmode: u8,
1781    pub typesize: i32,
1782    pub blocksize: i32,
1783    pub chunksize: i32,
1784    pub filters: [u8; 6usize],
1785    pub filters_meta: [u8; 6usize],
1786    pub nchunks: i64,
1787    pub current_nchunk: i64,
1788    pub nbytes: i64,
1789    pub cbytes: i64,
1790    pub data: *mut *mut u8,
1791    pub data_len: usize,
1792    pub storage: *mut blosc2_storage,
1793    pub frame: *mut blosc2_frame,
1794    pub cctx: *mut blosc2_context,
1795    pub dctx: *mut blosc2_context,
1796    pub metalayers: [*mut blosc2_metalayer; 16usize],
1797    pub nmetalayers: u16,
1798    pub vlmetalayers: [*mut blosc2_metalayer; 8192usize],
1799    pub nvlmetalayers: i16,
1800    pub tuner_params: *mut ::std::os::raw::c_void,
1801    pub tuner_id: ::std::os::raw::c_int,
1802    pub ndim: i8,
1803    pub blockshape: *mut i64,
1804}
1805#[test]
1806fn bindgen_test_layout_blosc2_schunk() {
1807    const UNINIT: ::std::mem::MaybeUninit<blosc2_schunk> = ::std::mem::MaybeUninit::uninit();
1808    let ptr = UNINIT.as_ptr();
1809    assert_eq!(
1810        ::std::mem::size_of::<blosc2_schunk>(),
1811        65816usize,
1812        concat!("Size of: ", stringify!(blosc2_schunk))
1813    );
1814    assert_eq!(
1815        ::std::mem::align_of::<blosc2_schunk>(),
1816        8usize,
1817        concat!("Alignment of ", stringify!(blosc2_schunk))
1818    );
1819    assert_eq!(
1820        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
1821        0usize,
1822        concat!(
1823            "Offset of field: ",
1824            stringify!(blosc2_schunk),
1825            "::",
1826            stringify!(version)
1827        )
1828    );
1829    assert_eq!(
1830        unsafe { ::std::ptr::addr_of!((*ptr).compcode) as usize - ptr as usize },
1831        1usize,
1832        concat!(
1833            "Offset of field: ",
1834            stringify!(blosc2_schunk),
1835            "::",
1836            stringify!(compcode)
1837        )
1838    );
1839    assert_eq!(
1840        unsafe { ::std::ptr::addr_of!((*ptr).compcode_meta) as usize - ptr as usize },
1841        2usize,
1842        concat!(
1843            "Offset of field: ",
1844            stringify!(blosc2_schunk),
1845            "::",
1846            stringify!(compcode_meta)
1847        )
1848    );
1849    assert_eq!(
1850        unsafe { ::std::ptr::addr_of!((*ptr).clevel) as usize - ptr as usize },
1851        3usize,
1852        concat!(
1853            "Offset of field: ",
1854            stringify!(blosc2_schunk),
1855            "::",
1856            stringify!(clevel)
1857        )
1858    );
1859    assert_eq!(
1860        unsafe { ::std::ptr::addr_of!((*ptr).splitmode) as usize - ptr as usize },
1861        4usize,
1862        concat!(
1863            "Offset of field: ",
1864            stringify!(blosc2_schunk),
1865            "::",
1866            stringify!(splitmode)
1867        )
1868    );
1869    assert_eq!(
1870        unsafe { ::std::ptr::addr_of!((*ptr).typesize) as usize - ptr as usize },
1871        8usize,
1872        concat!(
1873            "Offset of field: ",
1874            stringify!(blosc2_schunk),
1875            "::",
1876            stringify!(typesize)
1877        )
1878    );
1879    assert_eq!(
1880        unsafe { ::std::ptr::addr_of!((*ptr).blocksize) as usize - ptr as usize },
1881        12usize,
1882        concat!(
1883            "Offset of field: ",
1884            stringify!(blosc2_schunk),
1885            "::",
1886            stringify!(blocksize)
1887        )
1888    );
1889    assert_eq!(
1890        unsafe { ::std::ptr::addr_of!((*ptr).chunksize) as usize - ptr as usize },
1891        16usize,
1892        concat!(
1893            "Offset of field: ",
1894            stringify!(blosc2_schunk),
1895            "::",
1896            stringify!(chunksize)
1897        )
1898    );
1899    assert_eq!(
1900        unsafe { ::std::ptr::addr_of!((*ptr).filters) as usize - ptr as usize },
1901        20usize,
1902        concat!(
1903            "Offset of field: ",
1904            stringify!(blosc2_schunk),
1905            "::",
1906            stringify!(filters)
1907        )
1908    );
1909    assert_eq!(
1910        unsafe { ::std::ptr::addr_of!((*ptr).filters_meta) as usize - ptr as usize },
1911        26usize,
1912        concat!(
1913            "Offset of field: ",
1914            stringify!(blosc2_schunk),
1915            "::",
1916            stringify!(filters_meta)
1917        )
1918    );
1919    assert_eq!(
1920        unsafe { ::std::ptr::addr_of!((*ptr).nchunks) as usize - ptr as usize },
1921        32usize,
1922        concat!(
1923            "Offset of field: ",
1924            stringify!(blosc2_schunk),
1925            "::",
1926            stringify!(nchunks)
1927        )
1928    );
1929    assert_eq!(
1930        unsafe { ::std::ptr::addr_of!((*ptr).current_nchunk) as usize - ptr as usize },
1931        40usize,
1932        concat!(
1933            "Offset of field: ",
1934            stringify!(blosc2_schunk),
1935            "::",
1936            stringify!(current_nchunk)
1937        )
1938    );
1939    assert_eq!(
1940        unsafe { ::std::ptr::addr_of!((*ptr).nbytes) as usize - ptr as usize },
1941        48usize,
1942        concat!(
1943            "Offset of field: ",
1944            stringify!(blosc2_schunk),
1945            "::",
1946            stringify!(nbytes)
1947        )
1948    );
1949    assert_eq!(
1950        unsafe { ::std::ptr::addr_of!((*ptr).cbytes) as usize - ptr as usize },
1951        56usize,
1952        concat!(
1953            "Offset of field: ",
1954            stringify!(blosc2_schunk),
1955            "::",
1956            stringify!(cbytes)
1957        )
1958    );
1959    assert_eq!(
1960        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
1961        64usize,
1962        concat!(
1963            "Offset of field: ",
1964            stringify!(blosc2_schunk),
1965            "::",
1966            stringify!(data)
1967        )
1968    );
1969    assert_eq!(
1970        unsafe { ::std::ptr::addr_of!((*ptr).data_len) as usize - ptr as usize },
1971        72usize,
1972        concat!(
1973            "Offset of field: ",
1974            stringify!(blosc2_schunk),
1975            "::",
1976            stringify!(data_len)
1977        )
1978    );
1979    assert_eq!(
1980        unsafe { ::std::ptr::addr_of!((*ptr).storage) as usize - ptr as usize },
1981        80usize,
1982        concat!(
1983            "Offset of field: ",
1984            stringify!(blosc2_schunk),
1985            "::",
1986            stringify!(storage)
1987        )
1988    );
1989    assert_eq!(
1990        unsafe { ::std::ptr::addr_of!((*ptr).frame) as usize - ptr as usize },
1991        88usize,
1992        concat!(
1993            "Offset of field: ",
1994            stringify!(blosc2_schunk),
1995            "::",
1996            stringify!(frame)
1997        )
1998    );
1999    assert_eq!(
2000        unsafe { ::std::ptr::addr_of!((*ptr).cctx) as usize - ptr as usize },
2001        96usize,
2002        concat!(
2003            "Offset of field: ",
2004            stringify!(blosc2_schunk),
2005            "::",
2006            stringify!(cctx)
2007        )
2008    );
2009    assert_eq!(
2010        unsafe { ::std::ptr::addr_of!((*ptr).dctx) as usize - ptr as usize },
2011        104usize,
2012        concat!(
2013            "Offset of field: ",
2014            stringify!(blosc2_schunk),
2015            "::",
2016            stringify!(dctx)
2017        )
2018    );
2019    assert_eq!(
2020        unsafe { ::std::ptr::addr_of!((*ptr).metalayers) as usize - ptr as usize },
2021        112usize,
2022        concat!(
2023            "Offset of field: ",
2024            stringify!(blosc2_schunk),
2025            "::",
2026            stringify!(metalayers)
2027        )
2028    );
2029    assert_eq!(
2030        unsafe { ::std::ptr::addr_of!((*ptr).nmetalayers) as usize - ptr as usize },
2031        240usize,
2032        concat!(
2033            "Offset of field: ",
2034            stringify!(blosc2_schunk),
2035            "::",
2036            stringify!(nmetalayers)
2037        )
2038    );
2039    assert_eq!(
2040        unsafe { ::std::ptr::addr_of!((*ptr).vlmetalayers) as usize - ptr as usize },
2041        248usize,
2042        concat!(
2043            "Offset of field: ",
2044            stringify!(blosc2_schunk),
2045            "::",
2046            stringify!(vlmetalayers)
2047        )
2048    );
2049    assert_eq!(
2050        unsafe { ::std::ptr::addr_of!((*ptr).nvlmetalayers) as usize - ptr as usize },
2051        65784usize,
2052        concat!(
2053            "Offset of field: ",
2054            stringify!(blosc2_schunk),
2055            "::",
2056            stringify!(nvlmetalayers)
2057        )
2058    );
2059    assert_eq!(
2060        unsafe { ::std::ptr::addr_of!((*ptr).tuner_params) as usize - ptr as usize },
2061        65792usize,
2062        concat!(
2063            "Offset of field: ",
2064            stringify!(blosc2_schunk),
2065            "::",
2066            stringify!(tuner_params)
2067        )
2068    );
2069    assert_eq!(
2070        unsafe { ::std::ptr::addr_of!((*ptr).tuner_id) as usize - ptr as usize },
2071        65800usize,
2072        concat!(
2073            "Offset of field: ",
2074            stringify!(blosc2_schunk),
2075            "::",
2076            stringify!(tuner_id)
2077        )
2078    );
2079    assert_eq!(
2080        unsafe { ::std::ptr::addr_of!((*ptr).ndim) as usize - ptr as usize },
2081        65804usize,
2082        concat!(
2083            "Offset of field: ",
2084            stringify!(blosc2_schunk),
2085            "::",
2086            stringify!(ndim)
2087        )
2088    );
2089    assert_eq!(
2090        unsafe { ::std::ptr::addr_of!((*ptr).blockshape) as usize - ptr as usize },
2091        65808usize,
2092        concat!(
2093            "Offset of field: ",
2094            stringify!(blosc2_schunk),
2095            "::",
2096            stringify!(blockshape)
2097        )
2098    );
2099}
2100extern "C" {
2101    #[doc = " @brief Create a new super-chunk.\n\n @param storage The storage properties.\n\n @remark In case that storage.urlpath is not NULL, the data is stored\n on-disk.  If the data file(s) exist, they are *overwritten*.\n\n @return The new super-chunk."]
2102    pub fn blosc2_schunk_new(storage: *mut blosc2_storage) -> *mut blosc2_schunk;
2103}
2104extern "C" {
2105    #[doc = " Create a copy of a super-chunk.\n\n @param schunk The super-chunk to be copied.\n @param storage The storage properties.\n\n @return The new super-chunk."]
2106    pub fn blosc2_schunk_copy(
2107        schunk: *mut blosc2_schunk,
2108        storage: *mut blosc2_storage,
2109    ) -> *mut blosc2_schunk;
2110}
2111extern "C" {
2112    #[doc = " @brief Create a super-chunk out of a contiguous frame buffer.\n\n @param cframe The buffer of the in-memory frame.\n @param copy Whether the super-chunk should make a copy of\n the @p cframe data or not.  The copy will be made to an internal\n sparse frame.\n\n @remark If copy is false, the @p cframe buffer passed will be owned\n by the super-chunk and will be automatically freed when\n blosc2_schunk_free() is called.  If the user frees it after the\n opening, bad things will happen.  Don't do that (or set @p copy).\n\n @param len The length of the buffer (in bytes).\n\n @return The new super-chunk."]
2113    pub fn blosc2_schunk_from_buffer(cframe: *mut u8, len: i64, copy: bool) -> *mut blosc2_schunk;
2114}
2115extern "C" {
2116    #[doc = " @brief Set the private `avoid_cframe_free` field in a frame.\n\n @param schunk The super-chunk referencing the frame.\n @param avoid_cframe_free The value to set in the blosc2_frame_s structure.\n\n @warning If you set it to `true` you will be responsible of freeing it."]
2117    pub fn blosc2_schunk_avoid_cframe_free(schunk: *mut blosc2_schunk, avoid_cframe_free: bool);
2118}
2119extern "C" {
2120    #[doc = " @brief Open an existing super-chunk that is on-disk (frame). No in-memory copy is made.\n\n @param urlpath The file name.\n\n @return The new super-chunk.  NULL if not found or not in frame format."]
2121    pub fn blosc2_schunk_open(urlpath: *const ::std::os::raw::c_char) -> *mut blosc2_schunk;
2122}
2123extern "C" {
2124    #[doc = " @brief Open an existing super-chunk that is on-disk (frame). No in-memory copy is made.\n\n @param urlpath The file name.\n\n @param offset The frame offset.\n\n @return The new super-chunk.  NULL if not found or not in frame format."]
2125    pub fn blosc2_schunk_open_offset(
2126        urlpath: *const ::std::os::raw::c_char,
2127        offset: i64,
2128    ) -> *mut blosc2_schunk;
2129}
2130extern "C" {
2131    #[doc = " @brief Open an existing super-chunk (no copy is made) using a user-defined I/O interface.\n\n @param urlpath The file name.\n\n @param udio The user-defined I/O interface.\n\n @return The new super-chunk."]
2132    pub fn blosc2_schunk_open_udio(
2133        urlpath: *const ::std::os::raw::c_char,
2134        udio: *const blosc2_io,
2135    ) -> *mut blosc2_schunk;
2136}
2137extern "C" {
2138    pub fn blosc2_schunk_to_buffer(
2139        schunk: *mut blosc2_schunk,
2140        cframe: *mut *mut u8,
2141        needs_free: *mut bool,
2142    ) -> i64;
2143}
2144extern "C" {
2145    pub fn blosc2_schunk_to_file(
2146        schunk: *mut blosc2_schunk,
2147        urlpath: *const ::std::os::raw::c_char,
2148    ) -> i64;
2149}
2150extern "C" {
2151    pub fn blosc2_schunk_append_file(
2152        schunk: *mut blosc2_schunk,
2153        urlpath: *const ::std::os::raw::c_char,
2154    ) -> i64;
2155}
2156extern "C" {
2157    #[doc = " @brief Release resources from a super-chunk.\n\n @param schunk The super-chunk to be freed.\n\n @remark All the memory resources attached to the super-chunk are freed.\n If the super-chunk is on-disk, the data continues there for a later\n re-opening.\n\n @return 0 if success."]
2158    pub fn blosc2_schunk_free(schunk: *mut blosc2_schunk) -> ::std::os::raw::c_int;
2159}
2160extern "C" {
2161    #[doc = " @brief Append an existing @p chunk to a super-chunk.\n\n @param schunk The super-chunk where the chunk will be appended.\n @param chunk The @p chunk to append.  An internal copy is made, so @p chunk can be reused or\n freed if desired.\n @param copy Whether the chunk should be copied internally or can be used as-is.\n\n @return The number of chunks in super-chunk. If some problem is\n detected, this number will be negative."]
2162    pub fn blosc2_schunk_append_chunk(
2163        schunk: *mut blosc2_schunk,
2164        chunk: *mut u8,
2165        copy: bool,
2166    ) -> i64;
2167}
2168extern "C" {
2169    #[doc = " @brief Update a chunk at a specific position in a super-chunk.\n\n @param schunk The super-chunk where the chunk will be updated.\n @param nchunk The position where the chunk will be updated.\n @param chunk The new @p chunk. If an internal copy is made, the @p chunk can be reused or\n freed if desired.\n @param copy Whether the chunk should be copied internally or can be used as-is.\n\n @return The number of chunks in super-chunk. If some problem is\n detected, this number will be negative."]
2170    pub fn blosc2_schunk_update_chunk(
2171        schunk: *mut blosc2_schunk,
2172        nchunk: i64,
2173        chunk: *mut u8,
2174        copy: bool,
2175    ) -> i64;
2176}
2177extern "C" {
2178    #[doc = " @brief Insert a chunk at a specific position in a super-chunk.\n\n @param schunk The super-chunk where the chunk will be appended.\n @param nchunk The position where the chunk will be inserted.\n @param chunk The @p chunk to insert. If an internal copy is made, the @p chunk can be reused or\n freed if desired.\n @param copy Whether the chunk should be copied internally or can be used as-is.\n\n @return The number of chunks in super-chunk. If some problem is\n detected, this number will be negative."]
2179    pub fn blosc2_schunk_insert_chunk(
2180        schunk: *mut blosc2_schunk,
2181        nchunk: i64,
2182        chunk: *mut u8,
2183        copy: bool,
2184    ) -> i64;
2185}
2186extern "C" {
2187    #[doc = " @brief Delete a chunk at a specific position in a super-chunk.\n\n @param schunk The super-chunk where the chunk will be deleted.\n @param nchunk The position where the chunk will be deleted.\n\n @return The number of chunks in super-chunk. If some problem is\n detected, this number will be negative."]
2188    pub fn blosc2_schunk_delete_chunk(schunk: *mut blosc2_schunk, nchunk: i64) -> i64;
2189}
2190extern "C" {
2191    #[doc = " @brief Append a @p src data buffer to a super-chunk.\n\n @param schunk The super-chunk where data will be appended.\n @param src The buffer of data to compress.\n @param nbytes The size of the @p src buffer.\n\n @return The number of chunks in super-chunk. If some problem is\n detected, this number will be negative."]
2192    pub fn blosc2_schunk_append_buffer(
2193        schunk: *mut blosc2_schunk,
2194        src: *mut ::std::os::raw::c_void,
2195        nbytes: i32,
2196    ) -> i64;
2197}
2198extern "C" {
2199    #[doc = " @brief Decompress and return the @p nchunk chunk of a super-chunk.\n\n If the chunk is uncompressed successfully, it is put in the @p *dest\n pointer.\n\n @param schunk The super-chunk from where the chunk will be decompressed.\n @param nchunk The chunk to be decompressed (0 indexed).\n @param dest The buffer where the decompressed data will be put.\n @param nbytes The size of the area pointed by @p *dest.\n\n @warning You must make sure that you have enough space to store the\n uncompressed data.\n\n @return The size of the decompressed chunk or 0 if it is non-initialized. If some problem is\n detected, a negative code is returned instead."]
2200    pub fn blosc2_schunk_decompress_chunk(
2201        schunk: *mut blosc2_schunk,
2202        nchunk: i64,
2203        dest: *mut ::std::os::raw::c_void,
2204        nbytes: i32,
2205    ) -> ::std::os::raw::c_int;
2206}
2207extern "C" {
2208    #[doc = " @brief Return a compressed chunk that is part of a super-chunk in the @p chunk parameter.\n\n @param schunk The super-chunk from where to extract a chunk.\n @param nchunk The chunk to be extracted (0 indexed).\n @param chunk The pointer to the chunk of compressed data.\n @param needs_free The pointer to a boolean indicating if it is the user's\n responsibility to free the chunk returned or not.\n\n @warning If the super-chunk is backed by a frame that is disk-based, a buffer is allocated for the\n (compressed) chunk, and hence a free is needed.\n You can check whether the chunk requires a free with the @p needs_free parameter.\n If the chunk does not need a free, it means that a pointer to the location in the super-chunk\n (or the backing in-memory frame) is returned in the @p chunk parameter.\n\n @return The size of the (compressed) chunk or 0 if it is non-initialized. If some problem is\n detected, a negative code is returned instead."]
2209    pub fn blosc2_schunk_get_chunk(
2210        schunk: *mut blosc2_schunk,
2211        nchunk: i64,
2212        chunk: *mut *mut u8,
2213        needs_free: *mut bool,
2214    ) -> ::std::os::raw::c_int;
2215}
2216extern "C" {
2217    #[doc = " @brief Return a (lazy) compressed chunk that is part of a super-chunk in the @p chunk parameter.\n\n @param schunk The super-chunk from where to extract a chunk.\n @param nchunk The chunk to be extracted (0 indexed).\n @param chunk The pointer to the (lazy) chunk of compressed data.\n @param needs_free The pointer to a boolean indicating if it is the user's\n responsibility to free the chunk returned or not.\n\n @note For disk-based frames, a lazy chunk is always returned.\n\n @warning Currently, a lazy chunk can only be used by #blosc2_decompress_ctx and #blosc2_getitem_ctx.\n\n @warning If the super-chunk is backed by a frame that is disk-based, a buffer is allocated for the\n (compressed) chunk, and hence a free is needed.\n You can check whether requires a free with the @p needs_free parameter.\n If the chunk does not need a free, it means that a pointer to the location in the super-chunk\n (or the backing in-memory frame) is returned in the @p chunk parameter.  In this case the returned\n chunk is not lazy.\n\n @return The size of the (compressed) chunk or 0 if it is non-initialized. If some problem is\n detected, a negative code is returned instead.  Note that a lazy chunk is somewhat larger than\n a regular chunk because of the trailer section (for details see `README_CHUNK_FORMAT.rst`)."]
2218    pub fn blosc2_schunk_get_lazychunk(
2219        schunk: *mut blosc2_schunk,
2220        nchunk: i64,
2221        chunk: *mut *mut u8,
2222        needs_free: *mut bool,
2223    ) -> ::std::os::raw::c_int;
2224}
2225extern "C" {
2226    #[doc = " @brief Fill buffer with a schunk slice.\n\n @param schunk The super-chunk from where to extract a slice.\n @param start Index (0-based) where the slice begins.\n @param stop The first index (0-based) that is not in the selected slice.\n @param buffer The buffer where the data will be stored.\n\n @warning You must make sure that you have enough space in buffer to store the\n uncompressed data.\n\n @return An error code."]
2227    pub fn blosc2_schunk_get_slice_buffer(
2228        schunk: *mut blosc2_schunk,
2229        start: i64,
2230        stop: i64,
2231        buffer: *mut ::std::os::raw::c_void,
2232    ) -> ::std::os::raw::c_int;
2233}
2234extern "C" {
2235    #[doc = " @brief Update a schunk slice from buffer.\n\n @param schunk The super-chunk where to set the slice.\n @param start Index (0-based) where the slice begins.\n @param stop The first index (0-based) that is not in the selected slice.\n @param buffer The buffer containing the data to set.\n\n\n @return An error code."]
2236    pub fn blosc2_schunk_set_slice_buffer(
2237        schunk: *mut blosc2_schunk,
2238        start: i64,
2239        stop: i64,
2240        buffer: *mut ::std::os::raw::c_void,
2241    ) -> ::std::os::raw::c_int;
2242}
2243extern "C" {
2244    #[doc = " @brief Return the @p cparams associated to a super-chunk.\n\n @param schunk The super-chunk from where to extract the compression parameters.\n @param cparams The pointer where the compression params will be returned.\n\n @warning A new struct is allocated, and the user should free it after use.\n\n @return 0 if succeeds. Else a negative code is returned."]
2245    pub fn blosc2_schunk_get_cparams(
2246        schunk: *mut blosc2_schunk,
2247        cparams: *mut *mut blosc2_cparams,
2248    ) -> ::std::os::raw::c_int;
2249}
2250extern "C" {
2251    #[doc = " @brief Return the @p dparams struct associated to a super-chunk.\n\n @param schunk The super-chunk from where to extract the decompression parameters.\n @param dparams The pointer where the decompression params will be returned.\n\n @warning A new struct is allocated, and the user should free it after use.\n\n @return 0 if succeeds. Else a negative code is returned."]
2252    pub fn blosc2_schunk_get_dparams(
2253        schunk: *mut blosc2_schunk,
2254        dparams: *mut *mut blosc2_dparams,
2255    ) -> ::std::os::raw::c_int;
2256}
2257extern "C" {
2258    #[doc = " @brief Reorder the chunk offsets of an existing super-chunk.\n\n @param schunk The super-chunk whose chunk offsets are to be reordered.\n @param offsets_order The new order of the chunk offsets.\n\n @return 0 if succeeds. Else a negative code is returned."]
2259    pub fn blosc2_schunk_reorder_offsets(
2260        schunk: *mut blosc2_schunk,
2261        offsets_order: *mut i64,
2262    ) -> ::std::os::raw::c_int;
2263}
2264extern "C" {
2265    #[doc = " @brief Get the length (in bytes) of the internal frame of the super-chunk.\n\n @param schunk The super-chunk.\n\n @return The length (in bytes) of the internal frame.\n If there is not an internal frame, an estimate of the length is provided."]
2266    pub fn blosc2_schunk_frame_len(schunk: *mut blosc2_schunk) -> i64;
2267}
2268extern "C" {
2269    #[doc = " @brief Quickly fill an empty frame with special values (zeros, NaNs, uninit).\n\n @param schunk The super-chunk to be filled.  This must be empty initially.\n @param nitems The number of items to fill.\n @param special_value The special value to use for filling.  The only values\n supported for now are BLOSC2_SPECIAL_ZERO, BLOSC2_SPECIAL_NAN and BLOSC2_SPECIAL_UNINIT.\n @param chunksize The chunksize for the chunks that are to be added to the super-chunk.\n\n @return The total number of chunks that have been added to the super-chunk.\n If there is an error, a negative value is returned."]
2270    pub fn blosc2_schunk_fill_special(
2271        schunk: *mut blosc2_schunk,
2272        nitems: i64,
2273        special_value: ::std::os::raw::c_int,
2274        chunksize: i32,
2275    ) -> i64;
2276}
2277extern "C" {
2278    #[doc = " @brief Add content into a new metalayer.\n\n @param schunk The super-chunk to which the metalayer should be added.\n @param name The name of the metalayer.\n @param content The content of the metalayer.\n @param content_len The length of the content.\n\n @return If successful, the index of the new metalayer. Else, return a negative value."]
2279    pub fn blosc2_meta_add(
2280        schunk: *mut blosc2_schunk,
2281        name: *const ::std::os::raw::c_char,
2282        content: *mut u8,
2283        content_len: i32,
2284    ) -> ::std::os::raw::c_int;
2285}
2286extern "C" {
2287    #[doc = " @brief Update the content of an existing metalayer.\n\n @param schunk The frame containing the metalayer.\n @param name The name of the metalayer to be updated.\n @param content The new content of the metalayer.\n @param content_len The length of the content.\n\n @note Contrarily to #blosc2_meta_add the updates to metalayers\n are automatically serialized into a possible attached frame.\n\n @return If successful, the index of the metalayer. Else, return a negative value."]
2288    pub fn blosc2_meta_update(
2289        schunk: *mut blosc2_schunk,
2290        name: *const ::std::os::raw::c_char,
2291        content: *mut u8,
2292        content_len: i32,
2293    ) -> ::std::os::raw::c_int;
2294}
2295extern "C" {
2296    #[doc = " @brief Find whether the schunk has a variable-length metalayer or not.\n\n @param schunk The super-chunk from which the variable-length metalayer will be checked.\n @param name The name of the variable-length metalayer to be checked.\n\n @return If successful, return the index of the variable-length metalayer. Else, return a negative value."]
2297    pub fn blosc2_vlmeta_exists(
2298        schunk: *mut blosc2_schunk,
2299        name: *const ::std::os::raw::c_char,
2300    ) -> ::std::os::raw::c_int;
2301}
2302extern "C" {
2303    #[doc = " @brief Add content into a new variable-length metalayer.\n\n @param schunk The super-chunk to which the variable-length metalayer should be added.\n @param name The name of the variable-length metalayer.\n @param content The content to be added.\n @param content_len The length of the content.\n @param cparams The parameters for compressing the variable-length metalayer content. If NULL,\n the `BLOSC2_CPARAMS_DEFAULTS` will be used.\n\n @return If successful, the index of the new variable-length metalayer. Else, return a negative value."]
2304    pub fn blosc2_vlmeta_add(
2305        schunk: *mut blosc2_schunk,
2306        name: *const ::std::os::raw::c_char,
2307        content: *mut u8,
2308        content_len: i32,
2309        cparams: *mut blosc2_cparams,
2310    ) -> ::std::os::raw::c_int;
2311}
2312extern "C" {
2313    #[doc = " @brief Update the content of an existing variable-length metalayer.\n\n @param schunk The super-chunk containing the variable-length metalayer.\n @param name The name of the variable-length metalayer to be updated.\n @param content The new content of the variable-length metalayer.\n @param content_len The length of the content.\n @param cparams The parameters for compressing the variable-length metalayer content. If NULL,\n the `BLOSC2_CPARAMS_DEFAULTS` will be used.\n\n @return If successful, the index of the variable-length metalayer. Else, return a negative value."]
2314    pub fn blosc2_vlmeta_update(
2315        schunk: *mut blosc2_schunk,
2316        name: *const ::std::os::raw::c_char,
2317        content: *mut u8,
2318        content_len: i32,
2319        cparams: *mut blosc2_cparams,
2320    ) -> ::std::os::raw::c_int;
2321}
2322extern "C" {
2323    #[doc = " @brief Get the content out of a variable-length metalayer.\n\n @param schunk The super-chunk containing the variable-length metalayer.\n @param name The name of the variable-length metalayer.\n @param content The pointer where the content will be put.\n @param content_len The pointer where the length of the content will be put.\n\n @warning The @p **content receives a malloc'ed copy of the content.\n The user is responsible of freeing it.\n\n @return If successful, the index of the new variable-length metalayer. Else, return a negative value."]
2324    pub fn blosc2_vlmeta_get(
2325        schunk: *mut blosc2_schunk,
2326        name: *const ::std::os::raw::c_char,
2327        content: *mut *mut u8,
2328        content_len: *mut i32,
2329    ) -> ::std::os::raw::c_int;
2330}
2331extern "C" {
2332    #[doc = " @brief Delete the variable-length metalayer from the super-chunk.\n\n @param schunk The super-chunk containing the variable-length metalayer.\n @param name The name of the variable-length metalayer.\n\n @return If successful, the number of the variable-length metalayers in the super-chunk. Else, return a negative value."]
2333    pub fn blosc2_vlmeta_delete(
2334        schunk: *mut blosc2_schunk,
2335        name: *const ::std::os::raw::c_char,
2336    ) -> ::std::os::raw::c_int;
2337}
2338extern "C" {
2339    #[doc = " @brief Get a list of all the variable-length metalayer names.\n\n @param schunk The super-chunk containing the variable-length metalayers.\n @param names The pointer to a char** to store the name pointers. This should\n be of size *schunk->nvlmetalayers * sizeof(char*).\n\n @return The number of the variable-length metalayers in the super-chunk.\n This cannot fail unless the user does not pass a @p names which is large enough to\n keep pointers to all names, in which case funny things (seg faults and such) will happen."]
2340    pub fn blosc2_vlmeta_get_names(
2341        schunk: *mut blosc2_schunk,
2342        names: *mut *mut ::std::os::raw::c_char,
2343    ) -> ::std::os::raw::c_int;
2344}
2345extern "C" {
2346    pub fn blosc_set_timestamp(timestamp: *mut blosc_timestamp_t);
2347}
2348extern "C" {
2349    pub fn blosc_elapsed_nsecs(start_time: blosc_timestamp_t, end_time: blosc_timestamp_t) -> f64;
2350}
2351extern "C" {
2352    pub fn blosc_elapsed_secs(start_time: blosc_timestamp_t, end_time: blosc_timestamp_t) -> f64;
2353}
2354extern "C" {
2355    #[doc = " @brief Get the internal blocksize to be used during compression. 0 means\n that an automatic blocksize is computed internally.\n\n @return The size in bytes of the internal block size."]
2356    pub fn blosc1_get_blocksize() -> ::std::os::raw::c_int;
2357}
2358extern "C" {
2359    #[doc = " @brief Force the use of a specific blocksize. If 0, an automatic\n blocksize will be used (the default).\n\n @warning The blocksize is a critical parameter with important\n restrictions in the allowed values, so use this with care."]
2360    pub fn blosc1_set_blocksize(blocksize: usize);
2361}
2362extern "C" {
2363    #[doc = " @brief Set the split mode.\n\n @param splitmode It can take the next values:\n  BLOSC_FORWARD_COMPAT_SPLIT\n  BLOSC_AUTO_SPLIT\n  BLOSC_NEVER_SPLIT\n  BLOSC_ALWAYS_SPLIT\n\n BLOSC_FORWARD_COMPAT offers reasonably forward compatibility,\n BLOSC_AUTO_SPLIT is for nearly optimal results (based on heuristics),\n BLOSC_NEVER_SPLIT and BLOSC_ALWAYS_SPLIT are for the user experimenting\n  when trying to get best compression ratios and/or speed.\n\n If not called, the default mode is BLOSC_FORWARD_COMPAT_SPLIT.\n\n This function should always succeed."]
2364    pub fn blosc1_set_splitmode(splitmode: ::std::os::raw::c_int);
2365}
2366extern "C" {
2367    #[doc = " @brief Get the offsets of a frame in a super-chunk.\n\n @param schunk The super-chunk containing the frame.\n\n @return If successful, return a pointer to a buffer of the decompressed offsets.\n The number of offsets is equal to schunk->nchunks; the user is\n responsible to free this buffer. Else, return a NULL value."]
2368    pub fn blosc2_frame_get_offsets(schunk: *mut blosc2_schunk) -> *mut i64;
2369}
2370#[doc = "Structures and functions related with compression codecs."]
2371pub type blosc2_codec_encoder_cb = ::std::option::Option<
2372    unsafe extern "C" fn(
2373        input: *const u8,
2374        input_len: i32,
2375        output: *mut u8,
2376        output_len: i32,
2377        meta: u8,
2378        cparams: *mut blosc2_cparams,
2379        chunk: *const ::std::os::raw::c_void,
2380    ) -> ::std::os::raw::c_int,
2381>;
2382pub type blosc2_codec_decoder_cb = ::std::option::Option<
2383    unsafe extern "C" fn(
2384        input: *const u8,
2385        input_len: i32,
2386        output: *mut u8,
2387        output_len: i32,
2388        meta: u8,
2389        dparams: *mut blosc2_dparams,
2390        chunk: *const ::std::os::raw::c_void,
2391    ) -> ::std::os::raw::c_int,
2392>;
2393#[repr(C)]
2394#[derive(Debug, Copy, Clone)]
2395pub struct blosc2_codec {
2396    pub compcode: u8,
2397    pub compname: *mut ::std::os::raw::c_char,
2398    pub complib: u8,
2399    pub version: u8,
2400    pub encoder: blosc2_codec_encoder_cb,
2401    pub decoder: blosc2_codec_decoder_cb,
2402}
2403#[test]
2404fn bindgen_test_layout_blosc2_codec() {
2405    const UNINIT: ::std::mem::MaybeUninit<blosc2_codec> = ::std::mem::MaybeUninit::uninit();
2406    let ptr = UNINIT.as_ptr();
2407    assert_eq!(
2408        ::std::mem::size_of::<blosc2_codec>(),
2409        40usize,
2410        concat!("Size of: ", stringify!(blosc2_codec))
2411    );
2412    assert_eq!(
2413        ::std::mem::align_of::<blosc2_codec>(),
2414        8usize,
2415        concat!("Alignment of ", stringify!(blosc2_codec))
2416    );
2417    assert_eq!(
2418        unsafe { ::std::ptr::addr_of!((*ptr).compcode) as usize - ptr as usize },
2419        0usize,
2420        concat!(
2421            "Offset of field: ",
2422            stringify!(blosc2_codec),
2423            "::",
2424            stringify!(compcode)
2425        )
2426    );
2427    assert_eq!(
2428        unsafe { ::std::ptr::addr_of!((*ptr).compname) as usize - ptr as usize },
2429        8usize,
2430        concat!(
2431            "Offset of field: ",
2432            stringify!(blosc2_codec),
2433            "::",
2434            stringify!(compname)
2435        )
2436    );
2437    assert_eq!(
2438        unsafe { ::std::ptr::addr_of!((*ptr).complib) as usize - ptr as usize },
2439        16usize,
2440        concat!(
2441            "Offset of field: ",
2442            stringify!(blosc2_codec),
2443            "::",
2444            stringify!(complib)
2445        )
2446    );
2447    assert_eq!(
2448        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
2449        17usize,
2450        concat!(
2451            "Offset of field: ",
2452            stringify!(blosc2_codec),
2453            "::",
2454            stringify!(version)
2455        )
2456    );
2457    assert_eq!(
2458        unsafe { ::std::ptr::addr_of!((*ptr).encoder) as usize - ptr as usize },
2459        24usize,
2460        concat!(
2461            "Offset of field: ",
2462            stringify!(blosc2_codec),
2463            "::",
2464            stringify!(encoder)
2465        )
2466    );
2467    assert_eq!(
2468        unsafe { ::std::ptr::addr_of!((*ptr).decoder) as usize - ptr as usize },
2469        32usize,
2470        concat!(
2471            "Offset of field: ",
2472            stringify!(blosc2_codec),
2473            "::",
2474            stringify!(decoder)
2475        )
2476    );
2477}
2478extern "C" {
2479    #[doc = " @brief Register locally a user-defined codec in Blosc.\n\n @param codec The codec to register.\n\n @return 0 if succeeds. Else a negative code is returned."]
2480    pub fn blosc2_register_codec(codec: *mut blosc2_codec) -> ::std::os::raw::c_int;
2481}
2482#[doc = "Structures and functions related with filters plugins."]
2483pub type blosc2_filter_forward_cb = ::std::option::Option<
2484    unsafe extern "C" fn(
2485        arg1: *const u8,
2486        arg2: *mut u8,
2487        arg3: i32,
2488        arg4: u8,
2489        arg5: *mut blosc2_cparams,
2490        arg6: u8,
2491    ) -> ::std::os::raw::c_int,
2492>;
2493pub type blosc2_filter_backward_cb = ::std::option::Option<
2494    unsafe extern "C" fn(
2495        arg1: *const u8,
2496        arg2: *mut u8,
2497        arg3: i32,
2498        arg4: u8,
2499        arg5: *mut blosc2_dparams,
2500        arg6: u8,
2501    ) -> ::std::os::raw::c_int,
2502>;
2503#[doc = " @brief The parameters for a user-defined filter."]
2504#[repr(C)]
2505#[derive(Debug, Copy, Clone)]
2506pub struct blosc2_filter {
2507    pub id: u8,
2508    pub name: *mut ::std::os::raw::c_char,
2509    pub version: u8,
2510    pub forward: blosc2_filter_forward_cb,
2511    pub backward: blosc2_filter_backward_cb,
2512}
2513#[test]
2514fn bindgen_test_layout_blosc2_filter() {
2515    const UNINIT: ::std::mem::MaybeUninit<blosc2_filter> = ::std::mem::MaybeUninit::uninit();
2516    let ptr = UNINIT.as_ptr();
2517    assert_eq!(
2518        ::std::mem::size_of::<blosc2_filter>(),
2519        40usize,
2520        concat!("Size of: ", stringify!(blosc2_filter))
2521    );
2522    assert_eq!(
2523        ::std::mem::align_of::<blosc2_filter>(),
2524        8usize,
2525        concat!("Alignment of ", stringify!(blosc2_filter))
2526    );
2527    assert_eq!(
2528        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
2529        0usize,
2530        concat!(
2531            "Offset of field: ",
2532            stringify!(blosc2_filter),
2533            "::",
2534            stringify!(id)
2535        )
2536    );
2537    assert_eq!(
2538        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
2539        8usize,
2540        concat!(
2541            "Offset of field: ",
2542            stringify!(blosc2_filter),
2543            "::",
2544            stringify!(name)
2545        )
2546    );
2547    assert_eq!(
2548        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
2549        16usize,
2550        concat!(
2551            "Offset of field: ",
2552            stringify!(blosc2_filter),
2553            "::",
2554            stringify!(version)
2555        )
2556    );
2557    assert_eq!(
2558        unsafe { ::std::ptr::addr_of!((*ptr).forward) as usize - ptr as usize },
2559        24usize,
2560        concat!(
2561            "Offset of field: ",
2562            stringify!(blosc2_filter),
2563            "::",
2564            stringify!(forward)
2565        )
2566    );
2567    assert_eq!(
2568        unsafe { ::std::ptr::addr_of!((*ptr).backward) as usize - ptr as usize },
2569        32usize,
2570        concat!(
2571            "Offset of field: ",
2572            stringify!(blosc2_filter),
2573            "::",
2574            stringify!(backward)
2575        )
2576    );
2577}
2578extern "C" {
2579    #[doc = " @brief Register locally a user-defined filter in Blosc.\n\n @param filter The filter to register.\n\n @return 0 if succeeds. Else a negative code is returned."]
2580    pub fn blosc2_register_filter(filter: *mut blosc2_filter) -> ::std::os::raw::c_int;
2581}
2582extern "C" {
2583    pub fn blosc2_remove_dir(path: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
2584}
2585extern "C" {
2586    pub fn blosc2_remove_urlpath(path: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
2587}
2588extern "C" {
2589    pub fn blosc2_rename_urlpath(
2590        old_urlpath: *mut ::std::os::raw::c_char,
2591        new_path: *mut ::std::os::raw::c_char,
2592    ) -> ::std::os::raw::c_int;
2593}
2594extern "C" {
2595    pub fn blosc2_unidim_to_multidim(ndim: u8, shape: *mut i64, i: i64, index: *mut i64);
2596}
2597extern "C" {
2598    pub fn blosc2_multidim_to_unidim(index: *const i64, ndim: i8, strides: *const i64, i: *mut i64);
2599}