1pub const ZL_ERROR_ENABLE_STATIC_ERROR_INFO: u32 = 1;
4pub const ZL_ErrorCode_no_error__desc_str: &[u8; 9] = b"No Error\0";
5pub const ZL_ErrorCode_GENERIC__desc_str: &[u8; 8] = b"Generic\0";
6pub const ZL_ErrorCode_allocation__desc_str: &[u8; 11] = b"Allocation\0";
7pub const ZL_ErrorCode_srcSize_tooSmall__desc_str: &[u8; 22] = b"Source size too small\0";
8pub const ZL_ErrorCode_dstCapacity_tooSmall__desc_str: &[u8; 31] =
9 b"Destination capacity too small\0";
10pub const ZL_ErrorCode_userBuffer_alignmentIncorrect__desc_str: &[u8; 55] =
11 b"Buffer provided is incorrectly aligned for target type\0";
12pub const ZL_ErrorCode_userBuffers_invalidNum__desc_str: &[u8; 57] =
13 b"Nb of Typed Buffers provided is incorrect for this frame\0";
14pub const ZL_ErrorCode_decompression_incorrectAPI__desc_str: &[u8; 61] =
15 b"Used an invalid decompression API method for the target Type\0";
16pub const ZL_ErrorCode_header_unknown__desc_str: &[u8; 15] = b"Unknown header\0";
17pub const ZL_ErrorCode_frameParameter_unsupported__desc_str: &[u8; 28] =
18 b"Frame parameter unsupported\0";
19pub const ZL_ErrorCode_outputID_invalid__desc_str: &[u8; 37] =
20 b"Frame doesn't host this many outputs\0";
21pub const ZL_ErrorCode_invalidRequest_singleOutputFrameOnly__desc_str: &[u8; 65] =
22 b"This request only makes sense for Frames hosting a single Output\0";
23pub const ZL_ErrorCode_outputNotCommitted__desc_str: &[u8; 21] = b"Output not committed\0";
24pub const ZL_ErrorCode_outputNotReserved__desc_str: &[u8; 21] = b"Output has no buffer\0";
25pub const ZL_ErrorCode_compressionParameter_invalid__desc_str: &[u8; 30] =
26 b"Compression parameter invalid\0";
27pub const ZL_ErrorCode_segmenter_inputNotConsumed__desc_str: &[u8; 46] =
28 b"Segmenter did not consume entirely all inputs\0";
29pub const ZL_ErrorCode_graph_invalid__desc_str: &[u8; 14] = b"Graph invalid\0";
30pub const ZL_ErrorCode_graph_nonserializable__desc_str: &[u8; 38] =
31 b"Graph incompatible with serialization\0";
32pub const ZL_ErrorCode_graph_invalidNumInputs__desc_str: &[u8; 24] = b"Graph invalid nb inputs\0";
33pub const ZL_ErrorCode_graph_parser_malformedInput__desc_str: &[u8; 35] =
34 b"Parser encountered malformed input\0";
35pub const ZL_ErrorCode_graph_parser_unhandledInput__desc_str: &[u8; 35] =
36 b"Parser encountered unhandled input\0";
37pub const ZL_ErrorCode_successor_invalid__desc_str: &[u8; 36] =
38 b"Selected an invalid Successor Graph\0";
39pub const ZL_ErrorCode_successor_alreadySet__desc_str: &[u8; 49] =
40 b"A Successor was already assigned for this Stream\0";
41pub const ZL_ErrorCode_successor_invalidNumInputs__desc_str: &[u8; 53] =
42 b"Successor Graph receives an invalid number of Inputs\0";
43pub const ZL_ErrorCode_inputType_unsupported__desc_str: &[u8; 42] =
44 b"Input Type not supported by selected Port\0";
45pub const ZL_ErrorCode_graphParameter_invalid__desc_str: &[u8; 46] =
46 b"Graph was assigned an invalid Local Parameter\0";
47pub const ZL_ErrorCode_nodeParameter_invalid__desc_str: &[u8; 23] = b"Node parameter invalid\0";
48pub const ZL_ErrorCode_nodeParameter_invalidValue__desc_str: &[u8; 29] =
49 b"Node parameter invalid value\0";
50pub const ZL_ErrorCode_transform_executionFailure__desc_str: &[u8; 34] =
51 b"Transform failed during execution\0";
52pub const ZL_ErrorCode_customNode_definitionInvalid__desc_str: &[u8; 31] =
53 b"Custom node definition invalid\0";
54pub const ZL_ErrorCode_stream_wrongInit__desc_str: &[u8; 46] =
55 b"Stream is not in a valid initialization stage\0";
56pub const ZL_ErrorCode_streamType_incorrect__desc_str: &[u8; 35] =
57 b"An incompatible type is being used\0";
58pub const ZL_ErrorCode_streamCapacity_tooSmall__desc_str: &[u8; 43] =
59 b"Stream internal capacity is not sufficient\0";
60pub const ZL_ErrorCode_streamParameter_invalid__desc_str: &[u8; 25] = b"Stream parameter invalid\0";
61pub const ZL_ErrorCode_parameter_invalid__desc_str: &[u8; 21] = b"Parameter is invalid\0";
62pub const ZL_ErrorCode_formatVersion_unsupported__desc_str: &[u8; 27] =
63 b"Format version unsupported\0";
64pub const ZL_ErrorCode_formatVersion_notSet__desc_str: &[u8; 84] =
65 b"Format version is not set; it must be set via the ZL_CParam_formatVersion parameter\0";
66pub const ZL_ErrorCode_node_versionMismatch__desc_str: &[u8; 51] =
67 b"Node is incompatible with requested format version\0";
68pub const ZL_ErrorCode_node_unexpected_input_type__desc_str: &[u8; 31] =
69 b"Unexpected input type for node\0";
70pub const ZL_ErrorCode_node_invalid_input__desc_str: &[u8; 48] =
71 b"Input does not respect conditions for this node\0";
72pub const ZL_ErrorCode_node_invalid__desc_str: &[u8; 16] = b"Invalid Node ID\0";
73pub const ZL_ErrorCode_nodeExecution_invalidOutputs__desc_str: &[u8; 69] =
74 b"node execution has resulted in an incorrect configuration of outputs\0";
75pub const ZL_ErrorCode_nodeRegen_countIncorrect__desc_str: &[u8; 63] =
76 b"node is requested to regenerate an incorrect number of streams\0";
77pub const ZL_ErrorCode_logicError__desc_str: &[u8; 21] = b"Internal logic error\0";
78pub const ZL_ErrorCode_invalidTransform__desc_str: &[u8; 21] = b"Invalid transform ID\0";
79pub const ZL_ErrorCode_internalBuffer_tooSmall__desc_str: &[u8; 26] =
80 b"Internal buffer too small\0";
81pub const ZL_ErrorCode_corruption__desc_str: &[u8; 20] = b"Corruption detected\0";
82pub const ZL_ErrorCode_outputs_tooNumerous__desc_str: &[u8; 56] =
83 b"Too many outputs: unsupported by claimed format version\0";
84pub const ZL_ErrorCode_temporaryLibraryLimitation__desc_str: &[u8; 36] =
85 b"Temporary OpenZL library limitation\0";
86pub const ZL_ErrorCode_compressedChecksumWrong__desc_str: &[u8; 60] =
87 b"Compressed checksum mismatch (corruption after compression)\0";
88pub const ZL_ErrorCode_contentChecksumWrong__desc_str : & [u8 ; 114] = b"Content checksum mismatch (either corruption after compression or corruption during compression or decompression)\0" ;
89pub const ZL_ErrorCode_srcSize_tooLarge__desc_str: &[u8; 22] = b"Source size too large\0";
90pub const ZL_ErrorCode_integerOverflow__desc_str: &[u8; 17] = b"Integer overflow\0";
91pub const ZL_ErrorCode_invalidName__desc_str: &[u8; 32] = b"Invalid name of graph component\0";
92pub const ZL_ErrorCode_dict_corruption__desc_str: &[u8; 31] = b"Dictionary corruption detected\0";
93pub const ZL_ErrorCode_dict_materialization__desc_str: &[u8; 35] =
94 b"Dictionary materialization failure\0";
95pub const ZL_ENABLE_ERR_IF_ARG_PRINTING: u32 = 1;
96pub const ZL_LIBRARY_VERSION_MAJOR: u32 = 0;
97pub const ZL_LIBRARY_VERSION_MINOR: u32 = 2;
98pub const ZL_LIBRARY_VERSION_PATCH: u32 = 0;
99pub const ZL_LIBRARY_VERSION_NUMBER: u32 = 200;
100pub const ZL_MIN_FORMAT_VERSION: u32 = 8;
101pub const ZL_MAX_FORMAT_VERSION: u32 = 24;
102pub const ZL_CHUNK_VERSION_MIN: u32 = 21;
103pub const ZL_TYPED_INPUT_VERSION_MIN: u32 = 14;
104pub const ZL_IS_FBCODE: u32 = 0;
105pub const ZL_FBCODE_IS_RELEASE: u32 = 0;
106pub const ZL_MIN_CHUNK_SIZE: u32 = 32768;
107pub const ZL_CHUNK_OVERHEAD_MAX: u32 = 16;
108pub const ZL_FRAME_OVERHEAD_MAX: u32 = 32;
109pub const ZL_COMPRESSIONLEVEL_DEFAULT: u32 = 6;
110pub const ZL_DECOMPRESSIONLEVEL_DEFAULT: u32 = 3;
111pub const ZL_MINSTREAMSIZE_DEFAULT: u32 = 10;
112pub const ZL_CONVERT_SERIAL_TO_STRUCT_SIZE_PID: u32 = 1;
113pub const ZL_DISPATCH_PARSINGFN_PID: u32 = 519;
114pub const ZL_DISPATCH_INSTRUCTIONS_PID: u32 = 520;
115pub const ZL_DISPATCH_CHANNEL_ID: u32 = 83;
116pub const ZL_DISPATCH_STRING_NUM_OUTPUTS_PID: u32 = 47;
117pub const ZL_DISPATCH_STRING_INDICES_PID: u32 = 48;
118pub const ZL_DIVIDE_BY_PID: u32 = 112;
119pub const ZL_FIELD_LZ_COMPRESSION_LEVEL_OVERRIDE_PID: u32 = 181;
120pub const ZL_FIELD_LZ_LITERALS_GRAPH_OVERRIDE_INDEX_PID: u32 = 0;
121pub const ZL_FIELD_LZ_TOKENS_GRAPH_OVERRIDE_INDEX_PID: u32 = 1;
122pub const ZL_FIELD_LZ_OFFSETS_GRAPH_OVERRIDE_INDEX_PID: u32 = 2;
123pub const ZL_FIELD_LZ_EXTRA_LITERAL_LENGTHS_GRAPH_OVERRIDE_INDEX_PID: u32 = 3;
124pub const ZL_FIELD_LZ_EXTRA_MATCH_LENGTHS_GRAPH_OVERRIDE_INDEX_PID: u32 = 4;
125pub const ZL_LZ_MIN_MATCH_LENGTH_METADATA_ID: u32 = 77;
126pub const ZL_LZ4_COMPRESSION_LEVEL_OVERRIDE_PID: u32 = 0;
127pub const ZL_MUX_LENGTHS_SPLIT_POINT_PID: u32 = 0;
128pub const ZL_MUX_LENGTHS_MATCH_LENGTH_BIAS_PID: u32 = 1;
129pub const ZL_SDDL_DESCRIPTION_PID: u32 = 522;
130pub const ZL_SENTINEL_INDICES_PID: u32 = 130;
131pub const ZL_SENTINEL_VALUE_PID: u32 = 131;
132pub const ZL_SPLIT_BYRANGE_MIN_SEGMENT_SIZE_PID: u32 = 324;
133pub const ZL_SPLIT_CHANNEL_ID: u32 = 867;
134pub const ZL_TOKENIZE_SORT_PID: u32 = 0;
135pub const ZL_HAVE_X86_64_ASM: u32 = 1;
136pub const ZL_ALLOW_INTROSPECTION: u32 = 1;
137pub const ZL_LP_INVALID_PARAMID: i32 = -1;
138#[repr(C)]
139#[derive(Debug, Copy, Clone)]
140pub struct ZL_WBuffer {
141 pub start: *mut ::std::os::raw::c_void,
142 pub capacity: usize,
143}
144#[test]
145fn bindgen_test_layout_ZL_WBuffer() {
146 const UNINIT: ::std::mem::MaybeUninit<ZL_WBuffer> = ::std::mem::MaybeUninit::uninit();
147 let ptr = UNINIT.as_ptr();
148 assert_eq!(
149 ::std::mem::size_of::<ZL_WBuffer>(),
150 16usize,
151 "Size of ZL_WBuffer"
152 );
153 assert_eq!(
154 ::std::mem::align_of::<ZL_WBuffer>(),
155 8usize,
156 "Alignment of ZL_WBuffer"
157 );
158 assert_eq!(
159 unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
160 0usize,
161 "Offset of field: ZL_WBuffer::start"
162 );
163 assert_eq!(
164 unsafe { ::std::ptr::addr_of!((*ptr).capacity) as usize - ptr as usize },
165 8usize,
166 "Offset of field: ZL_WBuffer::capacity"
167 );
168}
169#[repr(C)]
170#[derive(Debug, Copy, Clone)]
171pub struct ZL_WCursor {
172 pub wb: ZL_WBuffer,
173 pub pos: usize,
174}
175#[test]
176fn bindgen_test_layout_ZL_WCursor() {
177 const UNINIT: ::std::mem::MaybeUninit<ZL_WCursor> = ::std::mem::MaybeUninit::uninit();
178 let ptr = UNINIT.as_ptr();
179 assert_eq!(
180 ::std::mem::size_of::<ZL_WCursor>(),
181 24usize,
182 "Size of ZL_WCursor"
183 );
184 assert_eq!(
185 ::std::mem::align_of::<ZL_WCursor>(),
186 8usize,
187 "Alignment of ZL_WCursor"
188 );
189 assert_eq!(
190 unsafe { ::std::ptr::addr_of!((*ptr).wb) as usize - ptr as usize },
191 0usize,
192 "Offset of field: ZL_WCursor::wb"
193 );
194 assert_eq!(
195 unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize },
196 16usize,
197 "Offset of field: ZL_WCursor::pos"
198 );
199}
200#[repr(C)]
201#[derive(Debug, Copy, Clone)]
202pub struct ZL_RBuffer {
203 pub start: *const ::std::os::raw::c_void,
204 pub size: usize,
205}
206#[test]
207fn bindgen_test_layout_ZL_RBuffer() {
208 const UNINIT: ::std::mem::MaybeUninit<ZL_RBuffer> = ::std::mem::MaybeUninit::uninit();
209 let ptr = UNINIT.as_ptr();
210 assert_eq!(
211 ::std::mem::size_of::<ZL_RBuffer>(),
212 16usize,
213 "Size of ZL_RBuffer"
214 );
215 assert_eq!(
216 ::std::mem::align_of::<ZL_RBuffer>(),
217 8usize,
218 "Alignment of ZL_RBuffer"
219 );
220 assert_eq!(
221 unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
222 0usize,
223 "Offset of field: ZL_RBuffer::start"
224 );
225 assert_eq!(
226 unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
227 8usize,
228 "Offset of field: ZL_RBuffer::size"
229 );
230}
231pub type ZL_IDType = ::std::os::raw::c_uint;
232#[repr(C)]
233#[derive(Debug, Copy, Clone)]
234pub struct ZL_UniqueID {
235 pub bytes: [::std::os::raw::c_uchar; 32usize],
236}
237#[test]
238fn bindgen_test_layout_ZL_UniqueID() {
239 const UNINIT: ::std::mem::MaybeUninit<ZL_UniqueID> = ::std::mem::MaybeUninit::uninit();
240 let ptr = UNINIT.as_ptr();
241 assert_eq!(
242 ::std::mem::size_of::<ZL_UniqueID>(),
243 32usize,
244 "Size of ZL_UniqueID"
245 );
246 assert_eq!(
247 ::std::mem::align_of::<ZL_UniqueID>(),
248 1usize,
249 "Alignment of ZL_UniqueID"
250 );
251 assert_eq!(
252 unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize },
253 0usize,
254 "Offset of field: ZL_UniqueID::bytes"
255 );
256}
257#[repr(C)]
258#[derive(Debug, Copy, Clone)]
259pub struct ZL_DataID {
260 pub sid: ZL_IDType,
261}
262#[test]
263fn bindgen_test_layout_ZL_DataID() {
264 const UNINIT: ::std::mem::MaybeUninit<ZL_DataID> = ::std::mem::MaybeUninit::uninit();
265 let ptr = UNINIT.as_ptr();
266 assert_eq!(
267 ::std::mem::size_of::<ZL_DataID>(),
268 4usize,
269 "Size of ZL_DataID"
270 );
271 assert_eq!(
272 ::std::mem::align_of::<ZL_DataID>(),
273 4usize,
274 "Alignment of ZL_DataID"
275 );
276 assert_eq!(
277 unsafe { ::std::ptr::addr_of!((*ptr).sid) as usize - ptr as usize },
278 0usize,
279 "Offset of field: ZL_DataID::sid"
280 );
281}
282#[repr(C)]
283#[derive(Debug, Copy, Clone)]
284pub struct ZL_NodeID {
285 pub nid: ZL_IDType,
286}
287#[test]
288fn bindgen_test_layout_ZL_NodeID() {
289 const UNINIT: ::std::mem::MaybeUninit<ZL_NodeID> = ::std::mem::MaybeUninit::uninit();
290 let ptr = UNINIT.as_ptr();
291 assert_eq!(
292 ::std::mem::size_of::<ZL_NodeID>(),
293 4usize,
294 "Size of ZL_NodeID"
295 );
296 assert_eq!(
297 ::std::mem::align_of::<ZL_NodeID>(),
298 4usize,
299 "Alignment of ZL_NodeID"
300 );
301 assert_eq!(
302 unsafe { ::std::ptr::addr_of!((*ptr).nid) as usize - ptr as usize },
303 0usize,
304 "Offset of field: ZL_NodeID::nid"
305 );
306}
307#[repr(C)]
308#[derive(Debug, Copy, Clone)]
309pub struct ZL_GraphID {
310 pub gid: ZL_IDType,
311}
312#[test]
313fn bindgen_test_layout_ZL_GraphID() {
314 const UNINIT: ::std::mem::MaybeUninit<ZL_GraphID> = ::std::mem::MaybeUninit::uninit();
315 let ptr = UNINIT.as_ptr();
316 assert_eq!(
317 ::std::mem::size_of::<ZL_GraphID>(),
318 4usize,
319 "Size of ZL_GraphID"
320 );
321 assert_eq!(
322 ::std::mem::align_of::<ZL_GraphID>(),
323 4usize,
324 "Alignment of ZL_GraphID"
325 );
326 assert_eq!(
327 unsafe { ::std::ptr::addr_of!((*ptr).gid) as usize - ptr as usize },
328 0usize,
329 "Offset of field: ZL_GraphID::gid"
330 );
331}
332#[repr(C)]
333#[derive(Debug, Copy, Clone)]
334pub struct ZL_DictID {
335 pub id: ZL_UniqueID,
336}
337#[test]
338fn bindgen_test_layout_ZL_DictID() {
339 const UNINIT: ::std::mem::MaybeUninit<ZL_DictID> = ::std::mem::MaybeUninit::uninit();
340 let ptr = UNINIT.as_ptr();
341 assert_eq!(
342 ::std::mem::size_of::<ZL_DictID>(),
343 32usize,
344 "Size of ZL_DictID"
345 );
346 assert_eq!(
347 ::std::mem::align_of::<ZL_DictID>(),
348 1usize,
349 "Alignment of ZL_DictID"
350 );
351 assert_eq!(
352 unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
353 0usize,
354 "Offset of field: ZL_DictID::id"
355 );
356}
357#[repr(C)]
358#[derive(Debug, Copy, Clone)]
359pub struct ZL_MParamID {
360 pub id: ZL_UniqueID,
361}
362#[test]
363fn bindgen_test_layout_ZL_MParamID() {
364 const UNINIT: ::std::mem::MaybeUninit<ZL_MParamID> = ::std::mem::MaybeUninit::uninit();
365 let ptr = UNINIT.as_ptr();
366 assert_eq!(
367 ::std::mem::size_of::<ZL_MParamID>(),
368 32usize,
369 "Size of ZL_MParamID"
370 );
371 assert_eq!(
372 ::std::mem::align_of::<ZL_MParamID>(),
373 1usize,
374 "Alignment of ZL_MParamID"
375 );
376 assert_eq!(
377 unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
378 0usize,
379 "Offset of field: ZL_MParamID::id"
380 );
381}
382#[repr(C)]
383#[derive(Debug, Copy, Clone)]
384pub struct ZL_BundleID {
385 pub id: ZL_UniqueID,
386}
387#[test]
388fn bindgen_test_layout_ZL_BundleID() {
389 const UNINIT: ::std::mem::MaybeUninit<ZL_BundleID> = ::std::mem::MaybeUninit::uninit();
390 let ptr = UNINIT.as_ptr();
391 assert_eq!(
392 ::std::mem::size_of::<ZL_BundleID>(),
393 32usize,
394 "Size of ZL_BundleID"
395 );
396 assert_eq!(
397 ::std::mem::align_of::<ZL_BundleID>(),
398 1usize,
399 "Alignment of ZL_BundleID"
400 );
401 assert_eq!(
402 unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
403 0usize,
404 "Offset of field: ZL_BundleID::id"
405 );
406}
407#[repr(C)]
408#[derive(Debug, Copy, Clone)]
409pub struct Stream_s {
410 _unused: [u8; 0],
411}
412pub type Stream = Stream_s;
413pub type ZL_Data = Stream;
414#[repr(C)]
415#[derive(Debug, Copy, Clone)]
416pub struct ZL_Input_s {
417 _unused: [u8; 0],
418}
419pub type ZL_Input = ZL_Input_s;
420#[repr(C)]
421#[derive(Debug, Copy, Clone)]
422pub struct ZL_Output_s {
423 _unused: [u8; 0],
424}
425pub type ZL_Output = ZL_Output_s;
426pub type ZL_TypedRef = ZL_Input;
427#[repr(C)]
428#[derive(Debug, Copy, Clone)]
429pub struct ZL_Compressor_s {
430 _unused: [u8; 0],
431}
432pub type ZL_Compressor = ZL_Compressor_s;
433#[repr(C)]
434#[derive(Debug, Copy, Clone)]
435pub struct ZL_Materializer_s {
436 _unused: [u8; 0],
437}
438pub type ZL_Materializer = ZL_Materializer_s;
439#[repr(C)]
440#[derive(Debug, Copy, Clone)]
441pub struct ZL_CompressorSerializer_s {
442 _unused: [u8; 0],
443}
444pub type ZL_CompressorSerializer = ZL_CompressorSerializer_s;
445#[repr(C)]
446#[derive(Debug, Copy, Clone)]
447pub struct ZL_CompressorDeserializer_s {
448 _unused: [u8; 0],
449}
450pub type ZL_CompressorDeserializer = ZL_CompressorDeserializer_s;
451#[repr(C)]
452#[derive(Debug, Copy, Clone)]
453pub struct ZL_CCtx_s {
454 _unused: [u8; 0],
455}
456pub type ZL_CCtx = ZL_CCtx_s;
457#[repr(C)]
458#[derive(Debug, Copy, Clone)]
459pub struct ZL_DCtx_s {
460 _unused: [u8; 0],
461}
462pub type ZL_DCtx = ZL_DCtx_s;
463#[repr(C)]
464#[derive(Debug, Copy, Clone)]
465pub struct ZL_Encoder_s {
466 _unused: [u8; 0],
467}
468pub type ZL_Encoder = ZL_Encoder_s;
469#[repr(C)]
470#[derive(Debug, Copy, Clone)]
471pub struct ZL_Decoder_s {
472 _unused: [u8; 0],
473}
474pub type ZL_Decoder = ZL_Decoder_s;
475#[repr(C)]
476#[derive(Debug, Copy, Clone)]
477pub struct ZL_Selector_s {
478 _unused: [u8; 0],
479}
480pub type ZL_Selector = ZL_Selector_s;
481#[repr(C)]
482#[derive(Debug, Copy, Clone)]
483pub struct ZL_Graph_s {
484 _unused: [u8; 0],
485}
486pub type ZL_Graph = ZL_Graph_s;
487#[repr(C)]
488#[derive(Debug, Copy, Clone)]
489pub struct ZL_Edge_s {
490 _unused: [u8; 0],
491}
492pub type ZL_Edge = ZL_Edge_s;
493#[doc = " @defgroup Group_Compressor_GraphCustomization Graph Customization\n\n Graphs can be customized to override their name, local parameters, custom\n nodes and custom graphs. This is an advanced use case, and mainly an\n implementation detail of graphs. Most graphs which accept parameters provide\n helper functions to correctly parameterize the graph.\n\n @{"]
494pub type ZL_RuntimeGraphParameters = ZL_GraphParameters_s;
495#[repr(C)]
496#[derive(Debug, Copy, Clone)]
497pub struct ZL_Segmenter_s {
498 _unused: [u8; 0],
499}
500pub type ZL_Segmenter = ZL_Segmenter_s;
501#[repr(C)]
502#[derive(Debug, Copy, Clone)]
503pub struct ZL_DictLoader_s {
504 _unused: [u8; 0],
505}
506pub type ZL_DictLoader = ZL_DictLoader_s;
507pub const ZL_TernaryParam_auto: ZL_TernaryParam = 0;
508pub const ZL_TernaryParam_enable: ZL_TernaryParam = 1;
509pub const ZL_TernaryParam_disable: ZL_TernaryParam = 2;
510pub type ZL_TernaryParam = ::std::os::raw::c_uint;
511#[repr(C)]
512#[derive(Debug, Copy, Clone)]
513pub struct ZL_OpaquePtr {
514 #[doc = " Opaque pointer that is passed back to the user when calling functions\n like:\n - ZL_Encoder_getOpaquePtr()\n - ZL_Decoder_getOpaquePtr()\n - ZL_Graph_getOpaquePtr()\n - ZL_Selector_getOpaquePtr()"]
515 pub ptr: *mut ::std::os::raw::c_void,
516 #[doc = " Additional pointer passed to the free function.\n This additional pointer allows, for example, to use a C++ lambda as a\n free function."]
517 pub freeOpaquePtr: *mut ::std::os::raw::c_void,
518 #[doc = " Frees the ZL_OpaquePtr::ptr, and if needed also the\n ZL_OpaquePtr::freeOpaquePtr. This function is called exactly once by\n OpenZL once the opaque pointer has been registered.\n If freeFn is NULL, then it is not called."]
519 pub freeFn: ::std::option::Option<
520 unsafe extern "C" fn(
521 freeOpaquePtr: *mut ::std::os::raw::c_void,
522 ptr: *mut ::std::os::raw::c_void,
523 ),
524 >,
525}
526#[test]
527fn bindgen_test_layout_ZL_OpaquePtr() {
528 const UNINIT: ::std::mem::MaybeUninit<ZL_OpaquePtr> = ::std::mem::MaybeUninit::uninit();
529 let ptr = UNINIT.as_ptr();
530 assert_eq!(
531 ::std::mem::size_of::<ZL_OpaquePtr>(),
532 24usize,
533 "Size of ZL_OpaquePtr"
534 );
535 assert_eq!(
536 ::std::mem::align_of::<ZL_OpaquePtr>(),
537 8usize,
538 "Alignment of ZL_OpaquePtr"
539 );
540 assert_eq!(
541 unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize },
542 0usize,
543 "Offset of field: ZL_OpaquePtr::ptr"
544 );
545 assert_eq!(
546 unsafe { ::std::ptr::addr_of!((*ptr).freeOpaquePtr) as usize - ptr as usize },
547 8usize,
548 "Offset of field: ZL_OpaquePtr::freeOpaquePtr"
549 );
550 assert_eq!(
551 unsafe { ::std::ptr::addr_of!((*ptr).freeFn) as usize - ptr as usize },
552 16usize,
553 "Offset of field: ZL_OpaquePtr::freeFn"
554 );
555}
556#[repr(C)]
557#[derive(Debug, Copy, Clone)]
558pub struct ZL_GraphIDList {
559 pub graphids: *const ZL_GraphID,
560 pub nbGraphIDs: usize,
561}
562#[test]
563fn bindgen_test_layout_ZL_GraphIDList() {
564 const UNINIT: ::std::mem::MaybeUninit<ZL_GraphIDList> = ::std::mem::MaybeUninit::uninit();
565 let ptr = UNINIT.as_ptr();
566 assert_eq!(
567 ::std::mem::size_of::<ZL_GraphIDList>(),
568 16usize,
569 "Size of ZL_GraphIDList"
570 );
571 assert_eq!(
572 ::std::mem::align_of::<ZL_GraphIDList>(),
573 8usize,
574 "Alignment of ZL_GraphIDList"
575 );
576 assert_eq!(
577 unsafe { ::std::ptr::addr_of!((*ptr).graphids) as usize - ptr as usize },
578 0usize,
579 "Offset of field: ZL_GraphIDList::graphids"
580 );
581 assert_eq!(
582 unsafe { ::std::ptr::addr_of!((*ptr).nbGraphIDs) as usize - ptr as usize },
583 8usize,
584 "Offset of field: ZL_GraphIDList::nbGraphIDs"
585 );
586}
587#[repr(C)]
588#[derive(Debug, Copy, Clone)]
589pub struct ZL_NodeIDList {
590 pub nodeids: *const ZL_NodeID,
591 pub nbNodeIDs: usize,
592}
593#[test]
594fn bindgen_test_layout_ZL_NodeIDList() {
595 const UNINIT: ::std::mem::MaybeUninit<ZL_NodeIDList> = ::std::mem::MaybeUninit::uninit();
596 let ptr = UNINIT.as_ptr();
597 assert_eq!(
598 ::std::mem::size_of::<ZL_NodeIDList>(),
599 16usize,
600 "Size of ZL_NodeIDList"
601 );
602 assert_eq!(
603 ::std::mem::align_of::<ZL_NodeIDList>(),
604 8usize,
605 "Alignment of ZL_NodeIDList"
606 );
607 assert_eq!(
608 unsafe { ::std::ptr::addr_of!((*ptr).nodeids) as usize - ptr as usize },
609 0usize,
610 "Offset of field: ZL_NodeIDList::nodeids"
611 );
612 assert_eq!(
613 unsafe { ::std::ptr::addr_of!((*ptr).nbNodeIDs) as usize - ptr as usize },
614 8usize,
615 "Offset of field: ZL_NodeIDList::nbNodeIDs"
616 );
617}
618#[doc = " @brief Data layout for comment contained in the frame header."]
619#[repr(C)]
620#[derive(Debug, Copy, Clone)]
621pub struct ZL_Comment {
622 pub data: *const ::std::os::raw::c_void,
623 pub size: usize,
624}
625#[test]
626fn bindgen_test_layout_ZL_Comment() {
627 const UNINIT: ::std::mem::MaybeUninit<ZL_Comment> = ::std::mem::MaybeUninit::uninit();
628 let ptr = UNINIT.as_ptr();
629 assert_eq!(
630 ::std::mem::size_of::<ZL_Comment>(),
631 16usize,
632 "Size of ZL_Comment"
633 );
634 assert_eq!(
635 ::std::mem::align_of::<ZL_Comment>(),
636 8usize,
637 "Alignment of ZL_Comment"
638 );
639 assert_eq!(
640 unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
641 0usize,
642 "Offset of field: ZL_Comment::data"
643 );
644 assert_eq!(
645 unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
646 8usize,
647 "Offset of field: ZL_Comment::size"
648 );
649}
650#[doc = " @brief Typedef for void pointer to satisfy ZL_RESULT_OF requirements.\n\n ZL_RESULT_OF requires a bare type name, so we need a typedef for void*. You\n should use ZL_RESULT_OF(VoidPtr) instead of ZL_RESULT_OF(void*) and similarly\n with ZL_RESULT_DECLARE_SCOPE"]
651pub type ZL_VoidPtr = *mut ::std::os::raw::c_void;
652pub type ZL_ConstVoidPtr = *const ::std::os::raw::c_void;
653#[repr(C)]
654#[derive(Debug, Copy, Clone)]
655pub struct ZL_DynamicErrorInfo_s {
656 _unused: [u8; 0],
657}
658#[doc = " Forward Declarations *"]
659pub type ZL_DynamicErrorInfo = ZL_DynamicErrorInfo_s;
660#[doc = " ZL_StaticErrorInfo *"]
661pub type ZL_StaticErrorInfo = ZL_StaticErrorInfo_s;
662#[doc = " ZL_Error:\n\n The ZL_Error represents an optional failure. (If _code is\n ZL_ErrorCode_no_error, the object represents a success condition.) Depending\n on how it was constructed, the error may be \"bare\" (_info == NULL) or \"rich\",\n in which case it has an _info struct that can contain additional context and\n information about the error.\n\n The ZL_Error is usually returned-by-value, and therefore the definition\n needs to be publicly available. However, users should not directly interact\n with the members of the struct, and should instead use the various accessors\n and methods made available in the public API."]
663pub type ZL_Error = ZL_Error_s;
664#[doc = " Internally, there are two kinds of error info objects: dynamic and static,\n which are, like they sound, respectively dynamically allocated (and which\n must be freed) or statically allocated, but which therefore can't contain\n any runtime information.\n\n You should never assign or dereference these pointers directly:\n\n 1. We pack metadata into the unused bits of the pointers, which needs to be\n masked out to retrieve the actual pointer.\n 2. You need interact with that metadata to figure out or set which pointer\n is active.\n\n Instead:\n\n You should use @ref ZL_E_dy or @ref ZL_E_st to check for the presence of and\n to extract the (possibly NULL) pointers to the sub-types.\n\n You should use @ref ZL_EI_fromDy or @ref ZL_EI_fromSt to construct this\n object from one of those pointer."]
665pub type ZL_ErrorInfo = ZL_ErrorInfo_u;
666pub const ZL_ErrorCode_no_error: ZL_ErrorCode = 0;
667pub const ZL_ErrorCode_GENERIC: ZL_ErrorCode = 1;
668pub const ZL_ErrorCode_srcSize_tooSmall: ZL_ErrorCode = 3;
669pub const ZL_ErrorCode_srcSize_tooLarge: ZL_ErrorCode = 4;
670pub const ZL_ErrorCode_dstCapacity_tooSmall: ZL_ErrorCode = 5;
671pub const ZL_ErrorCode_userBuffer_alignmentIncorrect: ZL_ErrorCode = 6;
672pub const ZL_ErrorCode_decompression_incorrectAPI: ZL_ErrorCode = 7;
673pub const ZL_ErrorCode_userBuffers_invalidNum: ZL_ErrorCode = 8;
674pub const ZL_ErrorCode_invalidName: ZL_ErrorCode = 9;
675pub const ZL_ErrorCode_header_unknown: ZL_ErrorCode = 10;
676pub const ZL_ErrorCode_frameParameter_unsupported: ZL_ErrorCode = 11;
677pub const ZL_ErrorCode_corruption: ZL_ErrorCode = 12;
678pub const ZL_ErrorCode_compressedChecksumWrong: ZL_ErrorCode = 13;
679pub const ZL_ErrorCode_contentChecksumWrong: ZL_ErrorCode = 14;
680pub const ZL_ErrorCode_outputs_tooNumerous: ZL_ErrorCode = 15;
681pub const ZL_ErrorCode_compressionParameter_invalid: ZL_ErrorCode = 20;
682pub const ZL_ErrorCode_parameter_invalid: ZL_ErrorCode = 21;
683pub const ZL_ErrorCode_outputID_invalid: ZL_ErrorCode = 22;
684pub const ZL_ErrorCode_invalidRequest_singleOutputFrameOnly: ZL_ErrorCode = 23;
685pub const ZL_ErrorCode_outputNotCommitted: ZL_ErrorCode = 24;
686pub const ZL_ErrorCode_outputNotReserved: ZL_ErrorCode = 25;
687pub const ZL_ErrorCode_segmenter_inputNotConsumed: ZL_ErrorCode = 26;
688pub const ZL_ErrorCode_segmenter_noSegments: ZL_ErrorCode = 27;
689pub const ZL_ErrorCode_graph_invalid: ZL_ErrorCode = 30;
690pub const ZL_ErrorCode_graph_nonserializable: ZL_ErrorCode = 31;
691pub const ZL_ErrorCode_invalidTransform: ZL_ErrorCode = 32;
692pub const ZL_ErrorCode_graph_invalidNumInputs: ZL_ErrorCode = 33;
693pub const ZL_ErrorCode_graph_parser_malformedInput: ZL_ErrorCode = 34;
694pub const ZL_ErrorCode_graph_parser_unhandledInput: ZL_ErrorCode = 35;
695pub const ZL_ErrorCode_successor_invalid: ZL_ErrorCode = 40;
696pub const ZL_ErrorCode_successor_alreadySet: ZL_ErrorCode = 41;
697pub const ZL_ErrorCode_successor_invalidNumInputs: ZL_ErrorCode = 42;
698pub const ZL_ErrorCode_inputType_unsupported: ZL_ErrorCode = 43;
699pub const ZL_ErrorCode_graphParameter_invalid: ZL_ErrorCode = 44;
700pub const ZL_ErrorCode_nodeParameter_invalid: ZL_ErrorCode = 50;
701pub const ZL_ErrorCode_nodeParameter_invalidValue: ZL_ErrorCode = 51;
702pub const ZL_ErrorCode_transform_executionFailure: ZL_ErrorCode = 52;
703pub const ZL_ErrorCode_customNode_definitionInvalid: ZL_ErrorCode = 53;
704pub const ZL_ErrorCode_node_unexpected_input_type: ZL_ErrorCode = 54;
705pub const ZL_ErrorCode_node_invalid_input: ZL_ErrorCode = 55;
706pub const ZL_ErrorCode_node_invalid: ZL_ErrorCode = 56;
707pub const ZL_ErrorCode_nodeExecution_invalidOutputs: ZL_ErrorCode = 57;
708pub const ZL_ErrorCode_nodeRegen_countIncorrect: ZL_ErrorCode = 58;
709pub const ZL_ErrorCode_formatVersion_unsupported: ZL_ErrorCode = 60;
710pub const ZL_ErrorCode_formatVersion_notSet: ZL_ErrorCode = 61;
711pub const ZL_ErrorCode_node_versionMismatch: ZL_ErrorCode = 62;
712pub const ZL_ErrorCode_dict_corruption: ZL_ErrorCode = 65;
713pub const ZL_ErrorCode_dict_materialization: ZL_ErrorCode = 66;
714pub const ZL_ErrorCode_noValidMaterialization: ZL_ErrorCode = 67;
715pub const ZL_ErrorCode_dictNoRecord: ZL_ErrorCode = 68;
716pub const ZL_ErrorCode_allocation: ZL_ErrorCode = 70;
717pub const ZL_ErrorCode_internalBuffer_tooSmall: ZL_ErrorCode = 71;
718pub const ZL_ErrorCode_integerOverflow: ZL_ErrorCode = 72;
719pub const ZL_ErrorCode_stream_wrongInit: ZL_ErrorCode = 73;
720pub const ZL_ErrorCode_streamType_incorrect: ZL_ErrorCode = 74;
721pub const ZL_ErrorCode_streamCapacity_tooSmall: ZL_ErrorCode = 75;
722pub const ZL_ErrorCode_streamParameter_invalid: ZL_ErrorCode = 76;
723pub const ZL_ErrorCode_logicError: ZL_ErrorCode = 80;
724pub const ZL_ErrorCode_temporaryLibraryLimitation: ZL_ErrorCode = 81;
725pub const ZL_ErrorCode_maxCode: ZL_ErrorCode = 99;
726#[doc = " ZL_ErrorCode *"]
727pub type ZL_ErrorCode = ::std::os::raw::c_uint;
728#[repr(C)]
729#[derive(Debug, Copy, Clone)]
730pub struct ZL_OperationContext_s {
731 _unused: [u8; 0],
732}
733pub type ZL_OperationContext = ZL_OperationContext_s;
734#[repr(C)]
735#[derive(Debug, Copy, Clone)]
736pub struct ZL_GraphContext {
737 #[doc = " The current nodeID or 0 for unset / unknown."]
738 pub nodeID: ZL_NodeID,
739 #[doc = " The current graphID or 0 for unset / unknown."]
740 pub graphID: ZL_GraphID,
741 #[doc = " The current transformID or 0 for unset / unknown."]
742 pub transformID: ZL_IDType,
743 #[doc = " The name of the component, may be NULL."]
744 pub name: *const ::std::os::raw::c_char,
745}
746#[test]
747fn bindgen_test_layout_ZL_GraphContext() {
748 const UNINIT: ::std::mem::MaybeUninit<ZL_GraphContext> = ::std::mem::MaybeUninit::uninit();
749 let ptr = UNINIT.as_ptr();
750 assert_eq!(
751 ::std::mem::size_of::<ZL_GraphContext>(),
752 24usize,
753 "Size of ZL_GraphContext"
754 );
755 assert_eq!(
756 ::std::mem::align_of::<ZL_GraphContext>(),
757 8usize,
758 "Alignment of ZL_GraphContext"
759 );
760 assert_eq!(
761 unsafe { ::std::ptr::addr_of!((*ptr).nodeID) as usize - ptr as usize },
762 0usize,
763 "Offset of field: ZL_GraphContext::nodeID"
764 );
765 assert_eq!(
766 unsafe { ::std::ptr::addr_of!((*ptr).graphID) as usize - ptr as usize },
767 4usize,
768 "Offset of field: ZL_GraphContext::graphID"
769 );
770 assert_eq!(
771 unsafe { ::std::ptr::addr_of!((*ptr).transformID) as usize - ptr as usize },
772 8usize,
773 "Offset of field: ZL_GraphContext::transformID"
774 );
775 assert_eq!(
776 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
777 16usize,
778 "Offset of field: ZL_GraphContext::name"
779 );
780}
781#[repr(C)]
782#[derive(Debug, Copy, Clone)]
783pub struct ZL_ErrorContext {
784 #[doc = " Pointer to the operation context to store dynamic error info in, or NULL\n to opt out of dynamic error info."]
785 pub opCtx: *mut ZL_OperationContext,
786 pub graphCtx: ZL_GraphContext,
787}
788#[test]
789fn bindgen_test_layout_ZL_ErrorContext() {
790 const UNINIT: ::std::mem::MaybeUninit<ZL_ErrorContext> = ::std::mem::MaybeUninit::uninit();
791 let ptr = UNINIT.as_ptr();
792 assert_eq!(
793 ::std::mem::size_of::<ZL_ErrorContext>(),
794 32usize,
795 "Size of ZL_ErrorContext"
796 );
797 assert_eq!(
798 ::std::mem::align_of::<ZL_ErrorContext>(),
799 8usize,
800 "Alignment of ZL_ErrorContext"
801 );
802 assert_eq!(
803 unsafe { ::std::ptr::addr_of!((*ptr).opCtx) as usize - ptr as usize },
804 0usize,
805 "Offset of field: ZL_ErrorContext::opCtx"
806 );
807 assert_eq!(
808 unsafe { ::std::ptr::addr_of!((*ptr).graphCtx) as usize - ptr as usize },
809 8usize,
810 "Offset of field: ZL_ErrorContext::graphCtx"
811 );
812}
813extern "C" {
814 pub fn ZL_Compressor_getOperationContext(ctx: *mut ZL_Compressor) -> *mut ZL_OperationContext;
815}
816extern "C" {
817 pub fn ZL_CCtx_getOperationContext(ctx: *mut ZL_CCtx) -> *mut ZL_OperationContext;
818}
819extern "C" {
820 pub fn ZL_DCtx_getOperationContext(ctx: *mut ZL_DCtx) -> *mut ZL_OperationContext;
821}
822extern "C" {
823 pub fn ZL_Encoder_getOperationContext(ctx: *mut ZL_Encoder) -> *mut ZL_OperationContext;
824}
825extern "C" {
826 pub fn ZL_Decoder_getOperationContext(ctx: *mut ZL_Decoder) -> *mut ZL_OperationContext;
827}
828extern "C" {
829 pub fn ZL_Graph_getOperationContext(ctx: *mut ZL_Graph) -> *mut ZL_OperationContext;
830}
831extern "C" {
832 pub fn ZL_Edge_getOperationContext(ctx: *mut ZL_Edge) -> *mut ZL_OperationContext;
833}
834extern "C" {
835 pub fn ZL_CompressorSerializer_getOperationContext(
836 ctx: *mut ZL_CompressorSerializer,
837 ) -> *mut ZL_OperationContext;
838}
839extern "C" {
840 pub fn ZL_CompressorDeserializer_getOperationContext(
841 ctx: *mut ZL_CompressorDeserializer,
842 ) -> *mut ZL_OperationContext;
843}
844extern "C" {
845 pub fn ZL_Segmenter_getOperationContext(ctx: *mut ZL_Segmenter) -> *mut ZL_OperationContext;
846}
847extern "C" {
848 pub fn ZL_Materializer_getOperationContext(
849 ctx: *mut ZL_Materializer,
850 ) -> *mut ZL_OperationContext;
851}
852extern "C" {
853 pub fn ZL_ErrorContext_getOperationContext(
854 ctx: *mut ZL_ErrorContext,
855 ) -> *mut ZL_OperationContext;
856}
857extern "C" {
858 pub fn ZL_NULL_getOperationContext(
859 ctx: *mut ::std::os::raw::c_void,
860 ) -> *mut ZL_OperationContext;
861}
862extern "C" {
863 pub fn ZL_OperationContext_getDefaultErrorContext(
864 opCtx: *mut ZL_OperationContext,
865 ) -> *mut ZL_ErrorContext;
866}
867#[doc = " ZL_StaticErrorInfo *"]
868#[repr(C)]
869#[derive(Debug, Copy, Clone)]
870pub struct ZL_StaticErrorInfo_s {
871 pub code: ZL_ErrorCode,
872 pub fmt: *const ::std::os::raw::c_char,
873 pub file: *const ::std::os::raw::c_char,
874 pub func: *const ::std::os::raw::c_char,
875 pub line: ::std::os::raw::c_int,
876}
877#[test]
878fn bindgen_test_layout_ZL_StaticErrorInfo_s() {
879 const UNINIT: ::std::mem::MaybeUninit<ZL_StaticErrorInfo_s> = ::std::mem::MaybeUninit::uninit();
880 let ptr = UNINIT.as_ptr();
881 assert_eq!(
882 ::std::mem::size_of::<ZL_StaticErrorInfo_s>(),
883 40usize,
884 "Size of ZL_StaticErrorInfo_s"
885 );
886 assert_eq!(
887 ::std::mem::align_of::<ZL_StaticErrorInfo_s>(),
888 8usize,
889 "Alignment of ZL_StaticErrorInfo_s"
890 );
891 assert_eq!(
892 unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize },
893 0usize,
894 "Offset of field: ZL_StaticErrorInfo_s::code"
895 );
896 assert_eq!(
897 unsafe { ::std::ptr::addr_of!((*ptr).fmt) as usize - ptr as usize },
898 8usize,
899 "Offset of field: ZL_StaticErrorInfo_s::fmt"
900 );
901 assert_eq!(
902 unsafe { ::std::ptr::addr_of!((*ptr).file) as usize - ptr as usize },
903 16usize,
904 "Offset of field: ZL_StaticErrorInfo_s::file"
905 );
906 assert_eq!(
907 unsafe { ::std::ptr::addr_of!((*ptr).func) as usize - ptr as usize },
908 24usize,
909 "Offset of field: ZL_StaticErrorInfo_s::func"
910 );
911 assert_eq!(
912 unsafe { ::std::ptr::addr_of!((*ptr).line) as usize - ptr as usize },
913 32usize,
914 "Offset of field: ZL_StaticErrorInfo_s::line"
915 );
916}
917#[doc = " Internally, there are two kinds of error info objects: dynamic and static,\n which are, like they sound, respectively dynamically allocated (and which\n must be freed) or statically allocated, but which therefore can't contain\n any runtime information.\n\n You should never assign or dereference these pointers directly:\n\n 1. We pack metadata into the unused bits of the pointers, which needs to be\n masked out to retrieve the actual pointer.\n 2. You need interact with that metadata to figure out or set which pointer\n is active.\n\n Instead:\n\n You should use @ref ZL_E_dy or @ref ZL_E_st to check for the presence of and\n to extract the (possibly NULL) pointers to the sub-types.\n\n You should use @ref ZL_EI_fromDy or @ref ZL_EI_fromSt to construct this\n object from one of those pointer."]
918#[repr(C)]
919#[derive(Copy, Clone)]
920pub union ZL_ErrorInfo_u {
921 pub _dy: *mut ZL_DynamicErrorInfo,
922 pub _st: *const ZL_StaticErrorInfo,
923}
924#[test]
925fn bindgen_test_layout_ZL_ErrorInfo_u() {
926 const UNINIT: ::std::mem::MaybeUninit<ZL_ErrorInfo_u> = ::std::mem::MaybeUninit::uninit();
927 let ptr = UNINIT.as_ptr();
928 assert_eq!(
929 ::std::mem::size_of::<ZL_ErrorInfo_u>(),
930 8usize,
931 "Size of ZL_ErrorInfo_u"
932 );
933 assert_eq!(
934 ::std::mem::align_of::<ZL_ErrorInfo_u>(),
935 8usize,
936 "Alignment of ZL_ErrorInfo_u"
937 );
938 assert_eq!(
939 unsafe { ::std::ptr::addr_of!((*ptr)._dy) as usize - ptr as usize },
940 0usize,
941 "Offset of field: ZL_ErrorInfo_u::_dy"
942 );
943 assert_eq!(
944 unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize },
945 0usize,
946 "Offset of field: ZL_ErrorInfo_u::_st"
947 );
948}
949#[doc = " ZL_Error:\n\n The ZL_Error represents an optional failure. (If _code is\n ZL_ErrorCode_no_error, the object represents a success condition.) Depending\n on how it was constructed, the error may be \"bare\" (_info == NULL) or \"rich\",\n in which case it has an _info struct that can contain additional context and\n information about the error.\n\n The ZL_Error is usually returned-by-value, and therefore the definition\n needs to be publicly available. However, users should not directly interact\n with the members of the struct, and should instead use the various accessors\n and methods made available in the public API."]
950#[repr(C)]
951#[derive(Copy, Clone)]
952pub struct ZL_Error_s {
953 pub _code: ZL_ErrorCode,
954 pub _info: ZL_ErrorInfo,
955}
956#[test]
957fn bindgen_test_layout_ZL_Error_s() {
958 const UNINIT: ::std::mem::MaybeUninit<ZL_Error_s> = ::std::mem::MaybeUninit::uninit();
959 let ptr = UNINIT.as_ptr();
960 assert_eq!(
961 ::std::mem::size_of::<ZL_Error_s>(),
962 16usize,
963 "Size of ZL_Error_s"
964 );
965 assert_eq!(
966 ::std::mem::align_of::<ZL_Error_s>(),
967 8usize,
968 "Alignment of ZL_Error_s"
969 );
970 assert_eq!(
971 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
972 0usize,
973 "Offset of field: ZL_Error_s::_code"
974 );
975 assert_eq!(
976 unsafe { ::std::ptr::addr_of!((*ptr)._info) as usize - ptr as usize },
977 8usize,
978 "Offset of field: ZL_Error_s::_info"
979 );
980}
981extern "C" {
982 #[link_name = "ZL_EE_fromStaticErrorInfo__extern"]
983 pub fn ZL_EE_fromStaticErrorInfo(st: *const ZL_StaticErrorInfo) -> ZL_ErrorInfo;
984}
985extern "C" {
986 #[doc = " Actual implementation function which accepts all of the explicit arguments\n that are set up for you by the macros elsewhere. Prefer to use those macros\n rather than this function directly.\n - `file` arg is intended to be filled with __FILE__ macro.\n - `func` arg is intended to be filled with __func__ macro.\n - `line` arg is intended to be filled with __LINE__ macro."]
987 pub fn ZL_E_create(
988 st: *const ZL_StaticErrorInfo,
989 ctx: *const ZL_ErrorContext,
990 file: *const ::std::os::raw::c_char,
991 func: *const ::std::os::raw::c_char,
992 line: ::std::os::raw::c_int,
993 code: ZL_ErrorCode,
994 fmt: *const ::std::os::raw::c_char,
995 ...
996 ) -> ZL_Error;
997}
998extern "C" {
999 #[doc = " Append a formatted string to the error's message. May be a no-op if the\n error doesn't have a rich error info set up internally."]
1000 pub fn ZL_E_appendToMessage(err: ZL_Error, fmt: *const ::std::os::raw::c_char, ...);
1001}
1002extern "C" {
1003 #[doc = " Attempts to add more information to the error represented by @p error.\n Narrowly, this means trying to append a stack frame to the stacktrace that\n rich errors accumulate. In service of that, it also tries to up-convert the\n error to a rich error if it isn't already. @p fmt and optional additional\n following args can also be used to append an arbitrary formatted string of\n information into the error.\n\n This function can be called directly, but is primarily used indirectly.\n Firstly, if you want to invoke this function yourself, it's easier to use\n @ref ZL_E_ADDFRAME instead since it populates some of the arguments\n for you. Secondly, this is an implementation detail mostly here to be used\n by @ref ZL_ERR_IF_ERR and friends, which call this to add more context to\n the error as it passes by.\n\n @note OpenZL must have been compiled with ZL_ERROR_ENABLE_STACKS defined to\n true for this to do anything. (This is the default.)\n\n @returns the modified error."]
1004 pub fn ZL_E_addFrame(
1005 ctx: *const ZL_ErrorContext,
1006 error: ZL_Error,
1007 backup: ZL_ErrorInfo,
1008 file: *const ::std::os::raw::c_char,
1009 func: *const ::std::os::raw::c_char,
1010 line: ::std::os::raw::c_int,
1011 fmt: *const ::std::os::raw::c_char,
1012 ...
1013 ) -> ZL_Error;
1014}
1015#[doc = " ZL_Error_Array: a const view into an array of errors, returned by some\n public APIs."]
1016#[repr(C)]
1017#[derive(Debug, Copy, Clone)]
1018pub struct ZL_Error_Array {
1019 pub errors: *const ZL_Error,
1020 pub size: usize,
1021}
1022#[test]
1023fn bindgen_test_layout_ZL_Error_Array() {
1024 const UNINIT: ::std::mem::MaybeUninit<ZL_Error_Array> = ::std::mem::MaybeUninit::uninit();
1025 let ptr = UNINIT.as_ptr();
1026 assert_eq!(
1027 ::std::mem::size_of::<ZL_Error_Array>(),
1028 16usize,
1029 "Size of ZL_Error_Array"
1030 );
1031 assert_eq!(
1032 ::std::mem::align_of::<ZL_Error_Array>(),
1033 8usize,
1034 "Alignment of ZL_Error_Array"
1035 );
1036 assert_eq!(
1037 unsafe { ::std::ptr::addr_of!((*ptr).errors) as usize - ptr as usize },
1038 0usize,
1039 "Offset of field: ZL_Error_Array::errors"
1040 );
1041 assert_eq!(
1042 unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
1043 8usize,
1044 "Offset of field: ZL_Error_Array::size"
1045 );
1046}
1047#[repr(C)]
1048#[derive(Debug, Copy, Clone)]
1049pub struct ZL_Result_ZL_GraphID_inner {
1050 pub _code: ZL_ErrorCode,
1051 pub _value: ZL_GraphID,
1052}
1053#[test]
1054fn bindgen_test_layout_ZL_Result_ZL_GraphID_inner() {
1055 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_GraphID_inner> =
1056 ::std::mem::MaybeUninit::uninit();
1057 let ptr = UNINIT.as_ptr();
1058 assert_eq!(
1059 ::std::mem::size_of::<ZL_Result_ZL_GraphID_inner>(),
1060 8usize,
1061 "Size of ZL_Result_ZL_GraphID_inner"
1062 );
1063 assert_eq!(
1064 ::std::mem::align_of::<ZL_Result_ZL_GraphID_inner>(),
1065 4usize,
1066 "Alignment of ZL_Result_ZL_GraphID_inner"
1067 );
1068 assert_eq!(
1069 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1070 0usize,
1071 "Offset of field: ZL_Result_ZL_GraphID_inner::_code"
1072 );
1073 assert_eq!(
1074 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1075 4usize,
1076 "Offset of field: ZL_Result_ZL_GraphID_inner::_value"
1077 );
1078}
1079#[repr(C)]
1080#[derive(Copy, Clone)]
1081pub union ZL_Result_ZL_GraphID_u {
1082 pub _code: ZL_ErrorCode,
1083 pub _value: ZL_Result_ZL_GraphID_inner,
1084 pub _error: ZL_Error,
1085}
1086#[test]
1087fn bindgen_test_layout_ZL_Result_ZL_GraphID_u() {
1088 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_GraphID_u> =
1089 ::std::mem::MaybeUninit::uninit();
1090 let ptr = UNINIT.as_ptr();
1091 assert_eq!(
1092 ::std::mem::size_of::<ZL_Result_ZL_GraphID_u>(),
1093 16usize,
1094 "Size of ZL_Result_ZL_GraphID_u"
1095 );
1096 assert_eq!(
1097 ::std::mem::align_of::<ZL_Result_ZL_GraphID_u>(),
1098 8usize,
1099 "Alignment of ZL_Result_ZL_GraphID_u"
1100 );
1101 assert_eq!(
1102 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1103 0usize,
1104 "Offset of field: ZL_Result_ZL_GraphID_u::_code"
1105 );
1106 assert_eq!(
1107 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1108 0usize,
1109 "Offset of field: ZL_Result_ZL_GraphID_u::_value"
1110 );
1111 assert_eq!(
1112 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
1113 0usize,
1114 "Offset of field: ZL_Result_ZL_GraphID_u::_error"
1115 );
1116}
1117pub type ZL_Result_ZL_GraphID = ZL_Result_ZL_GraphID_u;
1118extern "C" {
1119 #[link_name = "ZL_Result_ZL_GraphID_extract__extern"]
1120 pub fn ZL_Result_ZL_GraphID_extract(
1121 result: ZL_Result_ZL_GraphID,
1122 error: *mut ZL_Error,
1123 ) -> ZL_GraphID;
1124}
1125pub type ZL_Result_ZL_GraphID_fake_type_needs_semicolon = ::std::os::raw::c_int;
1126#[repr(C)]
1127#[derive(Debug, Copy, Clone)]
1128pub struct ZL_Result_ZL_NodeID_inner {
1129 pub _code: ZL_ErrorCode,
1130 pub _value: ZL_NodeID,
1131}
1132#[test]
1133fn bindgen_test_layout_ZL_Result_ZL_NodeID_inner() {
1134 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_NodeID_inner> =
1135 ::std::mem::MaybeUninit::uninit();
1136 let ptr = UNINIT.as_ptr();
1137 assert_eq!(
1138 ::std::mem::size_of::<ZL_Result_ZL_NodeID_inner>(),
1139 8usize,
1140 "Size of ZL_Result_ZL_NodeID_inner"
1141 );
1142 assert_eq!(
1143 ::std::mem::align_of::<ZL_Result_ZL_NodeID_inner>(),
1144 4usize,
1145 "Alignment of ZL_Result_ZL_NodeID_inner"
1146 );
1147 assert_eq!(
1148 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1149 0usize,
1150 "Offset of field: ZL_Result_ZL_NodeID_inner::_code"
1151 );
1152 assert_eq!(
1153 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1154 4usize,
1155 "Offset of field: ZL_Result_ZL_NodeID_inner::_value"
1156 );
1157}
1158#[repr(C)]
1159#[derive(Copy, Clone)]
1160pub union ZL_Result_ZL_NodeID_u {
1161 pub _code: ZL_ErrorCode,
1162 pub _value: ZL_Result_ZL_NodeID_inner,
1163 pub _error: ZL_Error,
1164}
1165#[test]
1166fn bindgen_test_layout_ZL_Result_ZL_NodeID_u() {
1167 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_NodeID_u> =
1168 ::std::mem::MaybeUninit::uninit();
1169 let ptr = UNINIT.as_ptr();
1170 assert_eq!(
1171 ::std::mem::size_of::<ZL_Result_ZL_NodeID_u>(),
1172 16usize,
1173 "Size of ZL_Result_ZL_NodeID_u"
1174 );
1175 assert_eq!(
1176 ::std::mem::align_of::<ZL_Result_ZL_NodeID_u>(),
1177 8usize,
1178 "Alignment of ZL_Result_ZL_NodeID_u"
1179 );
1180 assert_eq!(
1181 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1182 0usize,
1183 "Offset of field: ZL_Result_ZL_NodeID_u::_code"
1184 );
1185 assert_eq!(
1186 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1187 0usize,
1188 "Offset of field: ZL_Result_ZL_NodeID_u::_value"
1189 );
1190 assert_eq!(
1191 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
1192 0usize,
1193 "Offset of field: ZL_Result_ZL_NodeID_u::_error"
1194 );
1195}
1196pub type ZL_Result_ZL_NodeID = ZL_Result_ZL_NodeID_u;
1197extern "C" {
1198 #[link_name = "ZL_Result_ZL_NodeID_extract__extern"]
1199 pub fn ZL_Result_ZL_NodeID_extract(
1200 result: ZL_Result_ZL_NodeID,
1201 error: *mut ZL_Error,
1202 ) -> ZL_NodeID;
1203}
1204pub type ZL_Result_ZL_NodeID_fake_type_needs_semicolon = ::std::os::raw::c_int;
1205#[repr(C)]
1206#[derive(Debug, Copy, Clone)]
1207pub struct ZL_Result_ZL_VoidPtr_inner {
1208 pub _code: ZL_ErrorCode,
1209 pub _value: ZL_VoidPtr,
1210}
1211#[test]
1212fn bindgen_test_layout_ZL_Result_ZL_VoidPtr_inner() {
1213 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_VoidPtr_inner> =
1214 ::std::mem::MaybeUninit::uninit();
1215 let ptr = UNINIT.as_ptr();
1216 assert_eq!(
1217 ::std::mem::size_of::<ZL_Result_ZL_VoidPtr_inner>(),
1218 16usize,
1219 "Size of ZL_Result_ZL_VoidPtr_inner"
1220 );
1221 assert_eq!(
1222 ::std::mem::align_of::<ZL_Result_ZL_VoidPtr_inner>(),
1223 8usize,
1224 "Alignment of ZL_Result_ZL_VoidPtr_inner"
1225 );
1226 assert_eq!(
1227 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1228 0usize,
1229 "Offset of field: ZL_Result_ZL_VoidPtr_inner::_code"
1230 );
1231 assert_eq!(
1232 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1233 8usize,
1234 "Offset of field: ZL_Result_ZL_VoidPtr_inner::_value"
1235 );
1236}
1237#[repr(C)]
1238#[derive(Copy, Clone)]
1239pub union ZL_Result_ZL_VoidPtr_u {
1240 pub _code: ZL_ErrorCode,
1241 pub _value: ZL_Result_ZL_VoidPtr_inner,
1242 pub _error: ZL_Error,
1243}
1244#[test]
1245fn bindgen_test_layout_ZL_Result_ZL_VoidPtr_u() {
1246 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_VoidPtr_u> =
1247 ::std::mem::MaybeUninit::uninit();
1248 let ptr = UNINIT.as_ptr();
1249 assert_eq!(
1250 ::std::mem::size_of::<ZL_Result_ZL_VoidPtr_u>(),
1251 16usize,
1252 "Size of ZL_Result_ZL_VoidPtr_u"
1253 );
1254 assert_eq!(
1255 ::std::mem::align_of::<ZL_Result_ZL_VoidPtr_u>(),
1256 8usize,
1257 "Alignment of ZL_Result_ZL_VoidPtr_u"
1258 );
1259 assert_eq!(
1260 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1261 0usize,
1262 "Offset of field: ZL_Result_ZL_VoidPtr_u::_code"
1263 );
1264 assert_eq!(
1265 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1266 0usize,
1267 "Offset of field: ZL_Result_ZL_VoidPtr_u::_value"
1268 );
1269 assert_eq!(
1270 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
1271 0usize,
1272 "Offset of field: ZL_Result_ZL_VoidPtr_u::_error"
1273 );
1274}
1275pub type ZL_Result_ZL_VoidPtr = ZL_Result_ZL_VoidPtr_u;
1276extern "C" {
1277 #[link_name = "ZL_Result_ZL_VoidPtr_extract__extern"]
1278 pub fn ZL_Result_ZL_VoidPtr_extract(
1279 result: ZL_Result_ZL_VoidPtr,
1280 error: *mut ZL_Error,
1281 ) -> ZL_VoidPtr;
1282}
1283pub type ZL_Result_ZL_VoidPtr_fake_type_needs_semicolon = ::std::os::raw::c_int;
1284#[repr(C)]
1285#[derive(Debug, Copy, Clone)]
1286pub struct ZL_Result_ZL_ConstVoidPtr_inner {
1287 pub _code: ZL_ErrorCode,
1288 pub _value: ZL_ConstVoidPtr,
1289}
1290#[test]
1291fn bindgen_test_layout_ZL_Result_ZL_ConstVoidPtr_inner() {
1292 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_ConstVoidPtr_inner> =
1293 ::std::mem::MaybeUninit::uninit();
1294 let ptr = UNINIT.as_ptr();
1295 assert_eq!(
1296 ::std::mem::size_of::<ZL_Result_ZL_ConstVoidPtr_inner>(),
1297 16usize,
1298 "Size of ZL_Result_ZL_ConstVoidPtr_inner"
1299 );
1300 assert_eq!(
1301 ::std::mem::align_of::<ZL_Result_ZL_ConstVoidPtr_inner>(),
1302 8usize,
1303 "Alignment of ZL_Result_ZL_ConstVoidPtr_inner"
1304 );
1305 assert_eq!(
1306 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1307 0usize,
1308 "Offset of field: ZL_Result_ZL_ConstVoidPtr_inner::_code"
1309 );
1310 assert_eq!(
1311 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1312 8usize,
1313 "Offset of field: ZL_Result_ZL_ConstVoidPtr_inner::_value"
1314 );
1315}
1316#[repr(C)]
1317#[derive(Copy, Clone)]
1318pub union ZL_Result_ZL_ConstVoidPtr_u {
1319 pub _code: ZL_ErrorCode,
1320 pub _value: ZL_Result_ZL_ConstVoidPtr_inner,
1321 pub _error: ZL_Error,
1322}
1323#[test]
1324fn bindgen_test_layout_ZL_Result_ZL_ConstVoidPtr_u() {
1325 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_ConstVoidPtr_u> =
1326 ::std::mem::MaybeUninit::uninit();
1327 let ptr = UNINIT.as_ptr();
1328 assert_eq!(
1329 ::std::mem::size_of::<ZL_Result_ZL_ConstVoidPtr_u>(),
1330 16usize,
1331 "Size of ZL_Result_ZL_ConstVoidPtr_u"
1332 );
1333 assert_eq!(
1334 ::std::mem::align_of::<ZL_Result_ZL_ConstVoidPtr_u>(),
1335 8usize,
1336 "Alignment of ZL_Result_ZL_ConstVoidPtr_u"
1337 );
1338 assert_eq!(
1339 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1340 0usize,
1341 "Offset of field: ZL_Result_ZL_ConstVoidPtr_u::_code"
1342 );
1343 assert_eq!(
1344 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1345 0usize,
1346 "Offset of field: ZL_Result_ZL_ConstVoidPtr_u::_value"
1347 );
1348 assert_eq!(
1349 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
1350 0usize,
1351 "Offset of field: ZL_Result_ZL_ConstVoidPtr_u::_error"
1352 );
1353}
1354pub type ZL_Result_ZL_ConstVoidPtr = ZL_Result_ZL_ConstVoidPtr_u;
1355extern "C" {
1356 #[link_name = "ZL_Result_ZL_ConstVoidPtr_extract__extern"]
1357 pub fn ZL_Result_ZL_ConstVoidPtr_extract(
1358 result: ZL_Result_ZL_ConstVoidPtr,
1359 error: *mut ZL_Error,
1360 ) -> ZL_ConstVoidPtr;
1361}
1362pub type ZL_Result_ZL_ConstVoidPtr_fake_type_needs_semicolon = ::std::os::raw::c_int;
1363#[repr(C)]
1364#[derive(Debug, Copy, Clone)]
1365pub struct ZL_Result_size_t_inner {
1366 pub _code: ZL_ErrorCode,
1367 pub _value: usize,
1368}
1369#[test]
1370fn bindgen_test_layout_ZL_Result_size_t_inner() {
1371 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_size_t_inner> =
1372 ::std::mem::MaybeUninit::uninit();
1373 let ptr = UNINIT.as_ptr();
1374 assert_eq!(
1375 ::std::mem::size_of::<ZL_Result_size_t_inner>(),
1376 16usize,
1377 "Size of ZL_Result_size_t_inner"
1378 );
1379 assert_eq!(
1380 ::std::mem::align_of::<ZL_Result_size_t_inner>(),
1381 8usize,
1382 "Alignment of ZL_Result_size_t_inner"
1383 );
1384 assert_eq!(
1385 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1386 0usize,
1387 "Offset of field: ZL_Result_size_t_inner::_code"
1388 );
1389 assert_eq!(
1390 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1391 8usize,
1392 "Offset of field: ZL_Result_size_t_inner::_value"
1393 );
1394}
1395#[repr(C)]
1396#[derive(Copy, Clone)]
1397pub union ZL_Result_size_t_u {
1398 pub _code: ZL_ErrorCode,
1399 pub _value: ZL_Result_size_t_inner,
1400 pub _error: ZL_Error,
1401}
1402#[test]
1403fn bindgen_test_layout_ZL_Result_size_t_u() {
1404 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_size_t_u> = ::std::mem::MaybeUninit::uninit();
1405 let ptr = UNINIT.as_ptr();
1406 assert_eq!(
1407 ::std::mem::size_of::<ZL_Result_size_t_u>(),
1408 16usize,
1409 "Size of ZL_Result_size_t_u"
1410 );
1411 assert_eq!(
1412 ::std::mem::align_of::<ZL_Result_size_t_u>(),
1413 8usize,
1414 "Alignment of ZL_Result_size_t_u"
1415 );
1416 assert_eq!(
1417 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
1418 0usize,
1419 "Offset of field: ZL_Result_size_t_u::_code"
1420 );
1421 assert_eq!(
1422 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
1423 0usize,
1424 "Offset of field: ZL_Result_size_t_u::_value"
1425 );
1426 assert_eq!(
1427 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
1428 0usize,
1429 "Offset of field: ZL_Result_size_t_u::_error"
1430 );
1431}
1432pub type ZL_Result_size_t = ZL_Result_size_t_u;
1433extern "C" {
1434 #[link_name = "ZL_Result_size_t_extract__extern"]
1435 pub fn ZL_Result_size_t_extract(result: ZL_Result_size_t, error: *mut ZL_Error) -> usize;
1436}
1437pub type ZL_Result_size_t_fake_type_needs_semicolon = ::std::os::raw::c_int;
1438pub type ZL_Report = ZL_Result_size_t;
1439extern "C" {
1440 #[doc = " @returns true iff the report contains an error"]
1441 #[link_name = "ZL_isError__extern"]
1442 pub fn ZL_isError(report: ZL_Report) -> ::std::os::raw::c_int;
1443}
1444extern "C" {
1445 #[doc = " @pre !ZL_isError(report)\n @returns The value contained within the report"]
1446 #[link_name = "ZL_validResult__extern"]
1447 pub fn ZL_validResult(report: ZL_Report) -> usize;
1448}
1449extern "C" {
1450 #[doc = " @returns The error code contained within the report.\n If !ZL_isError(report), then @returns ZL_ErrorCode_no_error."]
1451 #[link_name = "ZL_errorCode__extern"]
1452 pub fn ZL_errorCode(report: ZL_Report) -> ZL_ErrorCode;
1453}
1454extern "C" {
1455 pub fn ZL_ErrorCode_toString(code: ZL_ErrorCode) -> *const ::std::os::raw::c_char;
1456}
1457extern "C" {
1458 #[doc = " @returns a successful report containing a value."]
1459 #[link_name = "ZL_returnValue__extern"]
1460 pub fn ZL_returnValue(s: usize) -> ZL_Report;
1461}
1462extern "C" {
1463 #[doc = " @returns a successful report without a value (set to zero)."]
1464 #[link_name = "ZL_returnSuccess__extern"]
1465 pub fn ZL_returnSuccess() -> ZL_Report;
1466}
1467extern "C" {
1468 #[doc = " @returns a specific ZL_ErrorCode as a ZL_Report return type."]
1469 pub fn ZL_returnError(err: ZL_ErrorCode) -> ZL_Report;
1470}
1471extern "C" {
1472 #[link_name = "ZL_E_isError__extern"]
1473 pub fn ZL_E_isError(err: ZL_Error) -> ::std::os::raw::c_int;
1474}
1475extern "C" {
1476 #[link_name = "ZL_E_code__extern"]
1477 pub fn ZL_E_code(err: ZL_Error) -> ZL_ErrorCode;
1478}
1479extern "C" {
1480 #[link_name = "ZL_E_codeStr__extern"]
1481 pub fn ZL_E_codeStr(err: ZL_Error) -> *const ::std::os::raw::c_char;
1482}
1483pub const ZL_Type_serial: ZL_Type = 1;
1484pub const ZL_Type_struct: ZL_Type = 2;
1485pub const ZL_Type_numeric: ZL_Type = 4;
1486pub const ZL_Type_string: ZL_Type = 8;
1487#[doc = " Any Data object has necessary a Type.\n The least specific Type is `ZL_Type_serial`,\n which means it's just a blob of bytes.\n Codecs can only accept and produce specified data Types.\n In contrast, Selectors & Graphs may optionally accept multiple data Types,\n using bitmap masking (example: `ZL_Type_struct | ZL_Type_numeric`)."]
1488pub type ZL_Type = ::std::os::raw::c_uint;
1489pub const ZL_DataArenaType_heap: ZL_DataArenaType = 0;
1490pub const ZL_DataArenaType_stack: ZL_DataArenaType = 1;
1491pub type ZL_DataArenaType = ::std::os::raw::c_uint;
1492extern "C" {
1493 pub fn ZL_Data_id(in_: *const ZL_Data) -> ZL_DataID;
1494}
1495extern "C" {
1496 pub fn ZL_Data_type(data: *const ZL_Data) -> ZL_Type;
1497}
1498extern "C" {
1499 #[doc = " @note invoking `ZL_Data_numElts()` is only valid for committed Data.\n If the Data object was received as an input, it's necessarily valid.\n So the issue can only happen for outputs,\n between allocation and commit.\n Querying `ZL_Data_numElts()` is not expected to be useful for output Data.\n @note `ZL_Type_serial` doesn't really have a concept of \"elt\".\n In this case, it returns Data size in bytes."]
1500 pub fn ZL_Data_numElts(data: *const ZL_Data) -> usize;
1501}
1502extern "C" {
1503 #[doc = " @return element width in nb of bytes\n This is only valid for fixed size elements,\n such as `ZL_Type_struct` or `ZL_Type_numeric`.\n If Type is `ZL_Type_string`, it returns 0 instead."]
1504 pub fn ZL_Data_eltWidth(data: *const ZL_Data) -> usize;
1505}
1506extern "C" {
1507 #[doc = " @return the nb of bytes committed into data's buffer\n (generally `== data->eltWidth * data->nbElts`).\n\n For `ZL_Type_string`, result is equal to `sum(data->stringLens)`.\n Returned value is provided in nb of bytes.\n\n @note invoking this symbol only makes sense if Data was\n previously committed.\n @note (@cyan): ZS2_Data_byteSize() is another name candidate."]
1508 pub fn ZL_Data_contentSize(data: *const ZL_Data) -> usize;
1509}
1510extern "C" {
1511 #[doc = " These methods provide direct access to internal buffer.\n Warning : users must pay attention to buffer boundaries.\n @return pointer to the _beginning_ of buffer.\n @note for `ZL_Type_string`, returns a pointer to the buffer containing the\n concatenated strings."]
1512 pub fn ZL_Data_rPtr(data: *const ZL_Data) -> *const ::std::os::raw::c_void;
1513}
1514extern "C" {
1515 pub fn ZL_Data_wPtr(data: *mut ZL_Data) -> *mut ::std::os::raw::c_void;
1516}
1517extern "C" {
1518 #[doc = " This method is only valid for `ZL_Type_string` Data.\n @return a pointer to the array of string lengths.\n The size of this array is `== ZL_Data_numElts(data)`.\n @return `NULL` if incorrect data type, or `StringLens` not allocated yet."]
1519 pub fn ZL_Data_rStringLens(data: *const ZL_Data) -> *const u32;
1520}
1521extern "C" {
1522 #[doc = " This method is only valid for `ZL_Type_string` Data.\n It requires write access into StringLens array.\n Only valid if StringLens array has already been allocated\n and not yet written into.\n @return NULL when any of the above conditions is violated.\n\n Array's capacity is supposed known from reservation request.\n After writing into the array, the nb of Strings, which is also\n the nb of String Lengths written, must be provided using\n ZL_Data_commit()."]
1523 pub fn ZL_Data_wStringLens(data: *mut ZL_Data) -> *mut u32;
1524}
1525extern "C" {
1526 #[doc = " This method is only valid for `ZL_Type_string` Data.\n It reserves memory space for StringLens array, and returns a pointer to it.\n The buffer is owned by @p data and has the same lifetime.\n The returned pointer can be used to write into the array.\n After writing into the array, the nb of String Lengths provided must be\n signaled using @ref ZL_Data_commit().\n This method will fail if StringLens is already allocated.\n @return `NULL` if incorrect data type, or allocation error."]
1527 pub fn ZL_Data_reserveStringLens(data: *mut ZL_Data, nbStrings: usize) -> *mut u32;
1528}
1529extern "C" {
1530 #[doc = " @brief Commit the number of elements written into @p data.\n\n This method must be called exactly once for every output.\n The @p nbElts must be `<=` reserved capacity of @p data.\n Note that, for `ZL_Type_string`, this is the number of strings written into\n@p data.\n The operation will automatically determine the total size of all Strings\nwithin @p data.\n\n @returns Success or an error. This function will fail if it is called more\n than once on the same @p data, or if @p nbElts is greater than @p data's\n capacity.\n\n Terminating a Codec _without_ committing anything to @p data (not even `0`)\n is considered an error, that is caught by the Engine\n (classified as node processing error).\n\n @note @p nbElts, as \"number of elements\", is **not** the same as size in\nbytes written in\n the buffer. For Numerics and Structs, the translation is\n straighforward. For Strings, the field sizes array must be\n provided first, using `ZL_Data_reserveStringLens()` to create\n and access the array. The resulting useful content size will then\n be calculated from the sum of field sizes. It will be controlled,\n and there will be an error if sum(sizes) > bufferCapacity."]
1531 pub fn ZL_Data_commit(data: *mut ZL_Data, nbElts: usize) -> ZL_Report;
1532}
1533extern "C" {
1534 #[doc = " @brief Sets integer metadata with the key @p mId and value @p mvalue on the\n stream.\n\n It is only valid to call ZL_Data_setIntMetadata() with the same @p mId\n once. Subsequent calls with the same @p mId will return an error.\n\n @param mId Metdata key\n @param mvalue Metadata value\n\n @returns Success or an error. This function will fail due to repeated calls\n with the same @p mId, or upon running out of space for the metadata.\n\n @note In this proposed design, Int Metadata are set one by one.\n Another possible design could follow the IntParams\n model, where all parameters must be set all-at-once, and be\n provided as a single vector of IntParams structures.\n\n @note The set value is an int, hence it's not suitable to store \"large\"\n values, like 64-bit ULL."]
1535 pub fn ZL_Data_setIntMetadata(
1536 s: *mut ZL_Data,
1537 mId: ::std::os::raw::c_int,
1538 mvalue: ::std::os::raw::c_int,
1539 ) -> ZL_Report;
1540}
1541#[repr(C)]
1542#[derive(Debug, Copy, Clone)]
1543pub struct ZL_IntMetadata {
1544 pub isPresent: ::std::os::raw::c_int,
1545 pub mValue: ::std::os::raw::c_int,
1546}
1547#[test]
1548fn bindgen_test_layout_ZL_IntMetadata() {
1549 const UNINIT: ::std::mem::MaybeUninit<ZL_IntMetadata> = ::std::mem::MaybeUninit::uninit();
1550 let ptr = UNINIT.as_ptr();
1551 assert_eq!(
1552 ::std::mem::size_of::<ZL_IntMetadata>(),
1553 8usize,
1554 "Size of ZL_IntMetadata"
1555 );
1556 assert_eq!(
1557 ::std::mem::align_of::<ZL_IntMetadata>(),
1558 4usize,
1559 "Alignment of ZL_IntMetadata"
1560 );
1561 assert_eq!(
1562 unsafe { ::std::ptr::addr_of!((*ptr).isPresent) as usize - ptr as usize },
1563 0usize,
1564 "Offset of field: ZL_IntMetadata::isPresent"
1565 );
1566 assert_eq!(
1567 unsafe { ::std::ptr::addr_of!((*ptr).mValue) as usize - ptr as usize },
1568 4usize,
1569 "Offset of field: ZL_IntMetadata::mValue"
1570 );
1571}
1572extern "C" {
1573 pub fn ZL_Data_getIntMetadata(s: *const ZL_Data, mId: ::std::os::raw::c_int) -> ZL_IntMetadata;
1574}
1575#[repr(C)]
1576#[derive(Debug, Copy, Clone)]
1577pub struct ZL_IntParam {
1578 pub paramId: ::std::os::raw::c_int,
1579 pub paramValue: ::std::os::raw::c_int,
1580}
1581#[test]
1582fn bindgen_test_layout_ZL_IntParam() {
1583 const UNINIT: ::std::mem::MaybeUninit<ZL_IntParam> = ::std::mem::MaybeUninit::uninit();
1584 let ptr = UNINIT.as_ptr();
1585 assert_eq!(
1586 ::std::mem::size_of::<ZL_IntParam>(),
1587 8usize,
1588 "Size of ZL_IntParam"
1589 );
1590 assert_eq!(
1591 ::std::mem::align_of::<ZL_IntParam>(),
1592 4usize,
1593 "Alignment of ZL_IntParam"
1594 );
1595 assert_eq!(
1596 unsafe { ::std::ptr::addr_of!((*ptr).paramId) as usize - ptr as usize },
1597 0usize,
1598 "Offset of field: ZL_IntParam::paramId"
1599 );
1600 assert_eq!(
1601 unsafe { ::std::ptr::addr_of!((*ptr).paramValue) as usize - ptr as usize },
1602 4usize,
1603 "Offset of field: ZL_IntParam::paramValue"
1604 );
1605}
1606#[repr(C)]
1607#[derive(Debug, Copy, Clone)]
1608pub struct ZL_LocalIntParams {
1609 pub intParams: *const ZL_IntParam,
1610 pub nbIntParams: usize,
1611}
1612#[test]
1613fn bindgen_test_layout_ZL_LocalIntParams() {
1614 const UNINIT: ::std::mem::MaybeUninit<ZL_LocalIntParams> = ::std::mem::MaybeUninit::uninit();
1615 let ptr = UNINIT.as_ptr();
1616 assert_eq!(
1617 ::std::mem::size_of::<ZL_LocalIntParams>(),
1618 16usize,
1619 "Size of ZL_LocalIntParams"
1620 );
1621 assert_eq!(
1622 ::std::mem::align_of::<ZL_LocalIntParams>(),
1623 8usize,
1624 "Alignment of ZL_LocalIntParams"
1625 );
1626 assert_eq!(
1627 unsafe { ::std::ptr::addr_of!((*ptr).intParams) as usize - ptr as usize },
1628 0usize,
1629 "Offset of field: ZL_LocalIntParams::intParams"
1630 );
1631 assert_eq!(
1632 unsafe { ::std::ptr::addr_of!((*ptr).nbIntParams) as usize - ptr as usize },
1633 8usize,
1634 "Offset of field: ZL_LocalIntParams::nbIntParams"
1635 );
1636}
1637#[repr(C)]
1638#[derive(Debug, Copy, Clone)]
1639pub struct ZL_CopyParam {
1640 pub paramId: ::std::os::raw::c_int,
1641 pub paramPtr: *const ::std::os::raw::c_void,
1642 pub paramSize: usize,
1643}
1644#[test]
1645fn bindgen_test_layout_ZL_CopyParam() {
1646 const UNINIT: ::std::mem::MaybeUninit<ZL_CopyParam> = ::std::mem::MaybeUninit::uninit();
1647 let ptr = UNINIT.as_ptr();
1648 assert_eq!(
1649 ::std::mem::size_of::<ZL_CopyParam>(),
1650 24usize,
1651 "Size of ZL_CopyParam"
1652 );
1653 assert_eq!(
1654 ::std::mem::align_of::<ZL_CopyParam>(),
1655 8usize,
1656 "Alignment of ZL_CopyParam"
1657 );
1658 assert_eq!(
1659 unsafe { ::std::ptr::addr_of!((*ptr).paramId) as usize - ptr as usize },
1660 0usize,
1661 "Offset of field: ZL_CopyParam::paramId"
1662 );
1663 assert_eq!(
1664 unsafe { ::std::ptr::addr_of!((*ptr).paramPtr) as usize - ptr as usize },
1665 8usize,
1666 "Offset of field: ZL_CopyParam::paramPtr"
1667 );
1668 assert_eq!(
1669 unsafe { ::std::ptr::addr_of!((*ptr).paramSize) as usize - ptr as usize },
1670 16usize,
1671 "Offset of field: ZL_CopyParam::paramSize"
1672 );
1673}
1674#[repr(C)]
1675#[derive(Debug, Copy, Clone)]
1676pub struct ZL_LocalCopyParams {
1677 pub copyParams: *const ZL_CopyParam,
1678 pub nbCopyParams: usize,
1679}
1680#[test]
1681fn bindgen_test_layout_ZL_LocalCopyParams() {
1682 const UNINIT: ::std::mem::MaybeUninit<ZL_LocalCopyParams> = ::std::mem::MaybeUninit::uninit();
1683 let ptr = UNINIT.as_ptr();
1684 assert_eq!(
1685 ::std::mem::size_of::<ZL_LocalCopyParams>(),
1686 16usize,
1687 "Size of ZL_LocalCopyParams"
1688 );
1689 assert_eq!(
1690 ::std::mem::align_of::<ZL_LocalCopyParams>(),
1691 8usize,
1692 "Alignment of ZL_LocalCopyParams"
1693 );
1694 assert_eq!(
1695 unsafe { ::std::ptr::addr_of!((*ptr).copyParams) as usize - ptr as usize },
1696 0usize,
1697 "Offset of field: ZL_LocalCopyParams::copyParams"
1698 );
1699 assert_eq!(
1700 unsafe { ::std::ptr::addr_of!((*ptr).nbCopyParams) as usize - ptr as usize },
1701 8usize,
1702 "Offset of field: ZL_LocalCopyParams::nbCopyParams"
1703 );
1704}
1705#[repr(C)]
1706#[derive(Debug, Copy, Clone)]
1707pub struct ZL_RefParam {
1708 pub paramId: ::std::os::raw::c_int,
1709 pub paramRef: *const ::std::os::raw::c_void,
1710 #[doc = " Optionally the size of the referenced object.\n OpenZL does not interpret this value. A common pattern is to use the\n value 0 to mean unknown size."]
1711 pub paramSize: usize,
1712}
1713#[test]
1714fn bindgen_test_layout_ZL_RefParam() {
1715 const UNINIT: ::std::mem::MaybeUninit<ZL_RefParam> = ::std::mem::MaybeUninit::uninit();
1716 let ptr = UNINIT.as_ptr();
1717 assert_eq!(
1718 ::std::mem::size_of::<ZL_RefParam>(),
1719 24usize,
1720 "Size of ZL_RefParam"
1721 );
1722 assert_eq!(
1723 ::std::mem::align_of::<ZL_RefParam>(),
1724 8usize,
1725 "Alignment of ZL_RefParam"
1726 );
1727 assert_eq!(
1728 unsafe { ::std::ptr::addr_of!((*ptr).paramId) as usize - ptr as usize },
1729 0usize,
1730 "Offset of field: ZL_RefParam::paramId"
1731 );
1732 assert_eq!(
1733 unsafe { ::std::ptr::addr_of!((*ptr).paramRef) as usize - ptr as usize },
1734 8usize,
1735 "Offset of field: ZL_RefParam::paramRef"
1736 );
1737 assert_eq!(
1738 unsafe { ::std::ptr::addr_of!((*ptr).paramSize) as usize - ptr as usize },
1739 16usize,
1740 "Offset of field: ZL_RefParam::paramSize"
1741 );
1742}
1743#[repr(C)]
1744#[derive(Debug, Copy, Clone)]
1745pub struct ZL_LocalRefParams {
1746 pub refParams: *const ZL_RefParam,
1747 pub nbRefParams: usize,
1748}
1749#[test]
1750fn bindgen_test_layout_ZL_LocalRefParams() {
1751 const UNINIT: ::std::mem::MaybeUninit<ZL_LocalRefParams> = ::std::mem::MaybeUninit::uninit();
1752 let ptr = UNINIT.as_ptr();
1753 assert_eq!(
1754 ::std::mem::size_of::<ZL_LocalRefParams>(),
1755 16usize,
1756 "Size of ZL_LocalRefParams"
1757 );
1758 assert_eq!(
1759 ::std::mem::align_of::<ZL_LocalRefParams>(),
1760 8usize,
1761 "Alignment of ZL_LocalRefParams"
1762 );
1763 assert_eq!(
1764 unsafe { ::std::ptr::addr_of!((*ptr).refParams) as usize - ptr as usize },
1765 0usize,
1766 "Offset of field: ZL_LocalRefParams::refParams"
1767 );
1768 assert_eq!(
1769 unsafe { ::std::ptr::addr_of!((*ptr).nbRefParams) as usize - ptr as usize },
1770 8usize,
1771 "Offset of field: ZL_LocalRefParams::nbRefParams"
1772 );
1773}
1774#[repr(C)]
1775#[derive(Debug, Copy, Clone)]
1776pub struct ZL_LocalParams {
1777 pub intParams: ZL_LocalIntParams,
1778 pub copyParams: ZL_LocalCopyParams,
1779 pub refParams: ZL_LocalRefParams,
1780}
1781#[test]
1782fn bindgen_test_layout_ZL_LocalParams() {
1783 const UNINIT: ::std::mem::MaybeUninit<ZL_LocalParams> = ::std::mem::MaybeUninit::uninit();
1784 let ptr = UNINIT.as_ptr();
1785 assert_eq!(
1786 ::std::mem::size_of::<ZL_LocalParams>(),
1787 48usize,
1788 "Size of ZL_LocalParams"
1789 );
1790 assert_eq!(
1791 ::std::mem::align_of::<ZL_LocalParams>(),
1792 8usize,
1793 "Alignment of ZL_LocalParams"
1794 );
1795 assert_eq!(
1796 unsafe { ::std::ptr::addr_of!((*ptr).intParams) as usize - ptr as usize },
1797 0usize,
1798 "Offset of field: ZL_LocalParams::intParams"
1799 );
1800 assert_eq!(
1801 unsafe { ::std::ptr::addr_of!((*ptr).copyParams) as usize - ptr as usize },
1802 16usize,
1803 "Offset of field: ZL_LocalParams::copyParams"
1804 );
1805 assert_eq!(
1806 unsafe { ::std::ptr::addr_of!((*ptr).refParams) as usize - ptr as usize },
1807 32usize,
1808 "Offset of field: ZL_LocalParams::refParams"
1809 );
1810}
1811#[repr(C)]
1812#[derive(Debug, Copy, Clone)]
1813pub struct ZL_CompressIntrospectionHooks_s {
1814 pub opaque: *mut ::std::os::raw::c_void,
1815 pub on_segmenterEncode_start: ::std::option::Option<
1816 unsafe extern "C" fn(
1817 opaque: *mut ::std::os::raw::c_void,
1818 segCtx: *mut ZL_Segmenter,
1819 placeholder: *mut ::std::os::raw::c_void,
1820 ),
1821 >,
1822 pub on_segmenterEncode_end: ::std::option::Option<
1823 unsafe extern "C" fn(
1824 opaque: *mut ::std::os::raw::c_void,
1825 segCtx: *mut ZL_Segmenter,
1826 r: ZL_Report,
1827 ),
1828 >,
1829 pub on_ZL_Segmenter_processChunk_start: ::std::option::Option<
1830 unsafe extern "C" fn(
1831 opaque: *mut ::std::os::raw::c_void,
1832 segCtx: *mut ZL_Segmenter,
1833 numElts: *const usize,
1834 numInputs: usize,
1835 startingGraphID: ZL_GraphID,
1836 rGraphParams: *const ZL_RuntimeGraphParameters,
1837 ),
1838 >,
1839 pub on_ZL_Segmenter_processChunk_end: ::std::option::Option<
1840 unsafe extern "C" fn(
1841 opaque: *mut ::std::os::raw::c_void,
1842 segCtx: *mut ZL_Segmenter,
1843 r: ZL_Report,
1844 ),
1845 >,
1846 pub on_ZL_Encoder_getScratchSpace: ::std::option::Option<
1847 unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ei: *mut ZL_Encoder, size: usize),
1848 >,
1849 pub on_ZL_Encoder_sendCodecHeader: ::std::option::Option<
1850 unsafe extern "C" fn(
1851 opaque: *mut ::std::os::raw::c_void,
1852 eictx: *mut ZL_Encoder,
1853 trh: *const ::std::os::raw::c_void,
1854 trhSize: usize,
1855 ),
1856 >,
1857 pub on_ZL_Encoder_createTypedStream: ::std::option::Option<
1858 unsafe extern "C" fn(
1859 opaque: *mut ::std::os::raw::c_void,
1860 eic: *mut ZL_Encoder,
1861 outStreamIndex: ::std::os::raw::c_int,
1862 eltsCapacity: usize,
1863 eltWidth: usize,
1864 createdStream: *mut ZL_Output,
1865 ),
1866 >,
1867 pub on_ZL_Graph_getScratchSpace: ::std::option::Option<
1868 unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, gctx: *mut ZL_Graph, size: usize),
1869 >,
1870 pub on_ZL_Edge_setMultiInputDestination_wParams: ::std::option::Option<
1871 unsafe extern "C" fn(
1872 opaque: *mut ::std::os::raw::c_void,
1873 gctx: *mut ZL_Graph,
1874 inputs: *mut *mut ZL_Edge,
1875 nbInputs: usize,
1876 gid: ZL_GraphID,
1877 lparams: *const ZL_LocalParams,
1878 ),
1879 >,
1880 pub on_migraphEncode_start: ::std::option::Option<
1881 unsafe extern "C" fn(
1882 opaque: *mut ::std::os::raw::c_void,
1883 gctx: *mut ZL_Graph,
1884 compressor: *const ZL_Compressor,
1885 gid: ZL_GraphID,
1886 inputs: *mut *mut ZL_Edge,
1887 nbInputs: usize,
1888 ),
1889 >,
1890 pub on_migraphEncode_end: ::std::option::Option<
1891 unsafe extern "C" fn(
1892 opaque: *mut ::std::os::raw::c_void,
1893 arg1: *mut ZL_Graph,
1894 successorGraphs: *mut ZL_GraphID,
1895 nbSuccessors: usize,
1896 graphExecResult: ZL_Report,
1897 ),
1898 >,
1899 pub on_codecEncode_start: ::std::option::Option<
1900 unsafe extern "C" fn(
1901 opaque: *mut ::std::os::raw::c_void,
1902 eictx: *mut ZL_Encoder,
1903 compressor: *const ZL_Compressor,
1904 nid: ZL_NodeID,
1905 inStreams: *mut *const ZL_Input,
1906 nbInStreams: usize,
1907 ),
1908 >,
1909 pub on_codecEncode_end: ::std::option::Option<
1910 unsafe extern "C" fn(
1911 opaque: *mut ::std::os::raw::c_void,
1912 arg1: *mut ZL_Encoder,
1913 outStreams: *mut *const ZL_Output,
1914 nbOutputs: usize,
1915 codecExecResult: ZL_Report,
1916 ),
1917 >,
1918 pub on_cctx_convertOneInput: ::std::option::Option<
1919 unsafe extern "C" fn(
1920 opque: *mut ::std::os::raw::c_void,
1921 cctx: *const ZL_CCtx,
1922 input: *const ZL_Data,
1923 inType: ZL_Type,
1924 portTypeMask: ZL_Type,
1925 conversionResult: ZL_Report,
1926 ),
1927 >,
1928 pub on_ZL_CCtx_compressMultiTypedRef_start: ::std::option::Option<
1929 unsafe extern "C" fn(
1930 opaque: *mut ::std::os::raw::c_void,
1931 cctx: *mut ZL_CCtx,
1932 dst: *const ::std::os::raw::c_void,
1933 dstCapacity: usize,
1934 inputs: *const *const ZL_TypedRef,
1935 nbInputs: usize,
1936 ),
1937 >,
1938 pub on_ZL_CCtx_compressMultiTypedRef_end: ::std::option::Option<
1939 unsafe extern "C" fn(
1940 opaque: *mut ::std::os::raw::c_void,
1941 cctx: *const ZL_CCtx,
1942 result: ZL_Report,
1943 ),
1944 >,
1945}
1946#[test]
1947fn bindgen_test_layout_ZL_CompressIntrospectionHooks_s() {
1948 const UNINIT: ::std::mem::MaybeUninit<ZL_CompressIntrospectionHooks_s> =
1949 ::std::mem::MaybeUninit::uninit();
1950 let ptr = UNINIT.as_ptr();
1951 assert_eq!(
1952 ::std::mem::size_of::<ZL_CompressIntrospectionHooks_s>(),
1953 136usize,
1954 "Size of ZL_CompressIntrospectionHooks_s"
1955 );
1956 assert_eq!(
1957 ::std::mem::align_of::<ZL_CompressIntrospectionHooks_s>(),
1958 8usize,
1959 "Alignment of ZL_CompressIntrospectionHooks_s"
1960 );
1961 assert_eq!(
1962 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
1963 0usize,
1964 "Offset of field: ZL_CompressIntrospectionHooks_s::opaque"
1965 );
1966 assert_eq!(
1967 unsafe { ::std::ptr::addr_of!((*ptr).on_segmenterEncode_start) as usize - ptr as usize },
1968 8usize,
1969 "Offset of field: ZL_CompressIntrospectionHooks_s::on_segmenterEncode_start"
1970 );
1971 assert_eq!(
1972 unsafe { ::std::ptr::addr_of!((*ptr).on_segmenterEncode_end) as usize - ptr as usize },
1973 16usize,
1974 "Offset of field: ZL_CompressIntrospectionHooks_s::on_segmenterEncode_end"
1975 );
1976 assert_eq!(
1977 unsafe {
1978 ::std::ptr::addr_of!((*ptr).on_ZL_Segmenter_processChunk_start) as usize - ptr as usize
1979 },
1980 24usize,
1981 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_Segmenter_processChunk_start"
1982 );
1983 assert_eq!(
1984 unsafe {
1985 ::std::ptr::addr_of!((*ptr).on_ZL_Segmenter_processChunk_end) as usize - ptr as usize
1986 },
1987 32usize,
1988 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_Segmenter_processChunk_end"
1989 );
1990 assert_eq!(
1991 unsafe {
1992 ::std::ptr::addr_of!((*ptr).on_ZL_Encoder_getScratchSpace) as usize - ptr as usize
1993 },
1994 40usize,
1995 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_Encoder_getScratchSpace"
1996 );
1997 assert_eq!(
1998 unsafe {
1999 ::std::ptr::addr_of!((*ptr).on_ZL_Encoder_sendCodecHeader) as usize - ptr as usize
2000 },
2001 48usize,
2002 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_Encoder_sendCodecHeader"
2003 );
2004 assert_eq!(
2005 unsafe {
2006 ::std::ptr::addr_of!((*ptr).on_ZL_Encoder_createTypedStream) as usize - ptr as usize
2007 },
2008 56usize,
2009 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_Encoder_createTypedStream"
2010 );
2011 assert_eq!(
2012 unsafe { ::std::ptr::addr_of!((*ptr).on_ZL_Graph_getScratchSpace) as usize - ptr as usize },
2013 64usize,
2014 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_Graph_getScratchSpace"
2015 );
2016 assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_ZL_Edge_setMultiInputDestination_wParams) as usize - ptr as usize } , 72usize , "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_Edge_setMultiInputDestination_wParams");
2017 assert_eq!(
2018 unsafe { ::std::ptr::addr_of!((*ptr).on_migraphEncode_start) as usize - ptr as usize },
2019 80usize,
2020 "Offset of field: ZL_CompressIntrospectionHooks_s::on_migraphEncode_start"
2021 );
2022 assert_eq!(
2023 unsafe { ::std::ptr::addr_of!((*ptr).on_migraphEncode_end) as usize - ptr as usize },
2024 88usize,
2025 "Offset of field: ZL_CompressIntrospectionHooks_s::on_migraphEncode_end"
2026 );
2027 assert_eq!(
2028 unsafe { ::std::ptr::addr_of!((*ptr).on_codecEncode_start) as usize - ptr as usize },
2029 96usize,
2030 "Offset of field: ZL_CompressIntrospectionHooks_s::on_codecEncode_start"
2031 );
2032 assert_eq!(
2033 unsafe { ::std::ptr::addr_of!((*ptr).on_codecEncode_end) as usize - ptr as usize },
2034 104usize,
2035 "Offset of field: ZL_CompressIntrospectionHooks_s::on_codecEncode_end"
2036 );
2037 assert_eq!(
2038 unsafe { ::std::ptr::addr_of!((*ptr).on_cctx_convertOneInput) as usize - ptr as usize },
2039 112usize,
2040 "Offset of field: ZL_CompressIntrospectionHooks_s::on_cctx_convertOneInput"
2041 );
2042 assert_eq!(
2043 unsafe {
2044 ::std::ptr::addr_of!((*ptr).on_ZL_CCtx_compressMultiTypedRef_start) as usize
2045 - ptr as usize
2046 },
2047 120usize,
2048 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_CCtx_compressMultiTypedRef_start"
2049 );
2050 assert_eq!(
2051 unsafe {
2052 ::std::ptr::addr_of!((*ptr).on_ZL_CCtx_compressMultiTypedRef_end) as usize
2053 - ptr as usize
2054 },
2055 128usize,
2056 "Offset of field: ZL_CompressIntrospectionHooks_s::on_ZL_CCtx_compressMultiTypedRef_end"
2057 );
2058}
2059pub type ZL_CompressIntrospectionHooks = ZL_CompressIntrospectionHooks_s;
2060#[repr(C)]
2061#[derive(Debug, Copy, Clone)]
2062pub struct ZL_DecompressIntrospectionHooks_s {
2063 pub opaque: *mut ::std::os::raw::c_void,
2064 pub on_ZL_DCtx_decompressMultiTBuffer_start: ::std::option::Option<
2065 unsafe extern "C" fn(
2066 opaque: *mut ::std::os::raw::c_void,
2067 dctx: *mut ZL_DCtx,
2068 nbOutputs: usize,
2069 framePtr: *const ::std::os::raw::c_void,
2070 frameSize: usize,
2071 ),
2072 >,
2073 pub on_ZL_DCtx_decompressMultiTBuffer_end: ::std::option::Option<
2074 unsafe extern "C" fn(
2075 opaque: *mut ::std::os::raw::c_void,
2076 dctx: *mut ZL_DCtx,
2077 result: ZL_Report,
2078 ),
2079 >,
2080 pub on_decompressChunk_start: ::std::option::Option<
2081 unsafe extern "C" fn(
2082 opaque: *mut ::std::os::raw::c_void,
2083 dctx: *mut ZL_DCtx,
2084 chunkIndex: usize,
2085 ),
2086 >,
2087 pub on_decompressChunk_end: ::std::option::Option<
2088 unsafe extern "C" fn(
2089 opaque: *mut ::std::os::raw::c_void,
2090 dctx: *mut ZL_DCtx,
2091 result: ZL_Report,
2092 ),
2093 >,
2094 pub on_ZL_Decoder_getCodecHeader: ::std::option::Option<
2095 unsafe extern "C" fn(
2096 opaque: *mut ::std::os::raw::c_void,
2097 dictx: *const ZL_Decoder,
2098 trh: *const ::std::os::raw::c_void,
2099 trhSize: usize,
2100 ),
2101 >,
2102 pub on_codecDecode_start: ::std::option::Option<
2103 unsafe extern "C" fn(
2104 opaque: *mut ::std::os::raw::c_void,
2105 dictx: *mut ZL_Decoder,
2106 inStreams: *const *const ZL_Data,
2107 nbInStreams: usize,
2108 ),
2109 >,
2110 pub on_codecDecode_end: ::std::option::Option<
2111 unsafe extern "C" fn(
2112 opaque: *mut ::std::os::raw::c_void,
2113 dictx: *mut ZL_Decoder,
2114 outStreams: *const *const ZL_Data,
2115 nbOutStreams: usize,
2116 result: ZL_Report,
2117 ),
2118 >,
2119}
2120#[test]
2121fn bindgen_test_layout_ZL_DecompressIntrospectionHooks_s() {
2122 const UNINIT: ::std::mem::MaybeUninit<ZL_DecompressIntrospectionHooks_s> =
2123 ::std::mem::MaybeUninit::uninit();
2124 let ptr = UNINIT.as_ptr();
2125 assert_eq!(
2126 ::std::mem::size_of::<ZL_DecompressIntrospectionHooks_s>(),
2127 64usize,
2128 "Size of ZL_DecompressIntrospectionHooks_s"
2129 );
2130 assert_eq!(
2131 ::std::mem::align_of::<ZL_DecompressIntrospectionHooks_s>(),
2132 8usize,
2133 "Alignment of ZL_DecompressIntrospectionHooks_s"
2134 );
2135 assert_eq!(
2136 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
2137 0usize,
2138 "Offset of field: ZL_DecompressIntrospectionHooks_s::opaque"
2139 );
2140 assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_ZL_DCtx_decompressMultiTBuffer_start) as usize - ptr as usize } , 8usize , "Offset of field: ZL_DecompressIntrospectionHooks_s::on_ZL_DCtx_decompressMultiTBuffer_start");
2141 assert_eq!(
2142 unsafe {
2143 ::std::ptr::addr_of!((*ptr).on_ZL_DCtx_decompressMultiTBuffer_end) as usize
2144 - ptr as usize
2145 },
2146 16usize,
2147 "Offset of field: ZL_DecompressIntrospectionHooks_s::on_ZL_DCtx_decompressMultiTBuffer_end"
2148 );
2149 assert_eq!(
2150 unsafe { ::std::ptr::addr_of!((*ptr).on_decompressChunk_start) as usize - ptr as usize },
2151 24usize,
2152 "Offset of field: ZL_DecompressIntrospectionHooks_s::on_decompressChunk_start"
2153 );
2154 assert_eq!(
2155 unsafe { ::std::ptr::addr_of!((*ptr).on_decompressChunk_end) as usize - ptr as usize },
2156 32usize,
2157 "Offset of field: ZL_DecompressIntrospectionHooks_s::on_decompressChunk_end"
2158 );
2159 assert_eq!(
2160 unsafe {
2161 ::std::ptr::addr_of!((*ptr).on_ZL_Decoder_getCodecHeader) as usize - ptr as usize
2162 },
2163 40usize,
2164 "Offset of field: ZL_DecompressIntrospectionHooks_s::on_ZL_Decoder_getCodecHeader"
2165 );
2166 assert_eq!(
2167 unsafe { ::std::ptr::addr_of!((*ptr).on_codecDecode_start) as usize - ptr as usize },
2168 48usize,
2169 "Offset of field: ZL_DecompressIntrospectionHooks_s::on_codecDecode_start"
2170 );
2171 assert_eq!(
2172 unsafe { ::std::ptr::addr_of!((*ptr).on_codecDecode_end) as usize - ptr as usize },
2173 56usize,
2174 "Offset of field: ZL_DecompressIntrospectionHooks_s::on_codecDecode_end"
2175 );
2176}
2177pub type ZL_DecompressIntrospectionHooks = ZL_DecompressIntrospectionHooks_s;
2178extern "C" {
2179 #[doc = " @returns The current encoding version number.\n This version number is used when the version\n number is unset.\n\n To use a fixed version number for encoding,\n grab the current version number using this\n function, and then pass it as a constant to\n ZL_CParam_formatVersion.\n\n NOTE: We currently only offer the ability to\n encode with older versions for a very limited\n period, so a new release will eventually\n remove support for encoding with any fixed\n version number. If you need long term\n support for a version, please reach out to\n the data_compression team, since that isn't\n currently supported."]
2180 pub fn ZL_getDefaultEncodingVersion() -> ::std::os::raw::c_uint;
2181}
2182extern "C" {
2183 #[doc = " Reads the magic number from the frame and returns the\n format version.\n\n @returns The format version of the frame, or an error\n if the frame isn't large enough, or it has the wrong\n magic number, or if the format version is not supported."]
2184 pub fn ZL_getFormatVersionFromFrame(
2185 src: *const ::std::os::raw::c_void,
2186 srcSize: usize,
2187 ) -> ZL_Report;
2188}
2189extern "C" {
2190 #[doc = " Provides the upper bound for the compressed size needed to ensure\n that compressing @p totalSrcSize bytes is successful.\n\n This bound is valid for a single serial input compressed with the default\n pipeline (default segmenter, StoreOnExpansion enabled). For other scenarios,\n callers should allocate a larger buffer:\n\n @param totalSrcSizeInBytes The total input size in bytes (not element count)\n @returns The upper bound of the compressed size, in bytes\n\n @pre Single serial input. Multi-input or multi-typed compression (e.g. via\n ZL_CCtx_compressMultiTypedRef) may produce additional per-stream\n overhead in chunk headers that exceeds this bound.\n @pre StoreOnExpansion is enabled (default). When disabled, compressed output\n may exceed this bound.\n @pre Segmented compression uses chunks of at least ZL_MIN_CHUNK_SIZE bytes,\n except for the last chunk which may be smaller (remainder)."]
2191 #[link_name = "ZL_compressBound__extern"]
2192 pub fn ZL_compressBound(totalSrcSizeInBytes: usize) -> usize;
2193}
2194extern "C" {
2195 pub fn ZL_CCtx_create() -> *mut ZL_CCtx;
2196}
2197extern "C" {
2198 pub fn ZL_CCtx_free(cctx: *mut ZL_CCtx);
2199}
2200#[doc = " Only meaningful at CCtx level (ignored at CGraph level)\n By default, parameters are reset between compression sessions\n setting this parameter to 1 keep the parameters across compression\n sessions."]
2201pub const ZL_CParam_stickyParameters: ZL_CParam = 1;
2202#[doc = " Scale amplitude to determine"]
2203pub const ZL_CParam_compressionLevel: ZL_CParam = 2;
2204#[doc = " Scale amplitude to determine"]
2205pub const ZL_CParam_decompressionLevel: ZL_CParam = 3;
2206#[doc = " Sets the format version number to use for encoding.\n See @ZL_getDefaultEncodingVersion for details.\n @default 0 means use format version ZL_getDefaultEncodingVersion()."]
2207pub const ZL_CParam_formatVersion: ZL_CParam = 4;
2208#[doc = " Select behavior when an internal compression stage fails.\n For example, when expecting an array of 32-bit integers,\n but the input size is not a clean multiple of 4.\n Strict mode stops at such stage and outputs an error.\n Permissive mode engages a generic backup compression mechanism,\n to successfully complete compression, at the cost of efficiency.\n At the time of this writing, backup is ZL_GRAPH_COMPRESS_GENERIC.\n Valid values for this parameter use the ZS2_cv3_* format.\n @default 0 currently means strict mode. This may change in the\n future."]
2209pub const ZL_CParam_permissiveCompression: ZL_CParam = 5;
2210#[doc = " Enable checksum of the compressed frame.\n This is useful to check for corruption that happens after\n compression.\n Valid values for this parameter use the ZS2_cv3_* format.\n @default 0 currently means checksum, might change in the future."]
2211pub const ZL_CParam_compressedChecksum: ZL_CParam = 6;
2212#[doc = " Enable checksum of the uncompressed content contained in the frame.\n This is useful to check for corruption that happens after\n compression,\n or corruption introduced during (de)compression. However, it cannot\n distinguish the two alone. In order to determine whether it is\n corruption or a bug in the ZStrong library, you have to enable both\n compressed and content checksums.\n Valid values for this parameter use the ZS2_cv3_* format.\n @default 0 currently means checksum, might change in the future."]
2213pub const ZL_CParam_contentChecksum: ZL_CParam = 7;
2214#[doc = " Any time an internal data Stream becomes smaller than this size,\n it gets STORED immediately, without further processing.\n This reduces processing time, improves decompression speed, and\n reduce\n risks of data expansion.\n Note(@Cyan): follows convention that setting 0 means \"default\", aka\n ZL_MINSTREAMSIZE_DEFAULT.\n Therefore, in order to completely disable the \"automatic store\"\n feature,\n one must pass a negative threshold value."]
2215pub const ZL_CParam_minStreamSize: ZL_CParam = 11;
2216#[doc = " Controls whether chunks that expand during compression\n are automatically replaced with STORE (anti-inflation guard).\n Valid values for this parameter use the ZS2_cv3_* format.\n @default 0 currently means enabled, preserving existing behavior."]
2217pub const ZL_CParam_storeOnExpansion: ZL_CParam = 12;
2218#[doc = " The list of global compression parameters"]
2219pub type ZL_CParam = ::std::os::raw::c_uint;
2220extern "C" {
2221 #[doc = " @brief Sets a global compression parameter via the CCtx.\n\n @param gcparam The global compression parameter to set\n @param value The value to set the global compression parameter to\n @returns A ZL_Report containing the result of the operation\n\n @note Parameters set via CCtx have higher priority than parameters set via\n CGraph.\n @note By default, parameters set via CCtx are reset at the end of the\n compression session. To preserve them across sessions, set\n stickyParameters=1."]
2222 pub fn ZL_CCtx_setParameter(
2223 cctx: *mut ZL_CCtx,
2224 gcparam: ZL_CParam,
2225 value: ::std::os::raw::c_int,
2226 ) -> ZL_Report;
2227}
2228extern "C" {
2229 #[doc = " @brief Reads a compression parameter's configured value from the CCtx.\n\n @param gcparam The global compression parameter to read\n @returns The value set for the given parameter (0 if unset or does not\n exist)"]
2230 pub fn ZL_CCtx_getParameter(cctx: *const ZL_CCtx, gcparam: ZL_CParam) -> ::std::os::raw::c_int;
2231}
2232extern "C" {
2233 #[doc = " @brief Resets the parameters in the cctx to a blank state.\n\n @note Useful when unsure if ZL_CParam_stickyParameters is set to 1."]
2234 pub fn ZL_CCtx_resetParameters(cctx: *mut ZL_CCtx) -> ZL_Report;
2235}
2236extern "C" {
2237 #[doc = " Sets the Arena for Data* objects in the CCtx.\n This frees the previous Data Arena and creates a new one.\n This choice remains sticky, until set again.\n The default Data Arena is HeapArena.\n\n @param sat The Data Arena type to set\n\n @note This is an advanced (experimental) parameter."]
2238 pub fn ZL_CCtx_setDataArena(cctx: *mut ZL_CCtx, sat: ZL_DataArenaType) -> ZL_Report;
2239}
2240extern "C" {
2241 #[doc = " @brief A one-shot (blocking) compression function.\n\n @param dst The destination buffer to write the compressed data to\n @param dstCapacity The capacity of the destination buffer\n @param src The source buffer to compress\n @param srcSize The size of the source buffer\n\n @returns The number of bytes written into @p dst, if successful. Otherwise,\n returns an error."]
2242 pub fn ZL_CCtx_compress(
2243 cctx: *mut ZL_CCtx,
2244 dst: *mut ::std::os::raw::c_void,
2245 dstCapacity: usize,
2246 src: *const ::std::os::raw::c_void,
2247 srcSize: usize,
2248 ) -> ZL_Report;
2249}
2250extern "C" {
2251 #[doc = " Gets the error context for a given ZL_Report. This context is useful for\n debugging and for submitting bug reports to Zstrong developers.\n\n @param report The report to get the error context for\n\n @returns A verbose error string containing context about the error that\n occurred.\n\n @note: This string is stored within the @p cctx and is only valid for the\n lifetime of the @p cctx."]
2252 pub fn ZL_CCtx_getErrorContextString(
2253 cctx: *const ZL_CCtx,
2254 report: ZL_Report,
2255 ) -> *const ::std::os::raw::c_char;
2256}
2257extern "C" {
2258 #[doc = " See ZL_CCtx_getErrorContextString()\n\n @param error: The error to get the context for"]
2259 pub fn ZL_CCtx_getErrorContextString_fromError(
2260 cctx: *const ZL_CCtx,
2261 error: ZL_Error,
2262 ) -> *const ::std::os::raw::c_char;
2263}
2264extern "C" {
2265 #[doc = " Gets the warnings that were encountered during the lifetime of the\n most recent compression operation.\n\n @returns The array of warnings encountered\n\n @note The array's and the errors' lifetimes are valid until the next\n compression operation."]
2266 pub fn ZL_CCtx_getWarnings(cctx: *const ZL_CCtx) -> ZL_Error_Array;
2267}
2268extern "C" {
2269 #[doc = " @brief Attach introspection hooks to the CCtx.\n\n The supplied functions in @p hooks will be called at specified waypoints\n during compression. These functions are expected to be pure observer\n functions only. Attempts to modify the intermediate structures exposed at\n these waypoints will almost certainly cause data corruption!\n\n @note This copies the content of the hooks struct into the CCtx. The caller\n is responsible for maintaining the lifetime of the objects in the hook.\n\n @note This will only do something if the library is compiled with the\n ALLOW_INTROSPECTION option. Otherwise, all the hooks will be no-ops."]
2270 pub fn ZL_CCtx_attachIntrospectionHooks(
2271 cctx: *mut ZL_CCtx,
2272 hooks: *const ZL_CompressIntrospectionHooks,
2273 ) -> ZL_Report;
2274}
2275extern "C" {
2276 #[doc = " Detach any introspection hooks currently attached to the CCtx."]
2277 pub fn ZL_CCtx_detachAllIntrospectionHooks(cctx: *mut ZL_CCtx) -> ZL_Report;
2278}
2279extern "C" {
2280 #[doc = " Compresses a single typed input presented as a\n `ZL_TypedRef`. See below for TypedRef* object creation.\n\n @param dst The destination buffer to write the compressed data to\n @param dstCapacity The capacity of the destination buffer\n @param input: The input to compress\n\n @returns The number of bytes written into @p dst, if successful. Otherwise,\n returns an error."]
2281 pub fn ZL_CCtx_compressTypedRef(
2282 cctx: *mut ZL_CCtx,
2283 dst: *mut ::std::os::raw::c_void,
2284 dstCapacity: usize,
2285 input: *const ZL_TypedRef,
2286 ) -> ZL_Report;
2287}
2288extern "C" {
2289 #[doc = " Compresses multiple typed inputs , presented as an\n array of `ZL_TypedRef`. See below for TypedRef* object creation.\n\n @param dst The destination buffer to write the compressed data to\n @param dstCapacity The capacity of the destination buffer\n @param inputs: The inputs to compress\n @param nbInputs: The number of inputs to compress\n\n @returns The number of bytes written into @p dst, if successful. Otherwise,\n returns an error.\n\n @note These inputs will be regenerated together in the same order at\n decompression time."]
2290 pub fn ZL_CCtx_compressMultiTypedRef(
2291 cctx: *mut ZL_CCtx,
2292 dst: *mut ::std::os::raw::c_void,
2293 dstCapacity: usize,
2294 inputs: *mut *const ZL_TypedRef,
2295 nbInputs: usize,
2296 ) -> ZL_Report;
2297}
2298extern "C" {
2299 #[doc = " Creates a `ZL_TypedRef` that represents a regular buffer of bytes.\n\n @param src The reference buffer\n @param srcSize The size of the reference buffer\n\n @returns A `ZL_TypedRef*` of type `ZL_Type_serial`."]
2300 pub fn ZL_TypedRef_createSerial(
2301 src: *const ::std::os::raw::c_void,
2302 srcSize: usize,
2303 ) -> *mut ZL_TypedRef;
2304}
2305extern "C" {
2306 #[doc = " Creates a `ZL_TypedRef` that represents a concatenated list of fields of a\n fixed size of @p structWidth.\n\n @p structWidth can be any size > 0. Even odd sizes (13, 17, etc.) are\n allowed. All fields are considered concatenated back to back. There is no\n alignment requirement.\n\n @param start The start of the reference buffer\n @param structWidth The width of each element in the reference buffer.\n @param structCount The number of elements in the input buffer. The total\n size will be @p structWidth * @p structCount.\n\n @note Struct in this case is just short-hand for fixed-size-fields. It's\n not limited to C-style structures."]
2307 pub fn ZL_TypedRef_createStruct(
2308 start: *const ::std::os::raw::c_void,
2309 structWidth: usize,
2310 structCount: usize,
2311 ) -> *mut ZL_TypedRef;
2312}
2313extern "C" {
2314 #[doc = " Creates a `ZL_TypedRef` that references an array of numeric values,\n employing the local host's endianness.\n Supported widths are 1, 2, 4, and 8 and the input array must be properly\n aligned (in local ABI).\n\n @param start The start of the reference array\n @param numWidth The width of the numeric values\n @param numCount The number of elements in the input array. The total size\n will be @p numWidth * @p numCount.\n"]
2315 pub fn ZL_TypedRef_createNumeric(
2316 start: *const ::std::os::raw::c_void,
2317 numWidth: usize,
2318 numCount: usize,
2319 ) -> *mut ZL_TypedRef;
2320}
2321extern "C" {
2322 #[doc = " Creates a `ZL_TypedRef` referencing a \"flat-strings\" representation. All\n \"strings\" are concatenated into @p strBuffer and their lengths are stored in\n a @p strLens array.\n\n @param strBuffer The data buffer\n @param bufferSize The size of the data buffer\n @param strLengths The lengths array\n @param nbStrings The number of strings (i.e. the size of the lengths array)\n\n @note String is just short-hand for variable-size-fields. It's not limited\n to null-terminated ascii strings. A string can be any blob of bytes,\n including some containing 0-value bytes, because length is explicit."]
2323 pub fn ZL_TypedRef_createString(
2324 strBuffer: *const ::std::os::raw::c_void,
2325 bufferSize: usize,
2326 strLens: *const u32,
2327 nbStrings: usize,
2328 ) -> *mut ZL_TypedRef;
2329}
2330extern "C" {
2331 #[doc = " Adds header comment to the compressed frame for the following compression.\n The message will be overridden if added a second time. The message is erased\n from the cctx at the end of each compression.\n\n @note A comment of size 0 clears the comment field.\n\n @param comment The comment to add. The comment is copied and stored in the\n cctx.\n @param commentSize The size of the comment or 0 to clear the comment."]
2332 pub fn ZL_CCtx_addHeaderComment(
2333 cctx: *mut ZL_CCtx,
2334 comment: *const ::std::os::raw::c_void,
2335 commentSize: usize,
2336 ) -> ZL_Report;
2337}
2338extern "C" {
2339 #[doc = " Frees the given `ZL_TypedRef`.\n\n @param tref the object to free\n\n @note All ZL_TypedRef* objects of any type are released by the same method"]
2340 pub fn ZL_TypedRef_free(tref: *mut ZL_TypedRef);
2341}
2342extern "C" {
2343 #[doc = " Inserts a placeholder for the Automated Compressor Explorer (ACE) to\n replace with an automatically generated graph. It accepts a single input of\n any type.\n\n Before training, this graph will just forward to `ZL_GRAPH_COMPRESS_GENERIC`.\n After training the top-level graph, ACE will replace this component with an\n automatically generated graph that performs well on the training data.\n\n If the same ACE GraphID is used multiple times within a graph, all the inputs\n get passed to the same training, and only a single graph is generated. If\n there are multiple ACE graphs in a top-level graph, each created with a call\n to `ZL_Compressor_buildACEGraph()`, then each unique GraphID will be replaced\n with a trained graph optimized for the inputs passed to that specific\n GraphID.\n\n Input 0: Any type\n\n @returns The placeholder ACE graphID."]
2344 pub fn ZL_Compressor_buildACEGraph(compressor: *mut ZL_Compressor) -> ZL_GraphID;
2345}
2346extern "C" {
2347 #[doc = " @see ZL_Compressor_buildACEGraph"]
2348 pub fn ZL_Compressor_buildACEGraph2(compressor: *mut ZL_Compressor) -> ZL_Result_ZL_GraphID;
2349}
2350extern "C" {
2351 #[doc = " The same as `ZL_Compressor_buildACEGraph`, but uses `defaultGraph` to\n compress until it is trained.\n\n @see ZL_Compressor_buildACEGraph"]
2352 pub fn ZL_Compressor_buildACEGraphWithDefault(
2353 compressor: *mut ZL_Compressor,
2354 defaultGraph: ZL_GraphID,
2355 ) -> ZL_GraphID;
2356}
2357extern "C" {
2358 #[doc = " @see ZL_Compressor_buildACEGraphWithDefault"]
2359 pub fn ZL_Compressor_buildACEGraphWithDefault2(
2360 compressor: *mut ZL_Compressor,
2361 defaultGraph: ZL_GraphID,
2362 ) -> ZL_Result_ZL_GraphID;
2363}
2364pub const ZL_StandardGraphID_illegal: ZL_StandardGraphID = 0;
2365pub const ZL_StandardGraphID_store: ZL_StandardGraphID = 2;
2366pub const ZL_StandardGraphID_fse: ZL_StandardGraphID = 3;
2367pub const ZL_StandardGraphID_huffman: ZL_StandardGraphID = 4;
2368pub const ZL_StandardGraphID_entropy: ZL_StandardGraphID = 5;
2369pub const ZL_StandardGraphID_constant: ZL_StandardGraphID = 6;
2370pub const ZL_StandardGraphID_zstd: ZL_StandardGraphID = 7;
2371pub const ZL_StandardGraphID_bitpack: ZL_StandardGraphID = 8;
2372pub const ZL_StandardGraphID_flatpack: ZL_StandardGraphID = 9;
2373pub const ZL_StandardGraphID_field_lz: ZL_StandardGraphID = 10;
2374pub const ZL_StandardGraphID_compress_generic: ZL_StandardGraphID = 11;
2375pub const ZL_StandardGraphID_select_generic_lz_backend: ZL_StandardGraphID = 12;
2376pub const ZL_StandardGraphID_segment_numeric: ZL_StandardGraphID = 13;
2377pub const ZL_StandardGraphID_select_numeric: ZL_StandardGraphID = 14;
2378pub const ZL_StandardGraphID_ml_selector: ZL_StandardGraphID = 15;
2379pub const ZL_StandardGraphID_clustering: ZL_StandardGraphID = 16;
2380pub const ZL_StandardGraphID_try_parse_int: ZL_StandardGraphID = 17;
2381pub const ZL_StandardGraphID_simple_data_description_language: ZL_StandardGraphID = 18;
2382pub const ZL_StandardGraphID_simple_data_description_language_v2: ZL_StandardGraphID = 19;
2383pub const ZL_StandardGraphID_lz4: ZL_StandardGraphID = 20;
2384pub const ZL_StandardGraphID_partition_bitpack: ZL_StandardGraphID = 21;
2385pub const ZL_StandardGraphID_segment_num8_from_serial: ZL_StandardGraphID = 22;
2386pub const ZL_StandardGraphID_segment_num16_from_serial: ZL_StandardGraphID = 23;
2387pub const ZL_StandardGraphID_segment_num32_from_serial: ZL_StandardGraphID = 24;
2388pub const ZL_StandardGraphID_segment_num64_from_serial: ZL_StandardGraphID = 25;
2389pub const ZL_StandardGraphID_lz: ZL_StandardGraphID = 26;
2390pub const ZL_StandardGraphID_segment_serial: ZL_StandardGraphID = 27;
2391pub const ZL_StandardGraphID_public_end: ZL_StandardGraphID = 28;
2392pub type ZL_StandardGraphID = ::std::os::raw::c_uint;
2393pub const ZL_StandardNodeID_illegal: ZL_StandardNodeID = 0;
2394pub const ZL_StandardNodeID_delta_int: ZL_StandardNodeID = 2;
2395pub const ZL_StandardNodeID_transpose_split: ZL_StandardNodeID = 3;
2396pub const ZL_StandardNodeID_zigzag: ZL_StandardNodeID = 4;
2397pub const ZL_StandardNodeID_dispatchN_byTag: ZL_StandardNodeID = 5;
2398pub const ZL_StandardNodeID_float32_deconstruct: ZL_StandardNodeID = 6;
2399pub const ZL_StandardNodeID_bfloat16_deconstruct: ZL_StandardNodeID = 7;
2400pub const ZL_StandardNodeID_float16_deconstruct: ZL_StandardNodeID = 8;
2401pub const ZL_StandardNodeID_field_lz: ZL_StandardNodeID = 9;
2402pub const ZL_StandardNodeID_convert_struct_to_serial: ZL_StandardNodeID = 10;
2403pub const ZL_StandardNodeID_convert_num_to_struct_le: ZL_StandardNodeID = 11;
2404pub const ZL_StandardNodeID_convert_num_to_serial_le: ZL_StandardNodeID = 12;
2405pub const ZL_StandardNodeID_convert_serial_to_struct: ZL_StandardNodeID = 13;
2406pub const ZL_StandardNodeID_convert_serial_to_struct2: ZL_StandardNodeID = 14;
2407pub const ZL_StandardNodeID_convert_serial_to_struct4: ZL_StandardNodeID = 15;
2408pub const ZL_StandardNodeID_convert_serial_to_struct8: ZL_StandardNodeID = 16;
2409pub const ZL_StandardNodeID_convert_struct_to_num_le: ZL_StandardNodeID = 17;
2410pub const ZL_StandardNodeID_convert_struct_to_num_be: ZL_StandardNodeID = 18;
2411pub const ZL_StandardNodeID_convert_serial_to_num8: ZL_StandardNodeID = 19;
2412pub const ZL_StandardNodeID_convert_serial_to_num_le16: ZL_StandardNodeID = 20;
2413pub const ZL_StandardNodeID_convert_serial_to_num_le32: ZL_StandardNodeID = 21;
2414pub const ZL_StandardNodeID_convert_serial_to_num_le64: ZL_StandardNodeID = 22;
2415pub const ZL_StandardNodeID_convert_serial_to_num_be16: ZL_StandardNodeID = 23;
2416pub const ZL_StandardNodeID_convert_serial_to_num_be32: ZL_StandardNodeID = 24;
2417pub const ZL_StandardNodeID_convert_serial_to_num_be64: ZL_StandardNodeID = 25;
2418pub const ZL_StandardNodeID_separate_string_components: ZL_StandardNodeID = 26;
2419pub const ZL_StandardNodeID_bitunpack: ZL_StandardNodeID = 27;
2420pub const ZL_StandardNodeID_range_pack: ZL_StandardNodeID = 28;
2421pub const ZL_StandardNodeID_merge_sorted: ZL_StandardNodeID = 29;
2422pub const ZL_StandardNodeID_prefix: ZL_StandardNodeID = 30;
2423pub const ZL_StandardNodeID_divide_by: ZL_StandardNodeID = 31;
2424pub const ZL_StandardNodeID_dispatch_string: ZL_StandardNodeID = 32;
2425pub const ZL_StandardNodeID_concat_serial: ZL_StandardNodeID = 33;
2426pub const ZL_StandardNodeID_concat_num: ZL_StandardNodeID = 34;
2427pub const ZL_StandardNodeID_concat_struct: ZL_StandardNodeID = 35;
2428pub const ZL_StandardNodeID_concat_string: ZL_StandardNodeID = 36;
2429pub const ZL_StandardNodeID_dedup_num: ZL_StandardNodeID = 37;
2430pub const ZL_StandardNodeID_parse_int: ZL_StandardNodeID = 38;
2431pub const ZL_StandardNodeID_interleave_string: ZL_StandardNodeID = 39;
2432pub const ZL_StandardNodeID_tokenize_struct: ZL_StandardNodeID = 40;
2433pub const ZL_StandardNodeID_tokenize_numeric: ZL_StandardNodeID = 41;
2434pub const ZL_StandardNodeID_tokenize_string: ZL_StandardNodeID = 42;
2435pub const ZL_StandardNodeID_quantize_offsets: ZL_StandardNodeID = 43;
2436pub const ZL_StandardNodeID_quantize_lengths: ZL_StandardNodeID = 44;
2437pub const ZL_StandardNodeID_bitsplit_top8: ZL_StandardNodeID = 45;
2438pub const ZL_StandardNodeID_bitsplit_fp: ZL_StandardNodeID = 46;
2439pub const ZL_StandardNodeID_bitsplit_bf16: ZL_StandardNodeID = 47;
2440pub const ZL_StandardNodeID_partition: ZL_StandardNodeID = 48;
2441pub const ZL_StandardNodeID_split_byrange: ZL_StandardNodeID = 49;
2442pub const ZL_StandardNodeID_sentinel_byte: ZL_StandardNodeID = 50;
2443pub const ZL_StandardNodeID_sentinel_num: ZL_StandardNodeID = 51;
2444pub const ZL_StandardNodeID_lz: ZL_StandardNodeID = 52;
2445pub const ZL_StandardNodeID_mux_lengths: ZL_StandardNodeID = 53;
2446pub const ZL_StandardNodeID_public_end: ZL_StandardNodeID = 54;
2447pub type ZL_StandardNodeID = ::std::os::raw::c_uint;
2448pub const ZL_Bitunpack_numBits: _bindgen_ty_1 = 1;
2449pub type _bindgen_ty_1 = ::std::os::raw::c_uint;
2450extern "C" {
2451 pub fn ZL_Compressor_registerBitunpackNode(
2452 cgraph: *mut ZL_Compressor,
2453 nbBits: ::std::os::raw::c_int,
2454 ) -> ZL_NodeID;
2455}
2456extern "C" {
2457 #[doc = " Parameterized brute force selector that selects the best successor from a\n user-provided list of candidates.\n @param successors the list of successors to select from. Each successor must\n be equipped to handle the input stream type."]
2458 pub fn ZL_Compressor_registerBruteForceSelectorGraph(
2459 cgraph: *mut ZL_Compressor,
2460 successors: *const ZL_GraphID,
2461 numSuccessors: usize,
2462 ) -> ZL_GraphID;
2463}
2464extern "C" {
2465 #[link_name = "ZL_codemodInputAsData__extern"]
2466 pub fn ZL_codemodInputAsData(input: *const ZL_Input) -> *const ZL_Data;
2467}
2468extern "C" {
2469 #[link_name = "ZL_codemodDataAsInput__extern"]
2470 pub fn ZL_codemodDataAsInput(data: *const ZL_Data) -> *const ZL_Input;
2471}
2472extern "C" {
2473 #[link_name = "ZL_codemodMutInputAsData__extern"]
2474 pub fn ZL_codemodMutInputAsData(input: *mut ZL_Input) -> *mut ZL_Data;
2475}
2476extern "C" {
2477 #[link_name = "ZL_codemodMutDataAsInput__extern"]
2478 pub fn ZL_codemodMutDataAsInput(data: *mut ZL_Data) -> *mut ZL_Input;
2479}
2480extern "C" {
2481 #[link_name = "ZL_codemodDatasAsInputs__extern"]
2482 pub fn ZL_codemodDatasAsInputs(datas: *mut *const ZL_Data) -> *mut *const ZL_Input;
2483}
2484extern "C" {
2485 #[link_name = "ZL_codemodInputsAsDatas__extern"]
2486 pub fn ZL_codemodInputsAsDatas(inputs: *mut *const ZL_Input) -> *mut *const ZL_Data;
2487}
2488extern "C" {
2489 #[link_name = "ZL_Input_id__extern"]
2490 pub fn ZL_Input_id(input: *const ZL_Input) -> ZL_DataID;
2491}
2492extern "C" {
2493 #[link_name = "ZL_Input_type__extern"]
2494 pub fn ZL_Input_type(input: *const ZL_Input) -> ZL_Type;
2495}
2496extern "C" {
2497 #[doc = " @note invoking `ZL_Data_numElts()` is only valid for committed Data.\n If the Data object was received as an input, it's necessarily valid.\n So the issue can only happen for outputs,\n between allocation and commit.\n Querying `ZL_Data_numElts()` is not expected to be useful for output Data.\n @note `ZL_Type_serial` doesn't really have a concept of \"elt\".\n In this case, it returns Data size in bytes."]
2498 #[link_name = "ZL_Input_numElts__extern"]
2499 pub fn ZL_Input_numElts(input: *const ZL_Input) -> usize;
2500}
2501extern "C" {
2502 #[doc = " @return element width in nb of bytes\n This is only valid for fixed size elements,\n such as `ZL_Type_struct` or `ZL_Type_numeric`.\n If Type is `ZL_Type_string`, it returns 0 instead."]
2503 #[link_name = "ZL_Input_eltWidth__extern"]
2504 pub fn ZL_Input_eltWidth(input: *const ZL_Input) -> usize;
2505}
2506extern "C" {
2507 #[doc = " @return the nb of bytes committed into data's buffer\n (generally `== data->eltWidth * data->nbElts`).\n\n For `ZL_Type_string`, result is equal to `sum(data->stringLens)`.\n Returned value is provided in nb of bytes.\n\n @note invoking this symbol only makes sense if Data was\n previously committed.\n @note (@cyan): ZS2_Data_byteSize() is another name candidate."]
2508 #[link_name = "ZL_Input_contentSize__extern"]
2509 pub fn ZL_Input_contentSize(input: *const ZL_Input) -> usize;
2510}
2511extern "C" {
2512 #[doc = " These methods provide direct access to internal buffer.\n Warning : users must pay attention to buffer boundaries.\n @return pointer to the _beginning_ of buffer.\n @note for `ZL_Type_string`, returns a pointer to the buffer containing the\n concatenated strings."]
2513 #[link_name = "ZL_Input_ptr__extern"]
2514 pub fn ZL_Input_ptr(input: *const ZL_Input) -> *const ::std::os::raw::c_void;
2515}
2516extern "C" {
2517 #[doc = " This method is only valid for `ZL_Type_string` Data.\n @return a pointer to the array of string lengths.\n The size of this array is `== ZL_Data_numElts(data)`.\n @return `NULL` if incorrect data type, or `StringLens` not allocated yet."]
2518 #[link_name = "ZL_Input_stringLens__extern"]
2519 pub fn ZL_Input_stringLens(input: *const ZL_Input) -> *const u32;
2520}
2521extern "C" {
2522 #[doc = " @returns The value if present. ZL_IntMetadata::isPresent != 0\n when the @p key exists, in which case ZL_IntMetadata::mValue is set to the\n value."]
2523 #[link_name = "ZL_Input_getIntMetadata__extern"]
2524 pub fn ZL_Input_getIntMetadata(
2525 input: *const ZL_Input,
2526 key: ::std::os::raw::c_int,
2527 ) -> ZL_IntMetadata;
2528}
2529extern "C" {
2530 #[doc = " @brief Sets integer metadata with the key @p key and value @p value on the\n stream.\n\n It is only valid to call ZL_Input_setIntMetadata() with the same @p key\n once. Subsequent calls with the same @p key will return an error.\n\n @param key Metdata key\n @param value Metadata value\n\n @returns Success or an error. This function will fail due to repeated calls\n with the same @p key, or upon running out of space for the metadata.\n\n @note In this proposed design, Int Metadata are set one by one.\n Another possible design could follow the IntParams\n model, where all parameters must be set all-at-once, and be\n provided as a single vector of IntParams structures.\n\n @note The set value is an int, hence it's not suitable to store \"large\"\n values, like 64-bit ULL."]
2531 #[link_name = "ZL_Input_setIntMetadata__extern"]
2532 pub fn ZL_Input_setIntMetadata(
2533 input: *mut ZL_Input,
2534 key: ::std::os::raw::c_int,
2535 value: ::std::os::raw::c_int,
2536 ) -> ZL_Report;
2537}
2538#[doc = " @brief Descriptor for materializing and dematerializing local params\n\n This structure defines functions to materialize an in-memory object from\n local parameters and to dematerialize (free) that object.\n\n Materialized objects are available as a @ref ZL_RefParam via the typical\n local params access methods. Specify the retrieval key with the paramId\n field."]
2539#[repr(C)]
2540#[derive(Debug, Copy, Clone)]
2541pub struct ZL_MaterializerDesc_s {
2542 #[doc = " @brief A custom function that materializes an in-memory object from a\n provided @p params object.\n\n This function may arbitrarily use none, any, or all of the provided\n local params to generate the materialized object, but the generation\n MUST be deterministic and hermetic. In particular, materialization shall\n not depend on variables other than the provided @ref ZL_LocalParams\n object.\n\n Materialized object lifetimes will be managed by the @ref ZL_Compressor\n on which the node is registered/parameterized. Objects will be\n materialized around the time of node registration/parameterization and\n will remain allocated for the lifetime of the associated @ref\n ZL_Compressor.\n\n Do NOT rely on the materialization function being called at any specific\n time to do side-effect work. Doing so will result in undefined behavior.\n\n The @ref ZL_Compressor may arbitrarily share the same materialized object\n between multiple nodes with the same @p params and the @ref ZL_CCtx may\n provide concurrent access to materialized objects. DO NOT attempt to\n modify the materialized object after creation, either directly or via API\n getters.\n\n @param matCtx A pointer to a materializer context object associated with\n the @ref ZL_Compressor. The materialization function may use this to\n request managed memory from the ZL_Compressor as an alternative to\n managing allocations itself and via the dematerializeFn.\n @param params A pointer to the local params object to materialize. The\n provided params have no lifetime guarantees past the invocation of this\n function. You may not hold references into the params object in the\n materialized object.\n\n @returns A ZL_RESULT containing a pointer to the materialized object on\n success, or an error. Returning NULL as a valid result (when there's\n nothing to materialize) should be wrapped in ZL_WRAP_VALUE(NULL). Ensure\n the function declares a result scope with ZL_RESULT_DECLARE_SCOPE or you\n will get a compiler error."]
2543 pub materializeFn: ::std::option::Option<
2544 unsafe extern "C" fn(
2545 matCtx: *mut ZL_Materializer,
2546 params: *const ZL_LocalParams,
2547 ) -> ZL_Result_ZL_VoidPtr,
2548 >,
2549 #[doc = " @brief A custom function that destructs a materialized object.\n\n You should use this to deallocate all non-arena memory and free any held\n resources. As a convenience, if there are no resources or memory to free,\n you may use ZL_NOOP_DEMATERIALIZE as a placeholder."]
2550 pub dematerializeFn: ::std::option::Option<
2551 unsafe extern "C" fn(
2552 matCtx: *mut ZL_Materializer,
2553 materialized: *mut ::std::os::raw::c_void,
2554 ),
2555 >,
2556 #[doc = " The paramId to use for the materialized param. If there is an existing\n param that uses this paramId, the registration will fail."]
2557 pub paramId: ::std::os::raw::c_int,
2558 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Materializer_getOpaquePtr(). OpenZL does not take ownership of this\n pointer. If lifetime extension is needed, it should be managed by the\n `ZL_OpaquePtr` in the outer `ZL_MIEncoderDesc`."]
2559 pub opaque: *const ::std::os::raw::c_void,
2560}
2561#[test]
2562fn bindgen_test_layout_ZL_MaterializerDesc_s() {
2563 const UNINIT: ::std::mem::MaybeUninit<ZL_MaterializerDesc_s> =
2564 ::std::mem::MaybeUninit::uninit();
2565 let ptr = UNINIT.as_ptr();
2566 assert_eq!(
2567 ::std::mem::size_of::<ZL_MaterializerDesc_s>(),
2568 32usize,
2569 "Size of ZL_MaterializerDesc_s"
2570 );
2571 assert_eq!(
2572 ::std::mem::align_of::<ZL_MaterializerDesc_s>(),
2573 8usize,
2574 "Alignment of ZL_MaterializerDesc_s"
2575 );
2576 assert_eq!(
2577 unsafe { ::std::ptr::addr_of!((*ptr).materializeFn) as usize - ptr as usize },
2578 0usize,
2579 "Offset of field: ZL_MaterializerDesc_s::materializeFn"
2580 );
2581 assert_eq!(
2582 unsafe { ::std::ptr::addr_of!((*ptr).dematerializeFn) as usize - ptr as usize },
2583 8usize,
2584 "Offset of field: ZL_MaterializerDesc_s::dematerializeFn"
2585 );
2586 assert_eq!(
2587 unsafe { ::std::ptr::addr_of!((*ptr).paramId) as usize - ptr as usize },
2588 16usize,
2589 "Offset of field: ZL_MaterializerDesc_s::paramId"
2590 );
2591 assert_eq!(
2592 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
2593 24usize,
2594 "Offset of field: ZL_MaterializerDesc_s::opaque"
2595 );
2596}
2597#[doc = " @brief Descriptor for materializing and dematerializing local params\n\n This structure defines functions to materialize an in-memory object from\n local parameters and to dematerialize (free) that object.\n\n Materialized objects are available as a @ref ZL_RefParam via the typical\n local params access methods. Specify the retrieval key with the paramId\n field."]
2598pub type ZL_MaterializerDesc = ZL_MaterializerDesc_s;
2599extern "C" {
2600 #[doc = " No-op dematerialization function.\n Use this as a placeholder when there are no resources or memory to free."]
2601 pub fn ZL_NOOP_DEMATERIALIZE(
2602 matCtx: *mut ZL_Materializer,
2603 materialized: *mut ::std::os::raw::c_void,
2604 );
2605}
2606extern "C" {
2607 #[doc = " Managed space allocation (Materializers ONLY):\n Materialization may request arena space to hold materialized objects. It is\n allowed to request multiple buffers of any size. Returned buffers are not\n initialized, and cannot be freed individually. All buffers are\n automatically released at end of the owning @ref ZL_Compressor's lifetime.\n\n @note Always returns NULL during dematerialization."]
2608 pub fn ZL_Materializer_allocate(
2609 matCtx: *mut ZL_Materializer,
2610 size: usize,
2611 ) -> *mut ::std::os::raw::c_void;
2612}
2613extern "C" {
2614 #[doc = " Scratch space allocation (Materializers ONLY):\n When the materializer needs some buffer space for some local operation,\n it can request such space from the engine. It is allowed to\n request multiple buffers of any size. Returned buffers are not\n initialized, and cannot be freed individually. All scratch buffers are\n automatically released at the end of the materializer's execution.\n\n @note Always returns NULL during dematerialization."]
2615 pub fn ZL_Materializer_getScratchSpace(
2616 matCtx: *mut ZL_Materializer,
2617 size: usize,
2618 ) -> *mut ::std::os::raw::c_void;
2619}
2620#[doc = " @brief Descriptor for materializing and dematerializing resource objects\n (dicts and MParams).\n\n Defines functions to create an in-memory object from a raw source buffer\n (materializeFn) and to free that object (dematerializeFn). Used for both\n dictionary objects (required at compression and decompression) and MParam\n objects (compression-only). Note that the registration APIs allow for\n different materializers for compression-time and decompression-time dict\n materialization."]
2621#[repr(C)]
2622#[derive(Debug, Copy, Clone)]
2623pub struct ZL_MaterializerDesc2 {
2624 #[doc = " @brief A custom function that materializes an in-memory object from a\n provided @p src buffer. Separate function interfaces are provided for\n compression-time and decompression-time materialization. These can be the\n same function or different functions, depending on the specific codec\n implementation.\n\n The generation MUST be deterministic and hermetic. Materialization shall\n not depend on variables other than the provided @p src buffer.\n\n Materialized object lifetimes will be managed by the @ref ZL_DictLoader\n or @ref ZL_Compressor on which the materialization scheme is registered.\n\n Do NOT rely on the materialization function being called at any specific\n time to do side-effect work. Doing so will result in undefined behavior.\n\n DO NOT attempt to modify the materialized object after creation, either\n directly or via API getters.\n\n @param matCtx A pointer to a materializer context object. The\n materialization function may use this to request managed memory as an\n alternative to managing allocations itself and via the dematerializeFn.\n @param src A pointer to the buffer from which to materialize. The\n provided buffer has no lifetime guarantees past the invocation of this\n function. You may not hold references into @p src in the materialized\n object.\n\n @returns A ZL_RESULT containing a pointer to the materialized object on\n success, or an error. Returning NULL as a valid result (when there's\n nothing to materialize) should be wrapped in ZL_WRAP_VALUE(NULL). Ensure\n the function declares a result scope with ZL_RESULT_DECLARE_SCOPE or you\n will get a compiler error."]
2625 pub materializeFn: ::std::option::Option<
2626 unsafe extern "C" fn(
2627 matCtx: *mut ZL_Materializer,
2628 src: *const ::std::os::raw::c_void,
2629 srcSize: usize,
2630 ) -> ZL_Result_ZL_VoidPtr,
2631 >,
2632 #[doc = " @brief A custom function that destructs a materialized object.\n\n You should use this to deallocate all non-arena memory and free any held\n resources. As a convenience, if there are no resources or memory to free,\n you may use ZL_NOOP_DEMATERIALIZE as a placeholder."]
2633 pub dematerializeFn: ::std::option::Option<
2634 unsafe extern "C" fn(
2635 matCtx: *mut ZL_Materializer,
2636 materialized: *mut ::std::os::raw::c_void,
2637 ),
2638 >,
2639 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Materializer_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the owning\n compressor/dict store."]
2640 pub opaque: ZL_OpaquePtr,
2641}
2642#[test]
2643fn bindgen_test_layout_ZL_MaterializerDesc2() {
2644 const UNINIT: ::std::mem::MaybeUninit<ZL_MaterializerDesc2> = ::std::mem::MaybeUninit::uninit();
2645 let ptr = UNINIT.as_ptr();
2646 assert_eq!(
2647 ::std::mem::size_of::<ZL_MaterializerDesc2>(),
2648 40usize,
2649 "Size of ZL_MaterializerDesc2"
2650 );
2651 assert_eq!(
2652 ::std::mem::align_of::<ZL_MaterializerDesc2>(),
2653 8usize,
2654 "Alignment of ZL_MaterializerDesc2"
2655 );
2656 assert_eq!(
2657 unsafe { ::std::ptr::addr_of!((*ptr).materializeFn) as usize - ptr as usize },
2658 0usize,
2659 "Offset of field: ZL_MaterializerDesc2::materializeFn"
2660 );
2661 assert_eq!(
2662 unsafe { ::std::ptr::addr_of!((*ptr).dematerializeFn) as usize - ptr as usize },
2663 8usize,
2664 "Offset of field: ZL_MaterializerDesc2::dematerializeFn"
2665 );
2666 assert_eq!(
2667 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
2668 16usize,
2669 "Offset of field: ZL_MaterializerDesc2::opaque"
2670 );
2671}
2672#[repr(C)]
2673#[derive(Debug, Copy, Clone)]
2674pub struct ZL_MParam {
2675 pub content: *const ::std::os::raw::c_void,
2676 pub size: usize,
2677 #[doc = " For advanced use cases, you can specify a custom ID for this MParam. If\n unset, a default ID will be assigned."]
2678 pub mparamID: ZL_MParamID,
2679}
2680#[test]
2681fn bindgen_test_layout_ZL_MParam() {
2682 const UNINIT: ::std::mem::MaybeUninit<ZL_MParam> = ::std::mem::MaybeUninit::uninit();
2683 let ptr = UNINIT.as_ptr();
2684 assert_eq!(
2685 ::std::mem::size_of::<ZL_MParam>(),
2686 48usize,
2687 "Size of ZL_MParam"
2688 );
2689 assert_eq!(
2690 ::std::mem::align_of::<ZL_MParam>(),
2691 8usize,
2692 "Alignment of ZL_MParam"
2693 );
2694 assert_eq!(
2695 unsafe { ::std::ptr::addr_of!((*ptr).content) as usize - ptr as usize },
2696 0usize,
2697 "Offset of field: ZL_MParam::content"
2698 );
2699 assert_eq!(
2700 unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
2701 8usize,
2702 "Offset of field: ZL_MParam::size"
2703 );
2704 assert_eq!(
2705 unsafe { ::std::ptr::addr_of!((*ptr).mparamID) as usize - ptr as usize },
2706 16usize,
2707 "Offset of field: ZL_MParam::mparamID"
2708 );
2709}
2710extern "C" {
2711 #[doc = " @returns true if @p id is non-NULL and not ZL_MPARAM_ID_NULL."]
2712 pub fn ZL_MParamID_hasValue(id: *const ZL_MParamID) -> bool;
2713}
2714#[doc = " The function signature for function graphs.\n\n @param graph The graph object containing the graph context\n @param inputs The inputs passed into the function graph to compress\n @param nbInputs The number of inputs in @p inputs"]
2715pub type ZL_FunctionGraphFn = ::std::option::Option<
2716 unsafe extern "C" fn(
2717 graph: *mut ZL_Graph,
2718 inputs: *mut *mut ZL_Edge,
2719 nbInputs: usize,
2720 ) -> ZL_Report,
2721>;
2722pub type ZL_FunctionGraphValidateFn = ::std::option::Option<
2723 unsafe extern "C" fn(
2724 compressor: *const ZL_Compressor,
2725 dgd: *const ZL_FunctionGraphDesc,
2726 ) -> ::std::os::raw::c_int,
2727>;
2728#[repr(C)]
2729#[derive(Debug, Copy, Clone)]
2730pub struct ZL_FunctionGraphDesc {
2731 pub name: *const ::std::os::raw::c_char,
2732 pub graph_f: ZL_FunctionGraphFn,
2733 pub validate_f: ZL_FunctionGraphValidateFn,
2734 pub inputTypeMasks: *const ZL_Type,
2735 pub nbInputs: usize,
2736 pub lastInputIsVariable: ::std::os::raw::c_int,
2737 pub customGraphs: *const ZL_GraphID,
2738 pub nbCustomGraphs: usize,
2739 pub customNodes: *const ZL_NodeID,
2740 pub nbCustomNodes: usize,
2741 pub localParams: ZL_LocalParams,
2742 #[doc = " Optional materializer descriptor for materialized local params.\n If both materializeFn and dematerializeFn are non-null, the materializer\n will be used to create materialized objects from local params."]
2743 pub materializer: ZL_MaterializerDesc,
2744 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Graph_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the compressor."]
2745 pub opaque: ZL_OpaquePtr,
2746}
2747#[test]
2748fn bindgen_test_layout_ZL_FunctionGraphDesc() {
2749 const UNINIT: ::std::mem::MaybeUninit<ZL_FunctionGraphDesc> = ::std::mem::MaybeUninit::uninit();
2750 let ptr = UNINIT.as_ptr();
2751 assert_eq!(
2752 ::std::mem::size_of::<ZL_FunctionGraphDesc>(),
2753 184usize,
2754 "Size of ZL_FunctionGraphDesc"
2755 );
2756 assert_eq!(
2757 ::std::mem::align_of::<ZL_FunctionGraphDesc>(),
2758 8usize,
2759 "Alignment of ZL_FunctionGraphDesc"
2760 );
2761 assert_eq!(
2762 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
2763 0usize,
2764 "Offset of field: ZL_FunctionGraphDesc::name"
2765 );
2766 assert_eq!(
2767 unsafe { ::std::ptr::addr_of!((*ptr).graph_f) as usize - ptr as usize },
2768 8usize,
2769 "Offset of field: ZL_FunctionGraphDesc::graph_f"
2770 );
2771 assert_eq!(
2772 unsafe { ::std::ptr::addr_of!((*ptr).validate_f) as usize - ptr as usize },
2773 16usize,
2774 "Offset of field: ZL_FunctionGraphDesc::validate_f"
2775 );
2776 assert_eq!(
2777 unsafe { ::std::ptr::addr_of!((*ptr).inputTypeMasks) as usize - ptr as usize },
2778 24usize,
2779 "Offset of field: ZL_FunctionGraphDesc::inputTypeMasks"
2780 );
2781 assert_eq!(
2782 unsafe { ::std::ptr::addr_of!((*ptr).nbInputs) as usize - ptr as usize },
2783 32usize,
2784 "Offset of field: ZL_FunctionGraphDesc::nbInputs"
2785 );
2786 assert_eq!(
2787 unsafe { ::std::ptr::addr_of!((*ptr).lastInputIsVariable) as usize - ptr as usize },
2788 40usize,
2789 "Offset of field: ZL_FunctionGraphDesc::lastInputIsVariable"
2790 );
2791 assert_eq!(
2792 unsafe { ::std::ptr::addr_of!((*ptr).customGraphs) as usize - ptr as usize },
2793 48usize,
2794 "Offset of field: ZL_FunctionGraphDesc::customGraphs"
2795 );
2796 assert_eq!(
2797 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomGraphs) as usize - ptr as usize },
2798 56usize,
2799 "Offset of field: ZL_FunctionGraphDesc::nbCustomGraphs"
2800 );
2801 assert_eq!(
2802 unsafe { ::std::ptr::addr_of!((*ptr).customNodes) as usize - ptr as usize },
2803 64usize,
2804 "Offset of field: ZL_FunctionGraphDesc::customNodes"
2805 );
2806 assert_eq!(
2807 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomNodes) as usize - ptr as usize },
2808 72usize,
2809 "Offset of field: ZL_FunctionGraphDesc::nbCustomNodes"
2810 );
2811 assert_eq!(
2812 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
2813 80usize,
2814 "Offset of field: ZL_FunctionGraphDesc::localParams"
2815 );
2816 assert_eq!(
2817 unsafe { ::std::ptr::addr_of!((*ptr).materializer) as usize - ptr as usize },
2818 128usize,
2819 "Offset of field: ZL_FunctionGraphDesc::materializer"
2820 );
2821 assert_eq!(
2822 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
2823 160usize,
2824 "Offset of field: ZL_FunctionGraphDesc::opaque"
2825 );
2826}
2827extern "C" {
2828 #[doc = " Registers a function graph given the @p desc.\n\n @note This is a new variant of @ref ZL_Compressor_registerFunctionGraph that\n reports errors using OpenZL's ZL_Report error system.\n\n @param desc The description of the graph, must be non-null.\n\n @return The new graph ID, or an error."]
2829 pub fn ZL_Compressor_registerFunctionGraph2(
2830 compressor: *mut ZL_Compressor,
2831 dgd: *const ZL_FunctionGraphDesc,
2832 ) -> ZL_Result_ZL_GraphID;
2833}
2834extern "C" {
2835 pub fn ZL_Compressor_registerFunctionGraph(
2836 compressor: *mut ZL_Compressor,
2837 dgd: *const ZL_FunctionGraphDesc,
2838 ) -> ZL_GraphID;
2839}
2840extern "C" {
2841 #[doc = " Registration might fail if the Descriptor is incorrectly filled,\n Any further operation attempted with such a Graph will also fail.\n Such an outcome can be tested with ZL_GraphID_isValid().\n Note: this is mostly for debugging purposes,\n once a Descriptor is valid, registration can be assumed to be successful."]
2842 pub fn ZL_GraphID_isValid(graphid: ZL_GraphID) -> ::std::os::raw::c_int;
2843}
2844extern "C" {
2845 pub fn ZL_Graph_getCustomGraphs(gctx: *const ZL_Graph) -> ZL_GraphIDList;
2846}
2847extern "C" {
2848 pub fn ZL_Graph_getCustomNodes(gctx: *const ZL_Graph) -> ZL_NodeIDList;
2849}
2850extern "C" {
2851 pub fn ZL_Graph_getCParam(gctx: *const ZL_Graph, gparam: ZL_CParam) -> ::std::os::raw::c_int;
2852}
2853extern "C" {
2854 pub fn ZL_Graph_getLocalIntParam(
2855 gctx: *const ZL_Graph,
2856 intParamId: ::std::os::raw::c_int,
2857 ) -> ZL_IntParam;
2858}
2859extern "C" {
2860 pub fn ZL_Graph_getLocalRefParam(
2861 gctx: *const ZL_Graph,
2862 refParamId: ::std::os::raw::c_int,
2863 ) -> ZL_RefParam;
2864}
2865extern "C" {
2866 #[doc = " Determines whether @nodeid is supported given the applied global parameters\n for the compression.\n Notably the ZL_CParam_formatVersion parameter can determine if a node is\n valid for the given encoding version."]
2867 pub fn ZL_Graph_isNodeSupported(gctx: *const ZL_Graph, nodeid: ZL_NodeID) -> bool;
2868}
2869extern "C" {
2870 pub fn ZL_Graph_getOpaquePtr(graph: *const ZL_Graph) -> *const ::std::os::raw::c_void;
2871}
2872extern "C" {
2873 #[doc = " @brief Query the current graph execution depth.\n\n Returns the depth at which the current graph is executing.\n Depth 1 is the root graph; each successor level increments by 1.\n This can be used to detect runaway graph growth.\n\n @param gctx Graph context, must be non-NULL.\n @return Current graph execution depth (>= 1)."]
2874 pub fn ZL_Graph_getDepth(gctx: *const ZL_Graph) -> ::std::os::raw::c_uint;
2875}
2876extern "C" {
2877 pub fn ZL_Edge_getData(sctx: *const ZL_Edge) -> *const ZL_Input;
2878}
2879extern "C" {
2880 #[doc = " Gets the error context for a given ZL_Report. This context is useful for\n debugging and for submitting bug reports to Zstrong developers.\n\n @param report The report to get the error context for\n\n @returns A verbose error string containing context about the error that\n occurred.\n\n @note: This string is stored within the @p graph and may only be valid for\n the lifetime of the @p graph."]
2881 pub fn ZL_Graph_getErrorContextString(
2882 graph: *const ZL_Graph,
2883 report: ZL_Report,
2884 ) -> *const ::std::os::raw::c_char;
2885}
2886extern "C" {
2887 #[doc = " See ZL_Graph_getErrorContextString()\n\n @param error: The error to get the context for"]
2888 pub fn ZL_Graph_getErrorContextString_fromError(
2889 graph: *const ZL_Graph,
2890 error: ZL_Error,
2891 ) -> *const ::std::os::raw::c_char;
2892}
2893extern "C" {
2894 pub fn ZL_Graph_getScratchSpace(
2895 gctx: *mut ZL_Graph,
2896 size: usize,
2897 ) -> *mut ::std::os::raw::c_void;
2898}
2899#[doc = " A measurement of graph performance.\n Currently this is compressed size, but it is expected to be expanded to\n include speed."]
2900#[repr(C)]
2901#[derive(Debug, Copy, Clone)]
2902pub struct ZL_GraphPerformance {
2903 #[doc = " The compressed size of the graph on the given input(s)"]
2904 pub compressedSize: usize,
2905}
2906#[test]
2907fn bindgen_test_layout_ZL_GraphPerformance() {
2908 const UNINIT: ::std::mem::MaybeUninit<ZL_GraphPerformance> = ::std::mem::MaybeUninit::uninit();
2909 let ptr = UNINIT.as_ptr();
2910 assert_eq!(
2911 ::std::mem::size_of::<ZL_GraphPerformance>(),
2912 8usize,
2913 "Size of ZL_GraphPerformance"
2914 );
2915 assert_eq!(
2916 ::std::mem::align_of::<ZL_GraphPerformance>(),
2917 8usize,
2918 "Alignment of ZL_GraphPerformance"
2919 );
2920 assert_eq!(
2921 unsafe { ::std::ptr::addr_of!((*ptr).compressedSize) as usize - ptr as usize },
2922 0usize,
2923 "Offset of field: ZL_GraphPerformance::compressedSize"
2924 );
2925}
2926#[repr(C)]
2927#[derive(Debug, Copy, Clone)]
2928pub struct ZL_Result_ZL_GraphPerformance_inner {
2929 pub _code: ZL_ErrorCode,
2930 pub _value: ZL_GraphPerformance,
2931}
2932#[test]
2933fn bindgen_test_layout_ZL_Result_ZL_GraphPerformance_inner() {
2934 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_GraphPerformance_inner> =
2935 ::std::mem::MaybeUninit::uninit();
2936 let ptr = UNINIT.as_ptr();
2937 assert_eq!(
2938 ::std::mem::size_of::<ZL_Result_ZL_GraphPerformance_inner>(),
2939 16usize,
2940 "Size of ZL_Result_ZL_GraphPerformance_inner"
2941 );
2942 assert_eq!(
2943 ::std::mem::align_of::<ZL_Result_ZL_GraphPerformance_inner>(),
2944 8usize,
2945 "Alignment of ZL_Result_ZL_GraphPerformance_inner"
2946 );
2947 assert_eq!(
2948 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
2949 0usize,
2950 "Offset of field: ZL_Result_ZL_GraphPerformance_inner::_code"
2951 );
2952 assert_eq!(
2953 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
2954 8usize,
2955 "Offset of field: ZL_Result_ZL_GraphPerformance_inner::_value"
2956 );
2957}
2958#[repr(C)]
2959#[derive(Copy, Clone)]
2960pub union ZL_Result_ZL_GraphPerformance_u {
2961 pub _code: ZL_ErrorCode,
2962 pub _value: ZL_Result_ZL_GraphPerformance_inner,
2963 pub _error: ZL_Error,
2964}
2965#[test]
2966fn bindgen_test_layout_ZL_Result_ZL_GraphPerformance_u() {
2967 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_GraphPerformance_u> =
2968 ::std::mem::MaybeUninit::uninit();
2969 let ptr = UNINIT.as_ptr();
2970 assert_eq!(
2971 ::std::mem::size_of::<ZL_Result_ZL_GraphPerformance_u>(),
2972 16usize,
2973 "Size of ZL_Result_ZL_GraphPerformance_u"
2974 );
2975 assert_eq!(
2976 ::std::mem::align_of::<ZL_Result_ZL_GraphPerformance_u>(),
2977 8usize,
2978 "Alignment of ZL_Result_ZL_GraphPerformance_u"
2979 );
2980 assert_eq!(
2981 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
2982 0usize,
2983 "Offset of field: ZL_Result_ZL_GraphPerformance_u::_code"
2984 );
2985 assert_eq!(
2986 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
2987 0usize,
2988 "Offset of field: ZL_Result_ZL_GraphPerformance_u::_value"
2989 );
2990 assert_eq!(
2991 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
2992 0usize,
2993 "Offset of field: ZL_Result_ZL_GraphPerformance_u::_error"
2994 );
2995}
2996pub type ZL_Result_ZL_GraphPerformance = ZL_Result_ZL_GraphPerformance_u;
2997extern "C" {
2998 #[link_name = "ZL_Result_ZL_GraphPerformance_extract__extern"]
2999 pub fn ZL_Result_ZL_GraphPerformance_extract(
3000 result: ZL_Result_ZL_GraphPerformance,
3001 error: *mut ZL_Error,
3002 ) -> ZL_GraphPerformance;
3003}
3004pub type ZL_Result_ZL_GraphPerformance_fake_type_needs_semicolon = ::std::os::raw::c_int;
3005extern "C" {
3006 #[doc = " @brief Attempt compression using a graph and return the performance.\n\n This API allows the user to simulate the execution of a given @p graphID\n on an input to measure its performance. This API is wasteful in CPU and\n memory and should only be used when there is no better choice.\n\n @param input The input to try compress on\n @param graphID The GraphID to use to compress the @p input\n @param params The runtime parameters for the @p graphID, or `NULL` to not\n parameterize the graph.\n\n @returns If the compression failed it returns a non-fatal error. Otherwise,\n it returns the performance of the @p graphID on the @p input."]
3007 pub fn ZL_Graph_tryGraph(
3008 gctx: *const ZL_Graph,
3009 input: *const ZL_Input,
3010 graphID: ZL_GraphID,
3011 params: *const ZL_RuntimeGraphParameters,
3012 ) -> ZL_Result_ZL_GraphPerformance;
3013}
3014extern "C" {
3015 #[doc = " @brief Attempt compression using a graph and return the performance.\n\n The same as @ref ZL_Graph_tryGraph except it accepts multiple inputs."]
3016 pub fn ZL_Graph_tryMultiInputGraph(
3017 gctx: *const ZL_Graph,
3018 inputs: *mut *const ZL_Input,
3019 numInputs: usize,
3020 graphID: ZL_GraphID,
3021 params: *const ZL_RuntimeGraphParameters,
3022 ) -> ZL_Result_ZL_GraphPerformance;
3023}
3024#[repr(C)]
3025#[derive(Copy, Clone)]
3026pub struct ZL_EdgeList {
3027 pub field_1: ZL_EdgeList__bindgen_ty_1,
3028 pub field_2: ZL_EdgeList__bindgen_ty_2,
3029}
3030#[repr(C)]
3031#[derive(Copy, Clone)]
3032pub union ZL_EdgeList__bindgen_ty_1 {
3033 pub edges: *mut *mut ZL_Edge,
3034 pub streams: *mut *mut ZL_Edge,
3035}
3036#[test]
3037fn bindgen_test_layout_ZL_EdgeList__bindgen_ty_1() {
3038 const UNINIT: ::std::mem::MaybeUninit<ZL_EdgeList__bindgen_ty_1> =
3039 ::std::mem::MaybeUninit::uninit();
3040 let ptr = UNINIT.as_ptr();
3041 assert_eq!(
3042 ::std::mem::size_of::<ZL_EdgeList__bindgen_ty_1>(),
3043 8usize,
3044 "Size of ZL_EdgeList__bindgen_ty_1"
3045 );
3046 assert_eq!(
3047 ::std::mem::align_of::<ZL_EdgeList__bindgen_ty_1>(),
3048 8usize,
3049 "Alignment of ZL_EdgeList__bindgen_ty_1"
3050 );
3051 assert_eq!(
3052 unsafe { ::std::ptr::addr_of!((*ptr).edges) as usize - ptr as usize },
3053 0usize,
3054 "Offset of field: ZL_EdgeList__bindgen_ty_1::edges"
3055 );
3056 assert_eq!(
3057 unsafe { ::std::ptr::addr_of!((*ptr).streams) as usize - ptr as usize },
3058 0usize,
3059 "Offset of field: ZL_EdgeList__bindgen_ty_1::streams"
3060 );
3061}
3062#[repr(C)]
3063#[derive(Copy, Clone)]
3064pub union ZL_EdgeList__bindgen_ty_2 {
3065 pub nbEdges: usize,
3066 pub nbStreams: usize,
3067}
3068#[test]
3069fn bindgen_test_layout_ZL_EdgeList__bindgen_ty_2() {
3070 const UNINIT: ::std::mem::MaybeUninit<ZL_EdgeList__bindgen_ty_2> =
3071 ::std::mem::MaybeUninit::uninit();
3072 let ptr = UNINIT.as_ptr();
3073 assert_eq!(
3074 ::std::mem::size_of::<ZL_EdgeList__bindgen_ty_2>(),
3075 8usize,
3076 "Size of ZL_EdgeList__bindgen_ty_2"
3077 );
3078 assert_eq!(
3079 ::std::mem::align_of::<ZL_EdgeList__bindgen_ty_2>(),
3080 8usize,
3081 "Alignment of ZL_EdgeList__bindgen_ty_2"
3082 );
3083 assert_eq!(
3084 unsafe { ::std::ptr::addr_of!((*ptr).nbEdges) as usize - ptr as usize },
3085 0usize,
3086 "Offset of field: ZL_EdgeList__bindgen_ty_2::nbEdges"
3087 );
3088 assert_eq!(
3089 unsafe { ::std::ptr::addr_of!((*ptr).nbStreams) as usize - ptr as usize },
3090 0usize,
3091 "Offset of field: ZL_EdgeList__bindgen_ty_2::nbStreams"
3092 );
3093}
3094#[test]
3095fn bindgen_test_layout_ZL_EdgeList() {
3096 assert_eq!(
3097 ::std::mem::size_of::<ZL_EdgeList>(),
3098 16usize,
3099 "Size of ZL_EdgeList"
3100 );
3101 assert_eq!(
3102 ::std::mem::align_of::<ZL_EdgeList>(),
3103 8usize,
3104 "Alignment of ZL_EdgeList"
3105 );
3106}
3107#[repr(C)]
3108#[derive(Copy, Clone)]
3109pub struct ZL_Result_ZL_EdgeList_inner {
3110 pub _code: ZL_ErrorCode,
3111 pub _value: ZL_EdgeList,
3112}
3113#[test]
3114fn bindgen_test_layout_ZL_Result_ZL_EdgeList_inner() {
3115 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_EdgeList_inner> =
3116 ::std::mem::MaybeUninit::uninit();
3117 let ptr = UNINIT.as_ptr();
3118 assert_eq!(
3119 ::std::mem::size_of::<ZL_Result_ZL_EdgeList_inner>(),
3120 24usize,
3121 "Size of ZL_Result_ZL_EdgeList_inner"
3122 );
3123 assert_eq!(
3124 ::std::mem::align_of::<ZL_Result_ZL_EdgeList_inner>(),
3125 8usize,
3126 "Alignment of ZL_Result_ZL_EdgeList_inner"
3127 );
3128 assert_eq!(
3129 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
3130 0usize,
3131 "Offset of field: ZL_Result_ZL_EdgeList_inner::_code"
3132 );
3133 assert_eq!(
3134 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
3135 8usize,
3136 "Offset of field: ZL_Result_ZL_EdgeList_inner::_value"
3137 );
3138}
3139#[repr(C)]
3140#[derive(Copy, Clone)]
3141pub union ZL_Result_ZL_EdgeList_u {
3142 pub _code: ZL_ErrorCode,
3143 pub _value: ZL_Result_ZL_EdgeList_inner,
3144 pub _error: ZL_Error,
3145}
3146#[test]
3147fn bindgen_test_layout_ZL_Result_ZL_EdgeList_u() {
3148 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_EdgeList_u> =
3149 ::std::mem::MaybeUninit::uninit();
3150 let ptr = UNINIT.as_ptr();
3151 assert_eq!(
3152 ::std::mem::size_of::<ZL_Result_ZL_EdgeList_u>(),
3153 24usize,
3154 "Size of ZL_Result_ZL_EdgeList_u"
3155 );
3156 assert_eq!(
3157 ::std::mem::align_of::<ZL_Result_ZL_EdgeList_u>(),
3158 8usize,
3159 "Alignment of ZL_Result_ZL_EdgeList_u"
3160 );
3161 assert_eq!(
3162 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
3163 0usize,
3164 "Offset of field: ZL_Result_ZL_EdgeList_u::_code"
3165 );
3166 assert_eq!(
3167 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
3168 0usize,
3169 "Offset of field: ZL_Result_ZL_EdgeList_u::_value"
3170 );
3171 assert_eq!(
3172 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
3173 0usize,
3174 "Offset of field: ZL_Result_ZL_EdgeList_u::_error"
3175 );
3176}
3177pub type ZL_Result_ZL_EdgeList = ZL_Result_ZL_EdgeList_u;
3178extern "C" {
3179 #[link_name = "ZL_Result_ZL_EdgeList_extract__extern"]
3180 pub fn ZL_Result_ZL_EdgeList_extract(
3181 result: ZL_Result_ZL_EdgeList,
3182 error: *mut ZL_Error,
3183 ) -> ZL_EdgeList;
3184}
3185pub type ZL_Result_ZL_EdgeList_fake_type_needs_semicolon = ::std::os::raw::c_int;
3186extern "C" {
3187 pub fn ZL_Edge_runNode(input: *mut ZL_Edge, nid: ZL_NodeID) -> ZL_Result_ZL_EdgeList;
3188}
3189extern "C" {
3190 pub fn ZL_Edge_runNode_withParams(
3191 input: *mut ZL_Edge,
3192 nid: ZL_NodeID,
3193 localParams: *const ZL_LocalParams,
3194 ) -> ZL_Result_ZL_EdgeList;
3195}
3196extern "C" {
3197 pub fn ZL_Edge_runMultiInputNode(
3198 inputs: *mut *mut ZL_Edge,
3199 nbInputs: usize,
3200 nid: ZL_NodeID,
3201 ) -> ZL_Result_ZL_EdgeList;
3202}
3203extern "C" {
3204 pub fn ZL_Edge_runMultiInputNode_withParams(
3205 inputs: *mut *mut ZL_Edge,
3206 nbInputs: usize,
3207 nid: ZL_NodeID,
3208 localParams: *const ZL_LocalParams,
3209 ) -> ZL_Result_ZL_EdgeList;
3210}
3211extern "C" {
3212 #[doc = " @brief Sets the int metadata for the edge to @p mValue\n\n @param mId The identifier for the stream metadata on the edge to set metadata\n on\n @param mValue The value to set stream metadata"]
3213 pub fn ZL_Edge_setIntMetadata(
3214 edge: *mut ZL_Edge,
3215 mId: ::std::os::raw::c_int,
3216 mValue: ::std::os::raw::c_int,
3217 ) -> ZL_Report;
3218}
3219extern "C" {
3220 pub fn ZL_Edge_setDestination(edge: *mut ZL_Edge, gid: ZL_GraphID) -> ZL_Report;
3221}
3222extern "C" {
3223 #[doc = " @brief Sets the destination of the provided edges to the provided graph ID,\n overriding its behavior with the provided parameters.\n\n @param edges Array of edges to direct towards the successor graph.\n @param nbInputs The number of edges in the provided array.\n @param gid The ID of the successor graph.\n @param rGraphParams The parameters to use for the successor graph. NULL means\n don't override."]
3224 pub fn ZL_Edge_setParameterizedDestination(
3225 edges: *mut *mut ZL_Edge,
3226 nbInputs: usize,
3227 gid: ZL_GraphID,
3228 rGraphParams: *const ZL_RuntimeGraphParameters,
3229 ) -> ZL_Report;
3230}
3231extern "C" {
3232 #[doc = " Helper function to parameterize the `ZL_NODE_CONVERT_SERIAL_TO_STRUCT` node\n with the struct size.\n\n Input: Serial\n Output: Struct"]
3233 pub fn ZL_Compressor_parameterizeConvertSerialToStructNode(
3234 compressor: *mut ZL_Compressor,
3235 structSize: ::std::os::raw::c_int,
3236 ) -> ZL_Result_ZL_NodeID;
3237}
3238extern "C" {
3239 #[doc = " Convert from serial to `bitWidth`-bit little-endian numeric data.\n\n @pre bitWidth must be 8, 16, 32, or 64.\n\n Input: Serial\n Output: Numeric"]
3240 pub fn ZL_Node_convertSerialToNumLE(bitWidth: usize) -> ZL_NodeID;
3241}
3242extern "C" {
3243 #[doc = " Convert from serial to `bitWidth`-bit big-endian numeric data.\n\n @pre bitWidth must be 8, 16, 32, or 64.\n\n Input: Serial\n Output: Numeric"]
3244 pub fn ZL_Node_convertSerialToNumBE(bitWidth: usize) -> ZL_NodeID;
3245}
3246#[repr(C)]
3247#[derive(Debug, Copy, Clone)]
3248pub struct ZL_SetStringLensInstructions {
3249 pub stringLens: *const u32,
3250 pub nbStrings: usize,
3251}
3252#[test]
3253fn bindgen_test_layout_ZL_SetStringLensInstructions() {
3254 const UNINIT: ::std::mem::MaybeUninit<ZL_SetStringLensInstructions> =
3255 ::std::mem::MaybeUninit::uninit();
3256 let ptr = UNINIT.as_ptr();
3257 assert_eq!(
3258 ::std::mem::size_of::<ZL_SetStringLensInstructions>(),
3259 16usize,
3260 "Size of ZL_SetStringLensInstructions"
3261 );
3262 assert_eq!(
3263 ::std::mem::align_of::<ZL_SetStringLensInstructions>(),
3264 8usize,
3265 "Alignment of ZL_SetStringLensInstructions"
3266 );
3267 assert_eq!(
3268 unsafe { ::std::ptr::addr_of!((*ptr).stringLens) as usize - ptr as usize },
3269 0usize,
3270 "Offset of field: ZL_SetStringLensInstructions::stringLens"
3271 );
3272 assert_eq!(
3273 unsafe { ::std::ptr::addr_of!((*ptr).nbStrings) as usize - ptr as usize },
3274 8usize,
3275 "Offset of field: ZL_SetStringLensInstructions::nbStrings"
3276 );
3277}
3278#[repr(C)]
3279#[derive(Debug, Copy, Clone)]
3280pub struct ZL_SetStringLensState_s {
3281 _unused: [u8; 0],
3282}
3283pub type ZL_SetStringLensState = ZL_SetStringLensState_s;
3284pub type ZL_SetStringLensParserFn = ::std::option::Option<
3285 unsafe extern "C" fn(
3286 state: *mut ZL_SetStringLensState,
3287 in_: *const ZL_Input,
3288 ) -> ZL_SetStringLensInstructions,
3289>;
3290extern "C" {
3291 pub fn ZL_SetStringLensState_getOpaquePtr(
3292 state: *const ZL_SetStringLensState,
3293 ) -> *const ::std::os::raw::c_void;
3294}
3295extern "C" {
3296 pub fn ZL_SetStringLensState_malloc(
3297 state: *mut ZL_SetStringLensState,
3298 size: usize,
3299 ) -> *mut ::std::os::raw::c_void;
3300}
3301extern "C" {
3302 pub fn ZL_Compressor_registerConvertSerialToStringNode(
3303 cgraph: *mut ZL_Compressor,
3304 f: ZL_SetStringLensParserFn,
3305 opaque: *const ::std::os::raw::c_void,
3306 ) -> ZL_NodeID;
3307}
3308extern "C" {
3309 pub fn ZL_Edge_runConvertSerialToStringNode(
3310 sctx: *mut ZL_Edge,
3311 stringLens: *const u32,
3312 nbString: usize,
3313 ) -> ZL_Result_ZL_EdgeList;
3314}
3315pub const ZL_trlip_tokenSize: _bindgen_ty_2 = 1;
3316pub type _bindgen_ty_2 = ::std::os::raw::c_uint;
3317extern "C" {
3318 #[link_name = "ZL_Node_interpretAsLE__extern"]
3319 pub fn ZL_Node_interpretAsLE(bitWidth: usize) -> ZL_NodeID;
3320}
3321#[repr(C)]
3322#[derive(Debug, Copy, Clone)]
3323pub struct ZL_DispatchInstructions {
3324 pub segmentSizes: *const usize,
3325 pub tags: *const ::std::os::raw::c_uint,
3326 pub nbSegments: usize,
3327 pub nbTags: ::std::os::raw::c_uint,
3328}
3329#[test]
3330fn bindgen_test_layout_ZL_DispatchInstructions() {
3331 const UNINIT: ::std::mem::MaybeUninit<ZL_DispatchInstructions> =
3332 ::std::mem::MaybeUninit::uninit();
3333 let ptr = UNINIT.as_ptr();
3334 assert_eq!(
3335 ::std::mem::size_of::<ZL_DispatchInstructions>(),
3336 32usize,
3337 "Size of ZL_DispatchInstructions"
3338 );
3339 assert_eq!(
3340 ::std::mem::align_of::<ZL_DispatchInstructions>(),
3341 8usize,
3342 "Alignment of ZL_DispatchInstructions"
3343 );
3344 assert_eq!(
3345 unsafe { ::std::ptr::addr_of!((*ptr).segmentSizes) as usize - ptr as usize },
3346 0usize,
3347 "Offset of field: ZL_DispatchInstructions::segmentSizes"
3348 );
3349 assert_eq!(
3350 unsafe { ::std::ptr::addr_of!((*ptr).tags) as usize - ptr as usize },
3351 8usize,
3352 "Offset of field: ZL_DispatchInstructions::tags"
3353 );
3354 assert_eq!(
3355 unsafe { ::std::ptr::addr_of!((*ptr).nbSegments) as usize - ptr as usize },
3356 16usize,
3357 "Offset of field: ZL_DispatchInstructions::nbSegments"
3358 );
3359 assert_eq!(
3360 unsafe { ::std::ptr::addr_of!((*ptr).nbTags) as usize - ptr as usize },
3361 24usize,
3362 "Offset of field: ZL_DispatchInstructions::nbTags"
3363 );
3364}
3365#[repr(C)]
3366#[derive(Debug, Copy, Clone)]
3367pub struct ZL_DispatchState_s {
3368 _unused: [u8; 0],
3369}
3370pub type ZL_DispatchState = ZL_DispatchState_s;
3371extern "C" {
3372 pub fn ZL_DispatchState_malloc(
3373 state: *mut ZL_DispatchState,
3374 size: usize,
3375 ) -> *mut ::std::os::raw::c_void;
3376}
3377extern "C" {
3378 #[doc = " Provides an opaque pointer that can be useful to provide state to the parser.\n For example, it can be used by language bindings to allow parsers written in\n languages other than C.\n\n @returns The opaque pointer provided to @fn\n ZL_Compressor_registerDispatchNode(). WARNING: ZStrong does not manage the\n lifetime of this pointer, it must outlive the ZL_Compressor."]
3379 pub fn ZL_DispatchState_getOpaquePtr(
3380 state: *const ZL_DispatchState,
3381 ) -> *const ::std::os::raw::c_void;
3382}
3383extern "C" {
3384 #[doc = " @returns An error from the parser function and places the @p message into\n Zstrong's error context."]
3385 pub fn ZL_DispatchState_returnError(
3386 state: *mut ZL_DispatchState,
3387 message: *const ::std::os::raw::c_char,
3388 ) -> ZL_DispatchInstructions;
3389}
3390pub type ZL_DispatchParserFn = ::std::option::Option<
3391 unsafe extern "C" fn(
3392 state: *mut ZL_DispatchState,
3393 in_: *const ZL_Input,
3394 ) -> ZL_DispatchInstructions,
3395>;
3396extern "C" {
3397 pub fn ZL_Compressor_registerDispatchNode(
3398 cgraph: *mut ZL_Compressor,
3399 f: ZL_DispatchParserFn,
3400 opaque: *const ::std::os::raw::c_void,
3401 ) -> ZL_NodeID;
3402}
3403extern "C" {
3404 #[doc = " Run the DispatchN node in the context of a dynamic graph,\n following runtime-defined @p instructions.\n\n @returns The list of Streams produced by the Transform,\n or an error if the operation fails (invalid instruction or input for example)"]
3405 pub fn ZL_Edge_runDispatchNode(
3406 sctx: *mut ZL_Edge,
3407 instructions: *const ZL_DispatchInstructions,
3408 ) -> ZL_Result_ZL_EdgeList;
3409}
3410extern "C" {
3411 #[doc = " Convenience function to get the maximum number of dispatches supported by the\n current encoder version."]
3412 pub fn ZL_DispatchString_maxDispatches() -> usize;
3413}
3414extern "C" {
3415 #[doc = " @param nbOutputs - the number of output streams to be generated. Passed as a\n local param to the transform.\n @param dispatchIndices - the array of indices to be used for dispatching.\n Will be passed as a local param to the transform. The lifetime of the array\n is to be managed by the caller and should outlive the transform execution."]
3416 pub fn ZL_Compressor_registerDispatchStringNode(
3417 cgraph: *mut ZL_Compressor,
3418 nbOutputsParam: ::std::os::raw::c_int,
3419 dispatchIndicesParam: *const u16,
3420 ) -> ZL_NodeID;
3421}
3422extern "C" {
3423 #[doc = " Run the ZL_NODE_DISPATCH_STRING Node in the context of a Dynamic Graph,\n applying runtime defined parameters."]
3424 pub fn ZL_Edge_runDispatchStringNode(
3425 sctx: *mut ZL_Edge,
3426 nbOutputs: ::std::os::raw::c_int,
3427 indices: *const u16,
3428 ) -> ZL_Result_ZL_EdgeList;
3429}
3430extern "C" {
3431 #[doc = " Creates the divide by node with its divisor set to @p divisor.\n\n @returns Returns the modified divide by node with its divisor set to @p\n divisor."]
3432 pub fn ZL_Compressor_registerDivideByNode(
3433 cgraph: *mut ZL_Compressor,
3434 divisor: u64,
3435 ) -> ZL_NodeID;
3436}
3437extern "C" {
3438 #[doc = " DEPRECATED: Use ZL_GRAPH_FIELD_LZ instead.\n @returns ZL_GRAPH_FIELD_LZ"]
3439 pub fn ZL_Compressor_registerFieldLZGraph(cgraph: *mut ZL_Compressor) -> ZL_GraphID;
3440}
3441extern "C" {
3442 #[doc = " @returns ZL_GRAPH_FIELD_LZ with overridden compression level"]
3443 pub fn ZL_Compressor_registerFieldLZGraph_withLevel(
3444 cgraph: *mut ZL_Compressor,
3445 compressionLevel: ::std::os::raw::c_int,
3446 ) -> ZL_GraphID;
3447}
3448extern "C" {
3449 #[doc = " Creates a Field LZ graph with a custom literals compressor.\n\n Field LZ compresses a fixed size field stream using LZ compression\n that only matches entire fields.\n\n Input: A fixed size stream of width 1, 2, 4, or 8.\n\n @param literalsGraph a graph which takes a fixed size field of the\n same width as the input. All fields that we can't find matches for\n are passed to the literals stream."]
3450 pub fn ZL_Compressor_registerFieldLZGraph_withLiteralsGraph(
3451 cgraph: *mut ZL_Compressor,
3452 literalsGraph: ZL_GraphID,
3453 ) -> ZL_GraphID;
3454}
3455extern "C" {
3456 #[doc = " @returns ZL_GRAPH_LZ4 with overridden compression level"]
3457 pub fn ZL_Compressor_buildLZ4Graph(
3458 cgraph: *mut ZL_Compressor,
3459 compressionLevel: ::std::os::raw::c_int,
3460 ) -> ZL_Result_ZL_GraphID;
3461}
3462extern "C" {
3463 #[doc = " Creates a graph for ZL_NODE_MERGE_SORTED that first detects whether\n the input has <= 64 sorted runs. If it does it selects the node.\n Otherwise it selects the backupGraph."]
3464 pub fn ZL_Compressor_registerMergeSortedGraph(
3465 cgraph: *mut ZL_Compressor,
3466 bitsetGraph: ZL_GraphID,
3467 mergedGraph: ZL_GraphID,
3468 backupGraph: ZL_GraphID,
3469 ) -> ZL_GraphID;
3470}
3471extern "C" {
3472 #[doc = " @brief Builds an untrained ML selector graph.\n\n The ML selector uses an XGBoost model to predict which successor to use for\n compression. Until trained, this selector always selects the first successor.\n\n Supported types: Numeric integer data.\n\n Training workflow:\n 1. Build your compressor with an ML selector graph using this function\n 2. Wrap the resulting graph with ZL_NODE_CONVERT_SERIAL_TO_NUM_LE# (for\n #-bit data) and parameterize using ZL_Compressor_parameterizeGraph\n 3. Serialize the compressor: compressor.serialize() -> save to file.zlc\n 4. Train: ./zli train --compressor file.zlc <samples> -o trained.zli\n 5. Use: ./zli compress --compressor trained.zli <input> -o <output.zl>\n\n Alternatively, use the built-in profile for 64-bit numeric data:\n ./zli train --profile numeric-ml-selector-64 <samples> -o trained.zli\n\n Note: Successor ordering must stay the same between training and inference.\n\n See tools/ml_selector/README.md for more details and example.\n\n @param compressor The compressor to register the graph with\n @param successors The set of successor graphs to choose from\n @param nbSuccessors The number of successors\n @return The graph ID of the registered ML selector, or an error"]
3473 pub fn ZL_Compressor_buildUntrainedMLSelector(
3474 compressor: *mut ZL_Compressor,
3475 successors: *const ZL_GraphID,
3476 nbSuccessors: usize,
3477 ) -> ZL_Result_ZL_GraphID;
3478}
3479extern "C" {
3480 #[doc = " Returns a parameterized version of the try parse int graph with the required\n successors of the graph.\n\n @param numSuccessor The successor to send strings that successfully parse as\n integers\n @param exceptionSucesssor The successor to send strings that fail to parse as\n integers\n @return The graphID for the parameterized Try Parse Int graph"]
3481 pub fn ZL_Compressor_parameterizeTryParseIntGraph(
3482 compressor: *mut ZL_Compressor,
3483 numSuccessor: ZL_GraphID,
3484 exceptionSuccessor: ZL_GraphID,
3485 ) -> ZL_Result_ZL_GraphID;
3486}
3487extern "C" {
3488 #[doc = " Builds a Simple Data Description Language graph with the provided\n (pre-compiled) @p description and @p successor graph.\n\n See the SDDL page in the documentation for a complete description of this\n component.\n\n ### Graph Topology\n\n ``` mermaid\n flowchart TD\n subgraph SDDL Graph\n Desc([Description]);\n Input([Input]);\n Conv@{ shape: procs, label: \"Type Conversions\"};\n Engine[SDDL Engine];\n Inst([Instructions]);\n Disp[/Dispatch Transform\\];\n Succ[Successor Graph];\n\n Desc --> Engine;\n Input --> Engine;\n Engine --> Inst;\n Inst -->|Dispatch Instructions| Disp;\n Input --> Disp;\n Inst -->|Type Information| Conv;\n Disp ==>|Many Streams| Conv;\n Conv ==>|Many Streams| Succ;\n end\n\n OuterInput[ZL_Input] --> Input;\n OuterParam[ZL_LocalCopyParam] --> Desc;\n ```\n\n This graph takes a single serial input and applies the @p description to it,\n using that description to decompose the input into fields which are mapped\n to one or more output streams. These streams, as well as two control streams\n are all sent to a single invocation of the @p successor graph. @p successor\n must therefore be a multi-input graph able to accept any number of numeric\n and serial streams (at least).\n\n (The control streams are: a numeric stream containing the stream indices\n into which each field has been placed and a numeric stream containing the\n size of each field. See also the documentation for `dispatchN_byTag` and\n particularly, @ref ZL_Edge_runDispatchNode, which is the underlying\n component that this graph uses to actually decompose the input, for more\n information about the dispatch operation. These streams respectively are the\n first and second stream passed into the successor graph, and the streams\n into which the input has been dispatched follow, in order.)\n\n The streams on which the @p successor is invoked are also tagged with int\n metadata, with key 0 set to their index. (For the moment. Future work may\n allow for more robust/stable tagging.) This makes this graph compatible with\n the generic clustering graph (see @ref ZL_Clustering_registerGraph), and the\n `sddl` profile in the demo CLI, for example, is set up that way, with the\n SDDL graph succeeded by the generic clusterer.\n\n ### Data Description\n\n This graph requires a @p description of the input format that it is intended\n to parse and dispatch. SDDL has both a human-writeable description language\n and a binary, compiled representation of that language. This component only\n accepts descriptions in the binary format.\n\n Use @ref openzl::sddl::Compiler::compile to do that translation.\n\n Note that the OpenZL demo CLI can also compile SDDL descriptions, as part of\n using the `sddl` profile."]
3489 pub fn ZL_Compressor_buildSDDLGraph(
3490 compressor: *mut ZL_Compressor,
3491 description: *const ::std::os::raw::c_void,
3492 descriptionSize: usize,
3493 successor: ZL_GraphID,
3494 ) -> ZL_Result_ZL_GraphID;
3495}
3496extern "C" {
3497 #[doc = " Run the general sentinel node on @p input within a function graph.\n\n Convenience wrapper around ZL_Edge_runNode_withParams() that packages\n exception indices and sentinel value as local params.\n\n @param input The input edge to process\n @param exceptionIndices Sorted array of indices to move to exceptions\n @param numExceptions Number of exception indices\n @param sentinel The sentinel value to use\n @returns An EdgeList with 2 edges: [0] = values, [1] = exceptions"]
3498 pub fn ZL_Edge_runSentinelNode(
3499 input: *mut ZL_Edge,
3500 exceptionIndices: *const usize,
3501 numExceptions: usize,
3502 sentinel: u64,
3503 ) -> ZL_Result_ZL_EdgeList;
3504}
3505extern "C" {
3506 pub fn ZL_Compressor_registerSplitNode_withParams(
3507 cgraph: *mut ZL_Compressor,
3508 type_: ZL_Type,
3509 segmentSizes: *const usize,
3510 nbSegments: usize,
3511 ) -> ZL_NodeID;
3512}
3513extern "C" {
3514 #[doc = " Run the SplitN node within the context of a dynamic graph,\n applying runtime-defined @p segmentSizes parameters.\n\n @returns the list of Streams created by the Transform\n or an error if the splitting process fails (invalid segment sizes or input\n type for example)"]
3515 pub fn ZL_Edge_runSplitNode(
3516 input: *mut ZL_Edge,
3517 segmentSizes: *const usize,
3518 nbSegments: usize,
3519 ) -> ZL_Result_ZL_EdgeList;
3520}
3521#[repr(C)]
3522#[derive(Debug, Copy, Clone)]
3523pub struct ZL_SplitInstructions {
3524 pub segmentSizes: *const usize,
3525 pub nbSegments: usize,
3526}
3527#[test]
3528fn bindgen_test_layout_ZL_SplitInstructions() {
3529 const UNINIT: ::std::mem::MaybeUninit<ZL_SplitInstructions> = ::std::mem::MaybeUninit::uninit();
3530 let ptr = UNINIT.as_ptr();
3531 assert_eq!(
3532 ::std::mem::size_of::<ZL_SplitInstructions>(),
3533 16usize,
3534 "Size of ZL_SplitInstructions"
3535 );
3536 assert_eq!(
3537 ::std::mem::align_of::<ZL_SplitInstructions>(),
3538 8usize,
3539 "Alignment of ZL_SplitInstructions"
3540 );
3541 assert_eq!(
3542 unsafe { ::std::ptr::addr_of!((*ptr).segmentSizes) as usize - ptr as usize },
3543 0usize,
3544 "Offset of field: ZL_SplitInstructions::segmentSizes"
3545 );
3546 assert_eq!(
3547 unsafe { ::std::ptr::addr_of!((*ptr).nbSegments) as usize - ptr as usize },
3548 8usize,
3549 "Offset of field: ZL_SplitInstructions::nbSegments"
3550 );
3551}
3552#[repr(C)]
3553#[derive(Debug, Copy, Clone)]
3554pub struct ZL_SplitState_s {
3555 _unused: [u8; 0],
3556}
3557pub type ZL_SplitState = ZL_SplitState_s;
3558extern "C" {
3559 pub fn ZL_SplitState_malloc(
3560 state: *mut ZL_SplitState,
3561 size: usize,
3562 ) -> *mut ::std::os::raw::c_void;
3563}
3564extern "C" {
3565 #[doc = " Provides an opaque pointer that can be useful to provide state to the parser.\n For example, it can be used by language bindings to allow parsers written in\n languages other than C.\n\n @returns The opaque pointer provided to @fn\n ZL_Compressor_registerSplitNode_withParser(). WARNING: ZStrong does not\n manage the lifetime of this pointer, it must outlive the ZL_Compressor."]
3566 pub fn ZL_SplitState_getOpaquePtr(state: *mut ZL_SplitState) -> *const ::std::os::raw::c_void;
3567}
3568pub type ZL_SplitParserFn = ::std::option::Option<
3569 unsafe extern "C" fn(state: *mut ZL_SplitState, in_: *const ZL_Input) -> ZL_SplitInstructions,
3570>;
3571extern "C" {
3572 pub fn ZL_Compressor_registerSplitNode_withParser(
3573 cgraph: *mut ZL_Compressor,
3574 type_: ZL_Type,
3575 f: ZL_SplitParserFn,
3576 opaque: *const ::std::os::raw::c_void,
3577 ) -> ZL_NodeID;
3578}
3579extern "C" {
3580 #[doc = " Split-by-param\n This operation splits a serialized input\n into segments, defined by array @segmentSizes[].\n The nb of segments and their size is static,\n except for the last segment size, which can receive a size value `0`,\n meaning \"whatever is left in the stream\".\n Each segment is then into its own output,\n and then sent to the next processing stage defined by @successors[]."]
3581 pub fn ZL_Compressor_registerSplitGraph(
3582 cgraph: *mut ZL_Compressor,
3583 type_: ZL_Type,
3584 segmentSizes: *const usize,
3585 successors: *const ZL_GraphID,
3586 nbSegments: usize,
3587 ) -> ZL_GraphID;
3588}
3589extern "C" {
3590 #[doc = " Split-by-struct\n This operation splits a serialized input\n defined as an array of structures of fixed size,\n by grouping same fields into their own stream.\n All fields are considered concatenated back-to-back (no alignment).\n For this transform to work, input must be an exact multiple of struct_size,\n with struct_size = sum(field_sizes).\n Each output stream is then assigned a successor Graph."]
3591 pub fn ZL_Compressor_registerSplitByStructGraph(
3592 cgraph: *mut ZL_Compressor,
3593 fieldSizes: *const usize,
3594 successors: *const ZL_GraphID,
3595 nbFields: usize,
3596 ) -> ZL_GraphID;
3597}
3598extern "C" {
3599 #[doc = " Builds a tokenize node for the given parameters.\n\n Input: @p inputType\n Output 0: @p inputType - alphabet of unique values\n Output 1: numeric - indices into the alphabet for each value\n\n @param inputType The type of the input data. It can be either struct,\n numeric, or string.\n @param sort Whether or not to sort the alphabet. Struct types cannot be\n sorted. Numeric types are sorted in ascending order. String types are sorted\n in lexographical order.\n\n @returns The tokenize node, or an error."]
3600 pub fn ZL_Compressor_parameterizeTokenizeNode(
3601 compressor: *mut ZL_Compressor,
3602 inputType: ZL_Type,
3603 sort: bool,
3604 ) -> ZL_Result_ZL_NodeID;
3605}
3606extern "C" {
3607 #[doc = " Builds a tokenize graph for the given parameters & successors.\n\n @note If sorting the alphabet is not beneficial avoid it, as the sort will\n slow down compression.\n\n @param inputType The type of the input data. It can be either struct,\n numeric, or string.\n @param sort Whether or not to sort the alphabet. Struct types cannot be\n sorted. Numeric types are sorted in ascending order. String types are sorted\n in lexographical order.\n @param alphabetGraph The graph to pass the alphabet output to. It must accept\n an input of type @p inputType.\n @param indicesGraph The graph to pass the indices to. It must accept a\n numeric input.\n\n @returns The tokenize graph, or an error."]
3608 pub fn ZL_Compressor_buildTokenizeGraph(
3609 compressor: *mut ZL_Compressor,
3610 inputType: ZL_Type,
3611 sort: bool,
3612 alphabetGraph: ZL_GraphID,
3613 indicesGraph: ZL_GraphID,
3614 ) -> ZL_Result_ZL_GraphID;
3615}
3616extern "C" {
3617 #[doc = " @see ZL_Compressor_buildTokenizeGraph\n @returns The tokenize graph, or ZL_GRAPH_ILLEGAL on error."]
3618 pub fn ZL_Compressor_registerTokenizeGraph(
3619 compressor: *mut ZL_Compressor,
3620 inputType: ZL_Type,
3621 sort: bool,
3622 alphabetGraph: ZL_GraphID,
3623 indicesGraph: ZL_GraphID,
3624 ) -> ZL_GraphID;
3625}
3626#[repr(C)]
3627#[derive(Debug, Copy, Clone)]
3628pub struct ZL_CustomTokenizeState_s {
3629 _unused: [u8; 0],
3630}
3631pub type ZL_CustomTokenizeState = ZL_CustomTokenizeState_s;
3632extern "C" {
3633 #[doc = " @returns The opaque pointer passed into @fn ZS2_createGraph_customTokenize()."]
3634 pub fn ZL_CustomTokenizeState_getOpaquePtr(
3635 ctx: *const ZL_CustomTokenizeState,
3636 ) -> *const ::std::os::raw::c_void;
3637}
3638extern "C" {
3639 #[doc = " Creates the alphabet stream to store the tokenized alphabet. The width of\n each element in the alphabet must be the same width as the input stream.\n\n @param alphabetSize The exact size of the alphabet.\n\n @returns A pointer to write the alphabet into or NULL on error."]
3640 pub fn ZL_CustomTokenizeState_createAlphabetOutput(
3641 ctx: *mut ZL_CustomTokenizeState,
3642 alphabetSize: usize,
3643 ) -> *mut ::std::os::raw::c_void;
3644}
3645extern "C" {
3646 #[doc = " Creates the index stream with the given width. The index stream must contain\n exactly the same number of elements as the input.\n\n @param indexWidth The width of the index integer, either 1, 2, 4, or 8.\n\n @returns A pointer to write the indices into or NULL on error."]
3647 pub fn ZL_CustomTokenizeState_createIndexOutput(
3648 ctx: *mut ZL_CustomTokenizeState,
3649 indexWidth: usize,
3650 ) -> *mut ::std::os::raw::c_void;
3651}
3652#[doc = " A custom tokenization function to tokenize the input. The output of this\n function is not checked in production builds, and it is UB to tokenize\n incorrectly."]
3653pub type ZL_CustomTokenizeFn = ::std::option::Option<
3654 unsafe extern "C" fn(ctx: *mut ZL_CustomTokenizeState, input: *const ZL_Input) -> ZL_Report,
3655>;
3656extern "C" {
3657 #[doc = " Tokenize with a custom tokenization function. This is useful if you want to\n define a custom order for your alphabet that is neither insertion nor sorted\n order.\n\n WARNING: Zstrong does not manage the lifetime of the @p opaque pointer. It\n must outlive the @p cgraph or be NULL."]
3658 pub fn ZL_Compressor_registerCustomTokenizeGraph(
3659 cgraph: *mut ZL_Compressor,
3660 streamType: ZL_Type,
3661 customTokenizeFn: ZL_CustomTokenizeFn,
3662 opaque: *const ::std::os::raw::c_void,
3663 alphabetGraph: ZL_GraphID,
3664 indicesGraph: ZL_GraphID,
3665 ) -> ZL_GraphID;
3666}
3667extern "C" {
3668 #[doc = " Helper function to create a graph for ZL_NODE_TRANSPOSE_SPLIT.\n\n For frame format versions >= 11 ZL_NODE_TRANSPOSE_SPLIT is used and\n any eltWidth is supported.\n For frame format versions < 11 only eltWidth = 1, 2, 4, 8 is supported.\n Using other sizes will fail compression.\n\n Input: A fixed-size-field stream\n Output: eltWidth serialized streams of size nbElts\n Result: Convert a stream of N fields of size S into S streams of N fields by\n transposing the input stream.\n Example : 1 2 3 4 5 6 7 8 as 2 fields of size 4\n => transposed into 4 streams as 2 fields of size 1\n => (1, 5), (2, 6), (3, 7), (4, 8)"]
3669 pub fn ZL_Compressor_registerTransposeSplitGraph(
3670 cgraph: *mut ZL_Compressor,
3671 successor: ZL_GraphID,
3672 ) -> ZL_GraphID;
3673}
3674extern "C" {
3675 #[doc = " @returns a NodeID that implements transpose split for the given @p eltWidth\n that will work with any Zstrong format version. If no node exists, then\n returns ZL_NODE_ILLEGAL. This can happen for format version <= 10 when\n @p eltWidth != 2,4,8."]
3676 pub fn ZL_Graph_getTransposeSplitNode(gctx: *const ZL_Graph, eltWidth: usize) -> ZL_NodeID;
3677}
3678extern "C" {
3679 pub fn ZL_Edge_runTransposeSplit(
3680 edge: *mut ZL_Edge,
3681 graph: *const ZL_Graph,
3682 ) -> ZL_Result_ZL_EdgeList;
3683}
3684extern "C" {
3685 #[doc = " @return zstd graph with a compression level overridden"]
3686 pub fn ZL_Compressor_registerZstdGraph_withLevel(
3687 cgraph: *mut ZL_Compressor,
3688 compressionLevel: ::std::os::raw::c_int,
3689 ) -> ZL_GraphID;
3690}
3691extern "C" {
3692 #[doc = " @brief Create a new @ref ZL_Compressor.\n\n The @ref ZL_Compressor must be freed with @ref ZL_Compressor_free.\n\n @returns The @ref ZL_Compressor pointer or `NULL` on error."]
3693 pub fn ZL_Compressor_create() -> *mut ZL_Compressor;
3694}
3695extern "C" {
3696 #[doc = " @brief Frees a @ref ZL_Compressor.\n\n If @p compressor is `NULL` this function does nothing.\n\n @param compressor The @ref ZL_Compressor to free or `NULL`."]
3697 pub fn ZL_Compressor_free(compressor: *mut ZL_Compressor);
3698}
3699extern "C" {
3700 #[doc = " @returns A verbose error string containing context about the error that\n occurred. This is useful for debugging, and for submitting bug reports to\n OpenZL developers.\n @note This string is stored within the @p compressor and is only valid for\n the lifetime of the @p compressor."]
3701 pub fn ZL_Compressor_getErrorContextString(
3702 compressor: *const ZL_Compressor,
3703 report: ZL_Report,
3704 ) -> *const ::std::os::raw::c_char;
3705}
3706extern "C" {
3707 #[doc = " See @ref ZL_Compressor_getErrorContextString()\n\n The same as ZL_Compressor_getErrorContextString() except works on a @ref\n ZL_Error."]
3708 pub fn ZL_Compressor_getErrorContextString_fromError(
3709 compressor: *const ZL_Compressor,
3710 error: ZL_Error,
3711 ) -> *const ::std::os::raw::c_char;
3712}
3713extern "C" {
3714 #[doc = " @returns The array of warnings that were encountered during the creation\n of the compressor.\n @note The array's and the errors' lifetimes are valid until the next non-\n const call on the compressor."]
3715 pub fn ZL_Compressor_getWarnings(compressor: *const ZL_Compressor) -> ZL_Error_Array;
3716}
3717extern "C" {
3718 #[doc = " @brief Set global parameters via @p compressor. In this construction, global\n parameters are attached to a Compressor object. Global Parameters set at\n Compressor level can be overridden later at CCtx level.\n\n @returns Success or an error which can be checked with ZL_isError().\n @param gcparam The global parameter to set.\n @param value The value to set for the global parameter."]
3719 pub fn ZL_Compressor_setParameter(
3720 compressor: *mut ZL_Compressor,
3721 gcparam: ZL_CParam,
3722 value: ::std::os::raw::c_int,
3723 ) -> ZL_Report;
3724}
3725extern "C" {
3726 #[doc = " @brief Read a parameter's configured value in the Compressor and returns it.\n\n @returns Returns the value of the parameter if it is set, or 0 if unset.\n @param gcparam The global parameter to read."]
3727 pub fn ZL_Compressor_getParameter(
3728 compressor: *const ZL_Compressor,
3729 gcparam: ZL_CParam,
3730 ) -> ::std::os::raw::c_int;
3731}
3732#[doc = " @defgroup Group_Compressor_StaticGraphCreation Static Graph Creation\n\n There are two types of graphs in OpenZL: static graphs and dynamic graphs.\n Static graphs take a single input, pass that input to a codec, and the\n outputs of that codec are sent to the successor graphs. Dynamic graphs are\n graphs that inspect the input at runtime to make different decisions. These\n are either function graphs or selectors.\n\n This API allows the construction of static graphs. The head node and the\n successor graphs must be specified. Additionally, a name can be provided for\n the graph, which can aid in debugging. Finally, the graph can be\n parameterized, which sends the local parameters to the head node.\n\n The main function is @ref ZL_Compressor_buildStaticGraph. The other functions\n are older variants that will eventually be removed.\n @{"]
3733#[repr(C)]
3734#[derive(Debug, Copy, Clone)]
3735pub struct ZL_StaticGraphParameters {
3736 #[doc = " Optionally a name for the graph for debugging.\n If NULL, then the static graph will not have a name."]
3737 pub name: *const ::std::os::raw::c_char,
3738 #[doc = " Optionally local parameters to pass to the head node.\n If NULL, then the head node's local parameters will not be overridden."]
3739 pub localParams: *const ZL_LocalParams,
3740}
3741#[test]
3742fn bindgen_test_layout_ZL_StaticGraphParameters() {
3743 const UNINIT: ::std::mem::MaybeUninit<ZL_StaticGraphParameters> =
3744 ::std::mem::MaybeUninit::uninit();
3745 let ptr = UNINIT.as_ptr();
3746 assert_eq!(
3747 ::std::mem::size_of::<ZL_StaticGraphParameters>(),
3748 16usize,
3749 "Size of ZL_StaticGraphParameters"
3750 );
3751 assert_eq!(
3752 ::std::mem::align_of::<ZL_StaticGraphParameters>(),
3753 8usize,
3754 "Alignment of ZL_StaticGraphParameters"
3755 );
3756 assert_eq!(
3757 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
3758 0usize,
3759 "Offset of field: ZL_StaticGraphParameters::name"
3760 );
3761 assert_eq!(
3762 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
3763 8usize,
3764 "Offset of field: ZL_StaticGraphParameters::localParams"
3765 );
3766}
3767extern "C" {
3768 #[doc = " Build a new graph out of pre-existing components. The new graph passes its\n data to @p headNode, and then each output of @p headNode is set to the\n corresponding @p successorGraph.\n\n @param headNode Pass the input data to this node\n @param successorGraphs Pass the outputs of @p headNode to these graphs\n @param numSuccessorGraphs Number of successor graphs\n @param params Optionally extra parameters for the static graph, or NULL.\n\n @returns Thew new graph ID, or an error."]
3769 pub fn ZL_Compressor_buildStaticGraph(
3770 compressor: *mut ZL_Compressor,
3771 headNode: ZL_NodeID,
3772 successorGraphs: *const ZL_GraphID,
3773 numSuccessorGraphs: usize,
3774 params: *const ZL_StaticGraphParameters,
3775 ) -> ZL_Result_ZL_GraphID;
3776}
3777extern "C" {
3778 #[doc = " @brief Create a graph from a single input & output node.\n\n Simplified variant of @ref ZL_Compressor_registerStaticGraph_fromNode that\n only works for nodes that have one input and one output. Creates a new graph\n headed by\n @p headNode, whose output gets sent to @p dstGraph.\n\n @returns The newly created graph or `ZL_GRAPH_ILLEGAL` on error.\n The user may check for errors using ZL_GraphID_isValid().\n\n @param headNode The node executed first in the newly created graph.\n @param dstGraph The graph that will receive the output of @p headNode."]
3779 pub fn ZL_Compressor_registerStaticGraph_fromNode1o(
3780 compressor: *mut ZL_Compressor,
3781 headNode: ZL_NodeID,
3782 dstGraph: ZL_GraphID,
3783 ) -> ZL_GraphID;
3784}
3785extern "C" {
3786 #[doc = " @brief Creates a graph consisting of a series of nodes executed in succession\n in the order provided and then sent to @p dstGraph.\n\n @returns The newly created graph or `ZL_GRAPH_ILLEGAL` on error.\n The user may check for errors using ZL_GraphID_isValid().\n\n @param nodes The nodes to execute in the newly created graph.\n @param nbNodes The number of nodes in @p nodes.\n @param dstGraph The graph that will receive the output of the last node in @p\n nodes."]
3787 pub fn ZL_Compressor_registerStaticGraph_fromPipelineNodes1o(
3788 compressor: *mut ZL_Compressor,
3789 nodes: *const ZL_NodeID,
3790 nbNodes: usize,
3791 dstGraph: ZL_GraphID,
3792 ) -> ZL_GraphID;
3793}
3794extern "C" {
3795 #[doc = " @brief Create a graph from a head node.\n\n Creates a new graph headed by @p headNode, which produces\n @p nbDstGraphs outcomes. Each outcome of @p headNode gets sent\n to the corresponding graph in @p dstGraphs.\n\n @param headNode The head node in the newly created graph.\n @param dstGraphs Array of graphs of size @p nbDstGraphs.\n @param nbDstGraphs Must be equal to the number of outputs of @p headNode.\n\n @returns The newly created graph or `ZL_GRAPH_ILLEGAL` on error.\n The user may check for errors using ZL_GraphID_isValid().\n\n @note Successor dstGraphs can only be employed in single-input mode.\n Multi-input Graphs can only be invoked from a function graph."]
3796 pub fn ZL_Compressor_registerStaticGraph_fromNode(
3797 compressor: *mut ZL_Compressor,
3798 headNode: ZL_NodeID,
3799 dstGraphs: *const ZL_GraphID,
3800 nbDstGraphs: usize,
3801 ) -> ZL_GraphID;
3802}
3803#[repr(C)]
3804#[derive(Debug, Copy, Clone)]
3805pub struct ZL_StaticGraphDesc {
3806 pub name: *const ::std::os::raw::c_char,
3807 pub headNodeid: ZL_NodeID,
3808 pub successor_gids: *const ZL_GraphID,
3809 pub nbGids: usize,
3810 pub localParams: *const ZL_LocalParams,
3811}
3812#[test]
3813fn bindgen_test_layout_ZL_StaticGraphDesc() {
3814 const UNINIT: ::std::mem::MaybeUninit<ZL_StaticGraphDesc> = ::std::mem::MaybeUninit::uninit();
3815 let ptr = UNINIT.as_ptr();
3816 assert_eq!(
3817 ::std::mem::size_of::<ZL_StaticGraphDesc>(),
3818 40usize,
3819 "Size of ZL_StaticGraphDesc"
3820 );
3821 assert_eq!(
3822 ::std::mem::align_of::<ZL_StaticGraphDesc>(),
3823 8usize,
3824 "Alignment of ZL_StaticGraphDesc"
3825 );
3826 assert_eq!(
3827 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
3828 0usize,
3829 "Offset of field: ZL_StaticGraphDesc::name"
3830 );
3831 assert_eq!(
3832 unsafe { ::std::ptr::addr_of!((*ptr).headNodeid) as usize - ptr as usize },
3833 8usize,
3834 "Offset of field: ZL_StaticGraphDesc::headNodeid"
3835 );
3836 assert_eq!(
3837 unsafe { ::std::ptr::addr_of!((*ptr).successor_gids) as usize - ptr as usize },
3838 16usize,
3839 "Offset of field: ZL_StaticGraphDesc::successor_gids"
3840 );
3841 assert_eq!(
3842 unsafe { ::std::ptr::addr_of!((*ptr).nbGids) as usize - ptr as usize },
3843 24usize,
3844 "Offset of field: ZL_StaticGraphDesc::nbGids"
3845 );
3846 assert_eq!(
3847 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
3848 32usize,
3849 "Offset of field: ZL_StaticGraphDesc::localParams"
3850 );
3851}
3852extern "C" {
3853 #[doc = " This is the more complete declaration variant, offering more control and\n capabilities.\n In order to be valid, a Static Graph Description must :\n - provide exactly as many successors as nb of outcomes defined by head Node\n - only employ single-input Graphs as successors\n - match each outcome type with a successor using a compatible input type\n - optionally, can specify @localParams for a Static Graph. In this case,\n these parameters are forwarded to the Head Node, replacing any previous\n local parameter that may have been already set on the Head Node.\n\n If a declaration is invalid, it results in an invalid GraphID, which can be\n tested using ZL_GraphID_isValid() on the return value.\n Note: ZL_GraphID_isValid() is currently defined in zs2_graph_api.h."]
3854 pub fn ZL_Compressor_registerStaticGraph(
3855 compressor: *mut ZL_Compressor,
3856 sgDesc: *const ZL_StaticGraphDesc,
3857 ) -> ZL_GraphID;
3858}
3859#[doc = " @defgroup Group_Compressor_NodeCustomization Node Customization\n\n Nodes can be customized to override their name and local parameters.\n This is an advanced use case, and mainly an implementation detail of nodes.\n Most nodes that accept parameters provide helper functions to correctly\n parameterize the node.\n\n @{"]
3860#[repr(C)]
3861#[derive(Debug, Copy, Clone)]
3862pub struct ZL_NodeParameters {
3863 #[doc = " Optionally a new name, if NULL it is derived from the node's name"]
3864 pub name: *const ::std::os::raw::c_char,
3865 #[doc = " Optionally the new local params, if NULL then the parameters are not\n updated."]
3866 pub localParams: *const ZL_LocalParams,
3867 #[doc = " Optionally, a new dict ID. If set to ZL_DICT_ID_NULL, then the dict ID\n is not updated."]
3868 pub dictID: ZL_DictID,
3869 #[doc = " Optionally, a new MParam."]
3870 pub mparam: ZL_MParam,
3871}
3872#[test]
3873fn bindgen_test_layout_ZL_NodeParameters() {
3874 const UNINIT: ::std::mem::MaybeUninit<ZL_NodeParameters> = ::std::mem::MaybeUninit::uninit();
3875 let ptr = UNINIT.as_ptr();
3876 assert_eq!(
3877 ::std::mem::size_of::<ZL_NodeParameters>(),
3878 96usize,
3879 "Size of ZL_NodeParameters"
3880 );
3881 assert_eq!(
3882 ::std::mem::align_of::<ZL_NodeParameters>(),
3883 8usize,
3884 "Alignment of ZL_NodeParameters"
3885 );
3886 assert_eq!(
3887 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
3888 0usize,
3889 "Offset of field: ZL_NodeParameters::name"
3890 );
3891 assert_eq!(
3892 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
3893 8usize,
3894 "Offset of field: ZL_NodeParameters::localParams"
3895 );
3896 assert_eq!(
3897 unsafe { ::std::ptr::addr_of!((*ptr).dictID) as usize - ptr as usize },
3898 16usize,
3899 "Offset of field: ZL_NodeParameters::dictID"
3900 );
3901 assert_eq!(
3902 unsafe { ::std::ptr::addr_of!((*ptr).mparam) as usize - ptr as usize },
3903 48usize,
3904 "Offset of field: ZL_NodeParameters::mparam"
3905 );
3906}
3907extern "C" {
3908 #[doc = " Parameterize an existing node by overriding its name and/or local parameters.\n\n @param node The node to parameterize.\n @param params The new parameters, which must be non-null.\n\n @returns The new node ID on success, or an error."]
3909 pub fn ZL_Compressor_parameterizeNode(
3910 compressor: *mut ZL_Compressor,
3911 node: ZL_NodeID,
3912 params: *const ZL_NodeParameters,
3913 ) -> ZL_Result_ZL_NodeID;
3914}
3915#[repr(C)]
3916#[derive(Debug, Copy, Clone)]
3917pub struct ZL_ParameterizedNodeDesc {
3918 #[doc = " Optionally a new name, if NULL it is derived from the node's name"]
3919 pub name: *const ::std::os::raw::c_char,
3920 #[doc = " Node to parameterize"]
3921 pub node: ZL_NodeID,
3922 #[doc = " Optionally the new local params, if NULL then the parameters are not\n updated."]
3923 pub localParams: *const ZL_LocalParams,
3924 #[doc = " Optionally, a new dict ID. If set to ZL_DICT_ID_NULL, then the dict ID\n is not updated."]
3925 pub dictID: ZL_DictID,
3926 #[doc = " Optionally, a new MParam."]
3927 pub mparam: ZL_MParam,
3928}
3929#[test]
3930fn bindgen_test_layout_ZL_ParameterizedNodeDesc() {
3931 const UNINIT: ::std::mem::MaybeUninit<ZL_ParameterizedNodeDesc> =
3932 ::std::mem::MaybeUninit::uninit();
3933 let ptr = UNINIT.as_ptr();
3934 assert_eq!(
3935 ::std::mem::size_of::<ZL_ParameterizedNodeDesc>(),
3936 104usize,
3937 "Size of ZL_ParameterizedNodeDesc"
3938 );
3939 assert_eq!(
3940 ::std::mem::align_of::<ZL_ParameterizedNodeDesc>(),
3941 8usize,
3942 "Alignment of ZL_ParameterizedNodeDesc"
3943 );
3944 assert_eq!(
3945 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
3946 0usize,
3947 "Offset of field: ZL_ParameterizedNodeDesc::name"
3948 );
3949 assert_eq!(
3950 unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
3951 8usize,
3952 "Offset of field: ZL_ParameterizedNodeDesc::node"
3953 );
3954 assert_eq!(
3955 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
3956 16usize,
3957 "Offset of field: ZL_ParameterizedNodeDesc::localParams"
3958 );
3959 assert_eq!(
3960 unsafe { ::std::ptr::addr_of!((*ptr).dictID) as usize - ptr as usize },
3961 24usize,
3962 "Offset of field: ZL_ParameterizedNodeDesc::dictID"
3963 );
3964 assert_eq!(
3965 unsafe { ::std::ptr::addr_of!((*ptr).mparam) as usize - ptr as usize },
3966 56usize,
3967 "Offset of field: ZL_ParameterizedNodeDesc::mparam"
3968 );
3969}
3970extern "C" {
3971 #[doc = " @brief Clone an existing @ref ZL_NodeID from an existing node, but\n optionally with a new name & new parameters.\n\n @param desc The parameterization options.\n\n @returns The new node id of the cloned node."]
3972 pub fn ZL_Compressor_registerParameterizedNode(
3973 compressor: *mut ZL_Compressor,
3974 desc: *const ZL_ParameterizedNodeDesc,
3975 ) -> ZL_NodeID;
3976}
3977#[doc = " @defgroup Group_Compressor_GraphCustomization Graph Customization\n\n Graphs can be customized to override their name, local parameters, custom\n nodes and custom graphs. This is an advanced use case, and mainly an\n implementation detail of graphs. Most graphs which accept parameters provide\n helper functions to correctly parameterize the graph.\n\n @{"]
3978#[repr(C)]
3979#[derive(Debug, Copy, Clone)]
3980pub struct ZL_GraphParameters_s {
3981 #[doc = " Optional, for debug traces, otherwise it is derived from graph's name."]
3982 pub name: *const ::std::os::raw::c_char,
3983 #[doc = " Empty means don't override"]
3984 pub customGraphs: *const ZL_GraphID,
3985 pub nbCustomGraphs: usize,
3986 #[doc = " Empty means don't override"]
3987 pub customNodes: *const ZL_NodeID,
3988 pub nbCustomNodes: usize,
3989 #[doc = " NULL means don't override"]
3990 pub localParams: *const ZL_LocalParams,
3991}
3992#[test]
3993fn bindgen_test_layout_ZL_GraphParameters_s() {
3994 const UNINIT: ::std::mem::MaybeUninit<ZL_GraphParameters_s> = ::std::mem::MaybeUninit::uninit();
3995 let ptr = UNINIT.as_ptr();
3996 assert_eq!(
3997 ::std::mem::size_of::<ZL_GraphParameters_s>(),
3998 48usize,
3999 "Size of ZL_GraphParameters_s"
4000 );
4001 assert_eq!(
4002 ::std::mem::align_of::<ZL_GraphParameters_s>(),
4003 8usize,
4004 "Alignment of ZL_GraphParameters_s"
4005 );
4006 assert_eq!(
4007 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
4008 0usize,
4009 "Offset of field: ZL_GraphParameters_s::name"
4010 );
4011 assert_eq!(
4012 unsafe { ::std::ptr::addr_of!((*ptr).customGraphs) as usize - ptr as usize },
4013 8usize,
4014 "Offset of field: ZL_GraphParameters_s::customGraphs"
4015 );
4016 assert_eq!(
4017 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomGraphs) as usize - ptr as usize },
4018 16usize,
4019 "Offset of field: ZL_GraphParameters_s::nbCustomGraphs"
4020 );
4021 assert_eq!(
4022 unsafe { ::std::ptr::addr_of!((*ptr).customNodes) as usize - ptr as usize },
4023 24usize,
4024 "Offset of field: ZL_GraphParameters_s::customNodes"
4025 );
4026 assert_eq!(
4027 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomNodes) as usize - ptr as usize },
4028 32usize,
4029 "Offset of field: ZL_GraphParameters_s::nbCustomNodes"
4030 );
4031 assert_eq!(
4032 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
4033 40usize,
4034 "Offset of field: ZL_GraphParameters_s::localParams"
4035 );
4036}
4037#[doc = " @defgroup Group_Compressor_GraphCustomization Graph Customization\n\n Graphs can be customized to override their name, local parameters, custom\n nodes and custom graphs. This is an advanced use case, and mainly an\n implementation detail of graphs. Most graphs which accept parameters provide\n helper functions to correctly parameterize the graph.\n\n @{"]
4038pub type ZL_GraphParameters = ZL_GraphParameters_s;
4039extern "C" {
4040 #[doc = " Parameterizes an existing graph by overriding its name, customGraphs,\n customNodes, and/or localParams.\n\n @param graph The graph to parameterize.\n @param params The new parameters, which must be non-null.\n\n @returns The new graph ID on success, or an error."]
4041 pub fn ZL_Compressor_parameterizeGraph(
4042 compressor: *mut ZL_Compressor,
4043 graph: ZL_GraphID,
4044 params: *const ZL_GraphParameters,
4045 ) -> ZL_Result_ZL_GraphID;
4046}
4047#[doc = " This creates a new Graphs, based on an existing Graph,\n but modifying all or parts of its exposed parameters."]
4048#[repr(C)]
4049#[derive(Debug, Copy, Clone)]
4050pub struct ZL_ParameterizedGraphDesc {
4051 #[doc = " Optionally a new name, otherwise it is derived from `graph`'s name."]
4052 pub name: *const ::std::os::raw::c_char,
4053 pub graph: ZL_GraphID,
4054 #[doc = " Empty means don't override"]
4055 pub customGraphs: *const ZL_GraphID,
4056 pub nbCustomGraphs: usize,
4057 #[doc = " Empty means don't override"]
4058 pub customNodes: *const ZL_NodeID,
4059 pub nbCustomNodes: usize,
4060 #[doc = " NULL means don't override"]
4061 pub localParams: *const ZL_LocalParams,
4062}
4063#[test]
4064fn bindgen_test_layout_ZL_ParameterizedGraphDesc() {
4065 const UNINIT: ::std::mem::MaybeUninit<ZL_ParameterizedGraphDesc> =
4066 ::std::mem::MaybeUninit::uninit();
4067 let ptr = UNINIT.as_ptr();
4068 assert_eq!(
4069 ::std::mem::size_of::<ZL_ParameterizedGraphDesc>(),
4070 56usize,
4071 "Size of ZL_ParameterizedGraphDesc"
4072 );
4073 assert_eq!(
4074 ::std::mem::align_of::<ZL_ParameterizedGraphDesc>(),
4075 8usize,
4076 "Alignment of ZL_ParameterizedGraphDesc"
4077 );
4078 assert_eq!(
4079 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
4080 0usize,
4081 "Offset of field: ZL_ParameterizedGraphDesc::name"
4082 );
4083 assert_eq!(
4084 unsafe { ::std::ptr::addr_of!((*ptr).graph) as usize - ptr as usize },
4085 8usize,
4086 "Offset of field: ZL_ParameterizedGraphDesc::graph"
4087 );
4088 assert_eq!(
4089 unsafe { ::std::ptr::addr_of!((*ptr).customGraphs) as usize - ptr as usize },
4090 16usize,
4091 "Offset of field: ZL_ParameterizedGraphDesc::customGraphs"
4092 );
4093 assert_eq!(
4094 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomGraphs) as usize - ptr as usize },
4095 24usize,
4096 "Offset of field: ZL_ParameterizedGraphDesc::nbCustomGraphs"
4097 );
4098 assert_eq!(
4099 unsafe { ::std::ptr::addr_of!((*ptr).customNodes) as usize - ptr as usize },
4100 32usize,
4101 "Offset of field: ZL_ParameterizedGraphDesc::customNodes"
4102 );
4103 assert_eq!(
4104 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomNodes) as usize - ptr as usize },
4105 40usize,
4106 "Offset of field: ZL_ParameterizedGraphDesc::nbCustomNodes"
4107 );
4108 assert_eq!(
4109 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
4110 48usize,
4111 "Offset of field: ZL_ParameterizedGraphDesc::localParams"
4112 );
4113}
4114extern "C" {
4115 #[doc = " @brief Create a new GraphID by the one from @p gid,\n just replacing the @p localParams by the provided ones. Used to create\n custom variants of Standard Graphs for example.\n\n @note the original @gid still exists and remains accessible.\n @note @localParams==NULL means \"do not change the parameters\",\n in which case, this function simply returns @gid.\n\n @return The GraphID of the newly created graph, or ZL_GRAPH_ILLEGAL on\n error.\n\n @param gid The GraphID to clone.\n @param localParams The local parameters to use inside the graph."]
4116 pub fn ZL_Compressor_registerParameterizedGraph(
4117 compressor: *mut ZL_Compressor,
4118 desc: *const ZL_ParameterizedGraphDesc,
4119 ) -> ZL_GraphID;
4120}
4121extern "C" {
4122 #[doc = " @brief Lookup a node by name.\n\n Looks up a node with the given name and returns it. Anchor nodes (nodes whose\n name starts with '!') can be looked up by name, excluding the leading '!'.\n Standard nodes can also be looked up by name. Non-anchor nodes are assigned a\n unique name by suffixing them with `#${unique}`. They can be looked up if you\n know the unique name.\n\n @returns The node if it exists, or ZL_NODE_ILLEGAL."]
4123 pub fn ZL_Compressor_getNode(
4124 compressor: *const ZL_Compressor,
4125 name: *const ::std::os::raw::c_char,
4126 ) -> ZL_NodeID;
4127}
4128extern "C" {
4129 #[doc = " @brief Lookup a graph by name.\n\n Looks up a graph with the given name and returns it. Anchor graphs (graphs\n whose name starts with '!') can be looked up by name, excluding the leading\n '!'. Standard graphs can also be looked up by name. Non-anchor graphs are\n assigned a unique name by suffixing them with `#${unique}`. They can be\n looked up if you know the unique name.\n\n @returns The graph if it exists, or ZL_GRAPH_ILLEGAL."]
4130 pub fn ZL_Compressor_getGraph(
4131 compressor: *const ZL_Compressor,
4132 graph: *const ::std::os::raw::c_char,
4133 ) -> ZL_GraphID;
4134}
4135extern "C" {
4136 #[doc = " @brief Selects a graph as the default entry point for the compressor.\n\n By default, a compressor's entry point is its most recently registered graph.\n This function allows explicit selection of a different graph as the default\n entry point for subsequent compression operations.\n\n @param compressor The compressor instance to configure. Must not be NULL.\n @param graph The graph ID to set as the default entry point. Must be a valid\n graph ID that has been registered with this compressor.\n @returns ZL_Report indicating success or failure. Use ZL_isError() to check\n for errors.\n\n @note The compressor can still be used as a collection of multiple entry\n points. Alternative entry points can be selected at runtime using\n ZL_CCtx_selectStartingGraphID().\n @note This operation automatically validates the compressor by calling\n ZL_Compressor_validate() internally.\n\n See ZL_CCtx_selectStartingGraphID() for runtime entry point selection"]
4137 pub fn ZL_Compressor_selectStartingGraphID(
4138 compressor: *mut ZL_Compressor,
4139 graph: ZL_GraphID,
4140 ) -> ZL_Report;
4141}
4142extern "C" {
4143 #[doc = " @brief Validates a graph maintains basic invariants to reduce the chance of\n errors being triggered when compressing.\n\n @note this operation is also integrated as part of\n ZL_Compressor_selectStartingGraphID(). This function is kept for backward\n compatibility.\n\n @returns Success if graph is valid, error otherwise.\n @param starting_graph The starting graph to validate."]
4144 pub fn ZL_Compressor_validate(
4145 compressor: *mut ZL_Compressor,
4146 starting_graph: ZL_GraphID,
4147 ) -> ZL_Report;
4148}
4149extern "C" {
4150 #[doc = " @brief Pass @p compressor as a `ZL_Compressor*` object to the compression\n state. Compression will start with the default Starting GraphID of @p\n compressor, using its default parameters provided at registration time.\n @note Only one compressor can be referenced at a time.\n Referencing a new compressor deletes previous reference.\n @note If a custom GraphID and parameters were previously set,\n invoking this method will reset them to default.\n @pre @p compressor must remain valid for the duration of its usage.\n @pre @p compressor must be already validated."]
4151 pub fn ZL_CCtx_refCompressor(cctx: *mut ZL_CCtx, compressor: *const ZL_Compressor)
4152 -> ZL_Report;
4153}
4154extern "C" {
4155 #[doc = " @brief Set the starting Graph of next compression,\n as @p graphID referenced in the provided @p compressor,\n optionally providing it with some runtime parameters.\n @pre @p compressor must remain valid for the duration of its usage.\n @pre @p compressor must be already validated.\n\n @param cctx The active compression state\n @param compressor The reference compressor containing graph definitions.\n If NULL, it uses the currently registered compressor.\n @param graphID The ID of the starting graph.\n @param rgp Optional parameters to apply to the starting graph.\n NULL means don't override.\n\n Note: like all global parameters, these parameters are reset at end of\n compression."]
4156 pub fn ZL_CCtx_selectStartingGraphID(
4157 cctx: *mut ZL_CCtx,
4158 compressor: *const ZL_Compressor,
4159 graphID: ZL_GraphID,
4160 rgp: *const ZL_GraphParameters,
4161 ) -> ZL_Report;
4162}
4163#[doc = " @brief While it's possible to add elements (graphs, selectors or nodes) to a\n Compressor one by one, and then finalize it by selecting a starting graph ID,\n it's generally common for all these steps to be regrouped into a single\n initialization function.\n The following signature corresponds such a function.\n It returns a GraphID which, by convention, is the starting GraphID."]
4164pub type ZL_GraphFn =
4165 ::std::option::Option<unsafe extern "C" fn(compressor: *mut ZL_Compressor) -> ZL_GraphID>;
4166extern "C" {
4167 #[doc = " @brief Initialize a @p compressor object with a `ZL_GraphFn` Graph function\n @p f. It will register a few custom graphs and custom nodes, and set the\n starting Graph ID. This is a convenience function, which is equivalent to\n calling the Graph function, then ZL_Compressor_selectStartingGraphID()\n followed by ZL_Compressor_validate()\n @returns Success or an error which can be checked with ZL_isError().\n @param f The function used to build the `ZL_GraphID`."]
4168 pub fn ZL_Compressor_initUsingGraphFn(
4169 compressor: *mut ZL_Compressor,
4170 f: ZL_GraphFn,
4171 ) -> ZL_Report;
4172}
4173extern "C" {
4174 pub fn ZL_compress_usingCompressor(
4175 dst: *mut ::std::os::raw::c_void,
4176 dstCapacity: usize,
4177 src: *const ::std::os::raw::c_void,
4178 srcSize: usize,
4179 compressor: *const ZL_Compressor,
4180 ) -> ZL_Report;
4181}
4182extern "C" {
4183 #[doc = " @brief compresses using @param graphFunction that both defines a custom graph\n and sets global parameters."]
4184 pub fn ZL_compress_usingGraphFn(
4185 dst: *mut ::std::os::raw::c_void,
4186 dstCapacity: usize,
4187 src: *const ::std::os::raw::c_void,
4188 srcSize: usize,
4189 graphFunction: ZL_GraphFn,
4190 ) -> ZL_Report;
4191}
4192extern "C" {
4193 #[doc = " Fetches the bundle ID in-use by the compressor, if there is one.\n Returns NULL if no bundle has been set."]
4194 pub fn ZL_Compressor_getDictBundleID(compressor: *const ZL_Compressor) -> *const ZL_BundleID;
4195}
4196extern "C" {
4197 #[doc = " This is a convenience implementation to provide a serialized ZL_DictBundle\n and associated serialized ZL_Dict to the compressor.\n\n This function expects an all-in-one \"fat\" bundle generated by the training\n scripts. This can be produced some other way, but training is guaranteed to\n generate a valid fat bundle if provided the option --fat-bundle."]
4198 pub fn ZL_Compressor_loadDictBundle(
4199 compressor: *mut ZL_Compressor,
4200 serializedDictBundle: *const ::std::os::raw::c_void,
4201 serializedDictBundleSize: usize,
4202 ) -> ZL_Report;
4203}
4204extern "C" {
4205 #[doc = " Creates and initializes an opaque `ZL_CompressorSerializer` object.\n\n Currently, this object can only be used for a single call to @ref\n ZL_CompressorSerializer_serialize(). You need to create a new serializer\n for every serialization you want to do.\n\n This will likely be improved in the future; it shouldn't be too hard to do.\n\n @returns the created `ZL_CompressorSerializer` if successful. Otherwise,\n returns `NULL`."]
4206 pub fn ZL_CompressorSerializer_create() -> *mut ZL_CompressorSerializer;
4207}
4208extern "C" {
4209 #[doc = " Frees all the resources owned by the @p serializer, including the @p\n serializer itself."]
4210 pub fn ZL_CompressorSerializer_free(serializer: *mut ZL_CompressorSerializer);
4211}
4212extern "C" {
4213 #[doc = " Returns a serialized representation of the given @p compressor.\n\n See the documentation above for a description of how compressors must be\n structured to be compressible.\n\n This function uses @p dst and @dstSize both as (1) input arguments that\n optionally indicate an existing buffer into which the output of the\n serialization process can be placed as well as (2) output arguments\n indicating where the output actually was placed.\n\n When @p dst points to a `void*` variable with a non-`NULL` initial value,\n and @p dstSize points to a `size_t` variable with a non-zero initial value,\n this function will attempt to write the serialized output into the buffer\n pointed to by `*dst` with capacity `*dstSize`. If the output fits in that\n provided buffer, then `*dst` will be left unchanged, and `*dstSize` will be\n updated to reflect the written size of the output.\n\n Otherwise, either because the output doesn't fit in the provided buffer or\n because no buffer was provided (`*dst` is `NULL` or `*dstSize == 0`), an\n output buffer of sufficient size to hold the output is allocated. `*dst` is\n set to point to the start of that buffer and `*dstSize` is set to the size\n of the output. That buffer is owned by @p serializer and will be freed when\n the @p serializer is destroyed.\n\n @param[in out] dst Pointer to a variable pointing to the output buffer,\n which can start out either pointing to an existing\n output buffer or `NULL`. That variable will be set to\n point to the output buffer actually used.\n @param[in out] dstSize Pointer to a variable that should be initialized to\n the capacity of the output buffer, if one is being\n provided, or 0 otherwise. That variable will be set\n to contain the written size of the output.\n\n @returns success or an error."]
4214 pub fn ZL_CompressorSerializer_serialize(
4215 serializer: *mut ZL_CompressorSerializer,
4216 compressor: *const ZL_Compressor,
4217 dst: *mut *mut ::std::os::raw::c_void,
4218 dstSize: *mut usize,
4219 ) -> ZL_Report;
4220}
4221extern "C" {
4222 #[doc = " Equivalent @ref ZL_CompressorSerializer_serialize, but produces a human-\n readable output for debugging. This output format cannot currently be\n consumed by OpenZL.\n\n The output is null-terminated."]
4223 pub fn ZL_CompressorSerializer_serializeToJson(
4224 serializer: *mut ZL_CompressorSerializer,
4225 compressor: *const ZL_Compressor,
4226 dst: *mut *mut ::std::os::raw::c_void,
4227 dstSize: *mut usize,
4228 ) -> ZL_Report;
4229}
4230extern "C" {
4231 #[doc = " Converts an already-serialized compressor to human-readable JSON.\n\n The output is null-terminated.\n\n The semantics of @p dst and @p dstSize are as described with @ref\n ZL_CompressorSerializer_serialize."]
4232 pub fn ZL_CompressorSerializer_convertToJson(
4233 serializer: *mut ZL_CompressorSerializer,
4234 dst: *mut *mut ::std::os::raw::c_void,
4235 dstSize: *mut usize,
4236 src: *const ::std::os::raw::c_void,
4237 srcSize: usize,
4238 ) -> ZL_Report;
4239}
4240extern "C" {
4241 #[doc = " Safely retrieve the full error message associated with an error.\n\n @returns the verbose error message associated with the @p result or `NULL`\n if the error is no longer valid.\n\n @note This string is stored within the @p serializer and is only valid for\n the lifetime of the @p serializer."]
4242 pub fn ZL_CompressorSerializer_getErrorContextString(
4243 serializer: *const ZL_CompressorSerializer,
4244 result: ZL_Report,
4245 ) -> *const ::std::os::raw::c_char;
4246}
4247extern "C" {
4248 #[doc = " Like @ref ZL_CompressorSerializer_getErrorContextString(), but generic\n across result types. Use like:\n\n ```\n ZL_RESULT_OF(Something) result = ...;\n const char* msg = ZL_CompressorSerializer_getErrorContextString_fromError(\n serializer, ZL_RES_error(result));\n ```\n\n @returns the verbose error message associated with the @p error or `NULL`\n if the error is no longer valid.\n\n @note This string is stored within the @p serializer and is only valid for\n the lifetime of the @p serializer."]
4249 pub fn ZL_CompressorSerializer_getErrorContextString_fromError(
4250 deserializer: *const ZL_CompressorSerializer,
4251 error: ZL_Error,
4252 ) -> *const ::std::os::raw::c_char;
4253}
4254extern "C" {
4255 #[doc = " Creates and initializes an opaque `ZL_CompressorDeserializer` object.\n\n Currently, this object can only be used for a single call to @ref\n ZL_CompressorDeserializer_deserialize(). You need to create a new\n deserializer for every deserialization you want to do.\n\n This will likely be improved in the future; it shouldn't be too hard to do.\n\n @returns the created `ZL_CompressorDeserializer` if successful. Otherwise,\n returns `NULL`."]
4256 pub fn ZL_CompressorDeserializer_create() -> *mut ZL_CompressorDeserializer;
4257}
4258extern "C" {
4259 #[doc = " Frees all the resources owned by the @p deserializer, including the @p\n deserializer itself."]
4260 pub fn ZL_CompressorDeserializer_free(deserializer: *mut ZL_CompressorDeserializer);
4261}
4262extern "C" {
4263 #[doc = " Reads the serialized compressor represented by @p serialized and pushes\n the graph structure and configuration it describes into @p compressor.\n\n In order for materialization to succeed, the @p compressor must already have\n all of the custom transforms, graph functions, selectors, etc. registered\n that were available when the compressor was serialized. You can use @ref\n ZL_CompressorDeserializer_getDependencies() to determine what non-serialized\n graph components are needed on the destination compressor. You can then set\n those components up before invoking this operation on that compressor.\n\n See the documentation above for a more thorough discussion of these\n requirements and how best to structure a compressor to meet them.\n\n If this operation fails, the compressor may be left in an indeterminate\n state. The best thing to do is to just throw this compressor away\n (via @ref ZL_Compressor_free) and not to try to re-use it."]
4264 pub fn ZL_CompressorDeserializer_deserialize(
4265 deserializer: *mut ZL_CompressorDeserializer,
4266 compressor: *mut ZL_Compressor,
4267 serialized: *const ::std::os::raw::c_void,
4268 serializedSize: usize,
4269 ) -> ZL_Report;
4270}
4271#[doc = " Doesn't own any memory."]
4272#[repr(C)]
4273#[derive(Debug, Copy, Clone)]
4274pub struct ZL_CompressorDeserializer_Dependencies {
4275 pub graph_names: *const *const ::std::os::raw::c_char,
4276 pub num_graphs: usize,
4277 pub node_names: *const *const ::std::os::raw::c_char,
4278 pub num_nodes: usize,
4279}
4280#[test]
4281fn bindgen_test_layout_ZL_CompressorDeserializer_Dependencies() {
4282 const UNINIT: ::std::mem::MaybeUninit<ZL_CompressorDeserializer_Dependencies> =
4283 ::std::mem::MaybeUninit::uninit();
4284 let ptr = UNINIT.as_ptr();
4285 assert_eq!(
4286 ::std::mem::size_of::<ZL_CompressorDeserializer_Dependencies>(),
4287 32usize,
4288 "Size of ZL_CompressorDeserializer_Dependencies"
4289 );
4290 assert_eq!(
4291 ::std::mem::align_of::<ZL_CompressorDeserializer_Dependencies>(),
4292 8usize,
4293 "Alignment of ZL_CompressorDeserializer_Dependencies"
4294 );
4295 assert_eq!(
4296 unsafe { ::std::ptr::addr_of!((*ptr).graph_names) as usize - ptr as usize },
4297 0usize,
4298 "Offset of field: ZL_CompressorDeserializer_Dependencies::graph_names"
4299 );
4300 assert_eq!(
4301 unsafe { ::std::ptr::addr_of!((*ptr).num_graphs) as usize - ptr as usize },
4302 8usize,
4303 "Offset of field: ZL_CompressorDeserializer_Dependencies::num_graphs"
4304 );
4305 assert_eq!(
4306 unsafe { ::std::ptr::addr_of!((*ptr).node_names) as usize - ptr as usize },
4307 16usize,
4308 "Offset of field: ZL_CompressorDeserializer_Dependencies::node_names"
4309 );
4310 assert_eq!(
4311 unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
4312 24usize,
4313 "Offset of field: ZL_CompressorDeserializer_Dependencies::num_nodes"
4314 );
4315}
4316#[repr(C)]
4317#[derive(Debug, Copy, Clone)]
4318pub struct ZL_Result_ZL_CompressorDeserializer_Dependencies_inner {
4319 pub _code: ZL_ErrorCode,
4320 pub _value: ZL_CompressorDeserializer_Dependencies,
4321}
4322#[test]
4323fn bindgen_test_layout_ZL_Result_ZL_CompressorDeserializer_Dependencies_inner() {
4324 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_CompressorDeserializer_Dependencies_inner> =
4325 ::std::mem::MaybeUninit::uninit();
4326 let ptr = UNINIT.as_ptr();
4327 assert_eq!(
4328 ::std::mem::size_of::<ZL_Result_ZL_CompressorDeserializer_Dependencies_inner>(),
4329 40usize,
4330 "Size of ZL_Result_ZL_CompressorDeserializer_Dependencies_inner"
4331 );
4332 assert_eq!(
4333 ::std::mem::align_of::<ZL_Result_ZL_CompressorDeserializer_Dependencies_inner>(),
4334 8usize,
4335 "Alignment of ZL_Result_ZL_CompressorDeserializer_Dependencies_inner"
4336 );
4337 assert_eq!(
4338 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
4339 0usize,
4340 "Offset of field: ZL_Result_ZL_CompressorDeserializer_Dependencies_inner::_code"
4341 );
4342 assert_eq!(
4343 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
4344 8usize,
4345 "Offset of field: ZL_Result_ZL_CompressorDeserializer_Dependencies_inner::_value"
4346 );
4347}
4348#[repr(C)]
4349#[derive(Copy, Clone)]
4350pub union ZL_Result_ZL_CompressorDeserializer_Dependencies_u {
4351 pub _code: ZL_ErrorCode,
4352 pub _value: ZL_Result_ZL_CompressorDeserializer_Dependencies_inner,
4353 pub _error: ZL_Error,
4354}
4355#[test]
4356fn bindgen_test_layout_ZL_Result_ZL_CompressorDeserializer_Dependencies_u() {
4357 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_CompressorDeserializer_Dependencies_u> =
4358 ::std::mem::MaybeUninit::uninit();
4359 let ptr = UNINIT.as_ptr();
4360 assert_eq!(
4361 ::std::mem::size_of::<ZL_Result_ZL_CompressorDeserializer_Dependencies_u>(),
4362 40usize,
4363 "Size of ZL_Result_ZL_CompressorDeserializer_Dependencies_u"
4364 );
4365 assert_eq!(
4366 ::std::mem::align_of::<ZL_Result_ZL_CompressorDeserializer_Dependencies_u>(),
4367 8usize,
4368 "Alignment of ZL_Result_ZL_CompressorDeserializer_Dependencies_u"
4369 );
4370 assert_eq!(
4371 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
4372 0usize,
4373 "Offset of field: ZL_Result_ZL_CompressorDeserializer_Dependencies_u::_code"
4374 );
4375 assert_eq!(
4376 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
4377 0usize,
4378 "Offset of field: ZL_Result_ZL_CompressorDeserializer_Dependencies_u::_value"
4379 );
4380 assert_eq!(
4381 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
4382 0usize,
4383 "Offset of field: ZL_Result_ZL_CompressorDeserializer_Dependencies_u::_error"
4384 );
4385}
4386pub type ZL_Result_ZL_CompressorDeserializer_Dependencies =
4387 ZL_Result_ZL_CompressorDeserializer_Dependencies_u;
4388extern "C" {
4389 #[link_name = "ZL_Result_ZL_CompressorDeserializer_Dependencies_extract__extern"]
4390 pub fn ZL_Result_ZL_CompressorDeserializer_Dependencies_extract(
4391 result: ZL_Result_ZL_CompressorDeserializer_Dependencies,
4392 error: *mut ZL_Error,
4393 ) -> ZL_CompressorDeserializer_Dependencies;
4394}
4395pub type ZL_Result_ZL_CompressorDeserializer_Dependencies_fake_type_needs_semicolon =
4396 ::std::os::raw::c_int;
4397extern "C" {
4398 #[doc = " Read the serialized compressor from @p serialized and find all of the nodes\n and graphs that the serialized compressor refers to but that aren't present\n in the serialized compressor. I.e., lists all the components that must be\n present on a destination compressor in order for this serialized compressor\n to correctly materialize onto that destination compressor.\n\n @param compressor An optional (nullable) pointer to a destination\n compressor. If provided, any nodes or graphs already\n available in that compressor will be removed from the\n returned dependencies, making the returned list strictly\n the *unmet* dependencies. Otherwise, returns all nodes and\n graphs referred to by the serialized compressor but not\n defined by the serialized compressor.\n\n @returns The lists of graph and node names which are unsatisfied\n dependencies. The memory backing the arrays and strings is owned by\n the @p deserializer and will be freed when the @p deserializer is\n destroyed."]
4399 pub fn ZL_CompressorDeserializer_getDependencies(
4400 deserializer: *mut ZL_CompressorDeserializer,
4401 compressor: *const ZL_Compressor,
4402 serialized: *const ::std::os::raw::c_void,
4403 serializedSize: usize,
4404 ) -> ZL_Result_ZL_CompressorDeserializer_Dependencies;
4405}
4406extern "C" {
4407 #[doc = " Safely retrieve the full error message associated with an error.\n\n @returns the verbose error message associated with the @p result or `NULL`\n if the error is no longer valid.\n\n @note This string is stored within the @p deserializer and is only valid for\n the lifetime of the @p deserializer."]
4408 pub fn ZL_CompressorDeserializer_getErrorContextString(
4409 deserializer: *const ZL_CompressorDeserializer,
4410 result: ZL_Report,
4411 ) -> *const ::std::os::raw::c_char;
4412}
4413extern "C" {
4414 #[doc = " Like @ref ZL_CompressorDeserializer_getErrorContextString(), but generic\n across result types. Use like:\n\n ```\n ZL_RESULT_OF(Something) result = ...;\n const char* msg = ZL_CompressorDeserializer_getErrorContextString_fromError(\n deserializer, ZL_RES_error(result));\n ```\n\n @returns the verbose error message associated with the @p error or `NULL`\n if the error is no longer valid.\n\n @note This string is stored within the @p deserializer and is only valid for\n the lifetime of the @p deserializer."]
4415 pub fn ZL_CompressorDeserializer_getErrorContextString_fromError(
4416 deserializer: *const ZL_CompressorDeserializer,
4417 error: ZL_Error,
4418 ) -> *const ::std::os::raw::c_char;
4419}
4420pub type ZL_CPipeDstCapacityFn = ::std::option::Option<
4421 unsafe extern "C" fn(src: *const ::std::os::raw::c_void, srcSize: usize) -> usize,
4422>;
4423pub type ZL_PipeEncoderFn = ::std::option::Option<
4424 unsafe extern "C" fn(
4425 dst: *mut ::std::os::raw::c_void,
4426 dstCapacity: usize,
4427 src: *const ::std::os::raw::c_void,
4428 srcSize: usize,
4429 ) -> usize,
4430>;
4431#[repr(C)]
4432#[derive(Debug, Copy, Clone)]
4433pub struct ZL_PipeEncoderDesc {
4434 pub CTid: ZL_IDType,
4435 pub transform_f: ZL_PipeEncoderFn,
4436 pub dstBound_f: ZL_CPipeDstCapacityFn,
4437 pub name: *const ::std::os::raw::c_char,
4438}
4439#[test]
4440fn bindgen_test_layout_ZL_PipeEncoderDesc() {
4441 const UNINIT: ::std::mem::MaybeUninit<ZL_PipeEncoderDesc> = ::std::mem::MaybeUninit::uninit();
4442 let ptr = UNINIT.as_ptr();
4443 assert_eq!(
4444 ::std::mem::size_of::<ZL_PipeEncoderDesc>(),
4445 32usize,
4446 "Size of ZL_PipeEncoderDesc"
4447 );
4448 assert_eq!(
4449 ::std::mem::align_of::<ZL_PipeEncoderDesc>(),
4450 8usize,
4451 "Alignment of ZL_PipeEncoderDesc"
4452 );
4453 assert_eq!(
4454 unsafe { ::std::ptr::addr_of!((*ptr).CTid) as usize - ptr as usize },
4455 0usize,
4456 "Offset of field: ZL_PipeEncoderDesc::CTid"
4457 );
4458 assert_eq!(
4459 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
4460 8usize,
4461 "Offset of field: ZL_PipeEncoderDesc::transform_f"
4462 );
4463 assert_eq!(
4464 unsafe { ::std::ptr::addr_of!((*ptr).dstBound_f) as usize - ptr as usize },
4465 16usize,
4466 "Offset of field: ZL_PipeEncoderDesc::dstBound_f"
4467 );
4468 assert_eq!(
4469 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
4470 24usize,
4471 "Offset of field: ZL_PipeEncoderDesc::name"
4472 );
4473}
4474extern "C" {
4475 #[doc = " Register a custom pipe encoder, to be employed in upcoming Graph.\n This registration is specialized for simple pipe transforms.\n Counterpart: ZL_DCtx_registerPipeDecoder().\n This action creates a NodeID, provided as @return value.\n Graphs using custom encoders are only decodable if,\n at decompression time, a custom decoder of same CTid is registered."]
4476 pub fn ZL_Compressor_registerPipeEncoder(
4477 cgraph: *mut ZL_Compressor,
4478 ctd: *const ZL_PipeEncoderDesc,
4479 ) -> ZL_NodeID;
4480}
4481pub type ZL_SplitEncoderFn = ::std::option::Option<
4482 unsafe extern "C" fn(
4483 eic: *mut ZL_Encoder,
4484 writtenSizes: *mut usize,
4485 src: *const ::std::os::raw::c_void,
4486 srcSize: usize,
4487 ) -> ZL_Report,
4488>;
4489#[repr(C)]
4490#[derive(Debug, Copy, Clone)]
4491pub struct ZL_SplitEncoderDesc {
4492 pub CTid: ZL_IDType,
4493 pub transform_f: ZL_SplitEncoderFn,
4494 pub nbOutputStreams: usize,
4495 pub localParams: ZL_LocalParams,
4496 pub name: *const ::std::os::raw::c_char,
4497}
4498#[test]
4499fn bindgen_test_layout_ZL_SplitEncoderDesc() {
4500 const UNINIT: ::std::mem::MaybeUninit<ZL_SplitEncoderDesc> = ::std::mem::MaybeUninit::uninit();
4501 let ptr = UNINIT.as_ptr();
4502 assert_eq!(
4503 ::std::mem::size_of::<ZL_SplitEncoderDesc>(),
4504 80usize,
4505 "Size of ZL_SplitEncoderDesc"
4506 );
4507 assert_eq!(
4508 ::std::mem::align_of::<ZL_SplitEncoderDesc>(),
4509 8usize,
4510 "Alignment of ZL_SplitEncoderDesc"
4511 );
4512 assert_eq!(
4513 unsafe { ::std::ptr::addr_of!((*ptr).CTid) as usize - ptr as usize },
4514 0usize,
4515 "Offset of field: ZL_SplitEncoderDesc::CTid"
4516 );
4517 assert_eq!(
4518 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
4519 8usize,
4520 "Offset of field: ZL_SplitEncoderDesc::transform_f"
4521 );
4522 assert_eq!(
4523 unsafe { ::std::ptr::addr_of!((*ptr).nbOutputStreams) as usize - ptr as usize },
4524 16usize,
4525 "Offset of field: ZL_SplitEncoderDesc::nbOutputStreams"
4526 );
4527 assert_eq!(
4528 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
4529 24usize,
4530 "Offset of field: ZL_SplitEncoderDesc::localParams"
4531 );
4532 assert_eq!(
4533 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
4534 72usize,
4535 "Offset of field: ZL_SplitEncoderDesc::name"
4536 );
4537}
4538extern "C" {
4539 #[doc = " Register a custom Split Transform"]
4540 pub fn ZL_Compressor_registerSplitEncoder(
4541 cgraph: *mut ZL_Compressor,
4542 ctd: *const ZL_SplitEncoderDesc,
4543 ) -> ZL_NodeID;
4544}
4545extern "C" {
4546 pub fn ZL_Encoder_createAllOutBuffers(
4547 eic: *mut ZL_Encoder,
4548 buffStarts: *mut *mut ::std::os::raw::c_void,
4549 buffCapacities: *const usize,
4550 nbBuffs: usize,
4551 ) -> ZL_Report;
4552}
4553extern "C" {
4554 #[link_name = "ZL_codemodOutputAsData__extern"]
4555 pub fn ZL_codemodOutputAsData(output: *mut ZL_Output) -> *mut ZL_Data;
4556}
4557extern "C" {
4558 #[link_name = "ZL_codemodDataAsOutput__extern"]
4559 pub fn ZL_codemodDataAsOutput(data: *mut ZL_Data) -> *mut ZL_Output;
4560}
4561extern "C" {
4562 #[link_name = "ZL_codemodConstOutputAsData__extern"]
4563 pub fn ZL_codemodConstOutputAsData(output: *const ZL_Output) -> *const ZL_Data;
4564}
4565extern "C" {
4566 #[link_name = "ZL_codemodConstDataAsOutput__extern"]
4567 pub fn ZL_codemodConstDataAsOutput(data: *const ZL_Data) -> *const ZL_Output;
4568}
4569extern "C" {
4570 #[link_name = "ZL_codemodConstDatasAsOutputs__extern"]
4571 pub fn ZL_codemodConstDatasAsOutputs(datas: *mut *const ZL_Data) -> *mut *const ZL_Output;
4572}
4573extern "C" {
4574 #[link_name = "ZL_codemodOutputsAsDatas__extern"]
4575 pub fn ZL_codemodOutputsAsDatas(outputs: *mut *mut ZL_Output) -> *mut *mut ZL_Data;
4576}
4577extern "C" {
4578 #[link_name = "ZL_Output_type__extern"]
4579 pub fn ZL_Output_type(output: *const ZL_Output) -> ZL_Type;
4580}
4581extern "C" {
4582 #[link_name = "ZL_Output_id__extern"]
4583 pub fn ZL_Output_id(output: *const ZL_Output) -> ZL_DataID;
4584}
4585extern "C" {
4586 #[doc = " @returns The element width of the @p output if it has a buffer reserved,\n otherwise it returns NULL. Within a custom codec, this function always\n succeeds, because the output always has a buffer reserved. If the type\n of the output is String, it returns 0 instead."]
4587 pub fn ZL_Output_eltWidth(output: *const ZL_Output) -> ZL_Report;
4588}
4589extern "C" {
4590 #[doc = " @returns The number of elements committed in @p output if it has been\n committed. Otherwise, returns an error if the write to @p output has not been\n committed."]
4591 pub fn ZL_Output_numElts(output: *const ZL_Output) -> ZL_Report;
4592}
4593extern "C" {
4594 #[doc = " @returns The content size in bytes that has been committed to @p output.\n For non-string types, this is the eltWidth * numElts. For string types, this\n is the sum of the lengths of each stream. If @p output has not been\n committed, it returns an error."]
4595 pub fn ZL_Output_contentSize(output: *const ZL_Output) -> ZL_Report;
4596}
4597extern "C" {
4598 #[doc = " @returns The capacity of the buffer reserved for @p output in number of\n elements. If @p output has not been reserved, it returns an error.\n For string types, this is the number of strings that can be written into the\n buffer."]
4599 pub fn ZL_Output_eltsCapacity(output: *const ZL_Output) -> ZL_Report;
4600}
4601extern "C" {
4602 #[doc = " @returns The capacity of the buffer reserved for @p output in bytes. If\n @p output has not been reserved, it returns an error. For string types, this\n is the sum of the lengths of each string that can be written into the buffer."]
4603 pub fn ZL_Output_contentCapacity(output: *const ZL_Output) -> ZL_Report;
4604}
4605extern "C" {
4606 #[doc = " These methods provide direct access to internal buffer.\n Warning : users must pay attention to buffer boundaries.\n @return pointer to buffer position to resume writing.\n @note for `ZL_Type_string`, returns a pointer to the buffer containing the\n concatenated strings."]
4607 #[link_name = "ZL_Output_ptr__extern"]
4608 pub fn ZL_Output_ptr(output: *mut ZL_Output) -> *mut ::std::os::raw::c_void;
4609}
4610extern "C" {
4611 #[doc = " @returns a const pointer to the _beginning_ of the buffer.\n It returns NULL if the output does not have a buffer attached to it yet.\n This cannot happen within a custom codec.\n Warning : users must pay attention to buffer boundaries.\n @note for `ZL_Type_string`, returns a pointer to the buffer containing the\n concatenated strings."]
4612 #[link_name = "ZL_Output_constPtr__extern"]
4613 pub fn ZL_Output_constPtr(output: *const ZL_Output) -> *const ::std::os::raw::c_void;
4614}
4615extern "C" {
4616 #[doc = " This method is only valid for `ZL_Type_string` Data.\n It requests write access into StringLens array.\n Only valid if StringLens array has already been allocated.\n @return pointer to array position to resume writing.\n or NULL if any of above conditions is violated.\n\n Array's capacity is supposed known from reservation request.\n After writing into the array, the nb of Strings, which is also\n the nb of String Lengths written, must be provided using\n ZL_Data_commit()."]
4617 #[link_name = "ZL_Output_stringLens__extern"]
4618 pub fn ZL_Output_stringLens(output: *mut ZL_Output) -> *mut u32;
4619}
4620extern "C" {
4621 #[doc = " @returns A const pointer to the array containing lengths for string-typed\n outputs. It returns NULL if the output is not of type string."]
4622 #[link_name = "ZL_Output_constStringLens__extern"]
4623 pub fn ZL_Output_constStringLens(output: *const ZL_Output) -> *const u32;
4624}
4625extern "C" {
4626 #[doc = " This method is only valid for `ZL_Type_string` Data.\n It reserves memory space for StringLens array, and returns a pointer to it.\n The buffer is owned by @p data and has the same lifetime.\n The returned pointer can be used to write into the array.\n After writing into the array, the nb of String Lengths provided must be\n signaled using @ref ZL_Output_commit().\n This method will fail if StringLens is already allocated.\n @return `NULL` if incorrect data type, or allocation error."]
4627 #[link_name = "ZL_Output_reserveStringLens__extern"]
4628 pub fn ZL_Output_reserveStringLens(output: *mut ZL_Output, numStrings: usize) -> *mut u32;
4629}
4630extern "C" {
4631 #[doc = " @brief Commit the number of elements written into @p data.\n\n This method must be called exactly once for every output.\n The @p nbElts must be `<=` reserved capacity of @p data.\n Note that, for `ZL_Type_string`, this is the number of strings written into\n@p data.\n The operation will automatically determine the total size of all Strings\nwithin @p data.\n\n @returns Success or an error. This function will fail if it is called more\n than once on the same @p data, or if @p nbElts is greater than @p data's\n capacity.\n\n Terminating a Codec _without_ committing anything to @p data (not even `0`)\n is considered an error, that is caught by the Engine\n (classified as node processing error).\n\n @note @p nbElts, as \"number of elements\", is **not** the same as size in\nbytes written in\n the buffer. For Numerics and Structs, the translation is\n straighforward. For Strings, the field sizes array must be\n provided first, using `ZL_Data_reserveStringLens()` to create\n and access the array. The resulting useful content size will then\n be calculated from the sum of field sizes. It will be controlled,\n and there will be an error if sum(sizes) > bufferCapacity."]
4632 #[link_name = "ZL_Output_commit__extern"]
4633 pub fn ZL_Output_commit(output: *mut ZL_Output, numElts: usize) -> ZL_Report;
4634}
4635extern "C" {
4636 #[doc = " @brief Sets integer metadata with the key @p key and value @p value on the\n stream.\n\n It is only valid to call ZL_Data_setIntMetadata() with the same @p key\n once. Subsequent calls with the same @p key will return an error.\n\n @param key Metdata key\n @param value Metadata value\n\n @returns Success or an error. This function will fail due to repeated calls\n with the same @p key, or upon running out of space for the metadata.\n\n @note In this proposed design, Int Metadata are set one by one.\n Another possible design could follow the IntParams\n model, where all parameters must be set all-at-once, and be\n provided as a single vector of IntParams structures.\n\n @note The set value is an int, hence it's not suitable to store \"large\"\n values, like 64-bit ULL."]
4637 #[link_name = "ZL_Output_setIntMetadata__extern"]
4638 pub fn ZL_Output_setIntMetadata(
4639 output: *mut ZL_Output,
4640 key: ::std::os::raw::c_int,
4641 value: ::std::os::raw::c_int,
4642 ) -> ZL_Report;
4643}
4644extern "C" {
4645 #[doc = " @returns The value if present. ZL_IntMetadata::isPresent != 0\n when the @p key exists, in which case ZL_IntMetadata::mValue is set to the\n value."]
4646 #[link_name = "ZL_Output_getIntMetadata__extern"]
4647 pub fn ZL_Output_getIntMetadata(
4648 output: *const ZL_Output,
4649 key: ::std::os::raw::c_int,
4650 ) -> ZL_IntMetadata;
4651}
4652pub type ZL_SerialSelectorFn = ::std::option::Option<
4653 unsafe extern "C" fn(
4654 src: *const ::std::os::raw::c_void,
4655 srcSize: usize,
4656 customGraphs: *const ZL_GraphID,
4657 nbCustomGraphs: usize,
4658 ) -> ZL_GraphID,
4659>;
4660#[repr(C)]
4661#[derive(Debug, Copy, Clone)]
4662pub struct ZL_SerialSelectorDesc {
4663 pub selector_f: ZL_SerialSelectorFn,
4664 pub customGraphs: *const ZL_GraphID,
4665 pub nbCustomGraphs: usize,
4666 pub name: *const ::std::os::raw::c_char,
4667}
4668#[test]
4669fn bindgen_test_layout_ZL_SerialSelectorDesc() {
4670 const UNINIT: ::std::mem::MaybeUninit<ZL_SerialSelectorDesc> =
4671 ::std::mem::MaybeUninit::uninit();
4672 let ptr = UNINIT.as_ptr();
4673 assert_eq!(
4674 ::std::mem::size_of::<ZL_SerialSelectorDesc>(),
4675 32usize,
4676 "Size of ZL_SerialSelectorDesc"
4677 );
4678 assert_eq!(
4679 ::std::mem::align_of::<ZL_SerialSelectorDesc>(),
4680 8usize,
4681 "Alignment of ZL_SerialSelectorDesc"
4682 );
4683 assert_eq!(
4684 unsafe { ::std::ptr::addr_of!((*ptr).selector_f) as usize - ptr as usize },
4685 0usize,
4686 "Offset of field: ZL_SerialSelectorDesc::selector_f"
4687 );
4688 assert_eq!(
4689 unsafe { ::std::ptr::addr_of!((*ptr).customGraphs) as usize - ptr as usize },
4690 8usize,
4691 "Offset of field: ZL_SerialSelectorDesc::customGraphs"
4692 );
4693 assert_eq!(
4694 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomGraphs) as usize - ptr as usize },
4695 16usize,
4696 "Offset of field: ZL_SerialSelectorDesc::nbCustomGraphs"
4697 );
4698 assert_eq!(
4699 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
4700 24usize,
4701 "Offset of field: ZL_SerialSelectorDesc::name"
4702 );
4703}
4704extern "C" {
4705 pub fn ZL_Compressor_registerSerialSelectorGraph(
4706 cgraph: *mut ZL_Compressor,
4707 csd: *const ZL_SerialSelectorDesc,
4708 ) -> ZL_GraphID;
4709}
4710pub type ZL_SelectorFn = ::std::option::Option<
4711 unsafe extern "C" fn(
4712 selectorAPI: *const ZL_Selector,
4713 input: *const ZL_Input,
4714 customGraphs: *const ZL_GraphID,
4715 nbCustomGraphs: usize,
4716 ) -> ZL_GraphID,
4717>;
4718#[repr(C)]
4719#[derive(Debug, Copy, Clone)]
4720pub struct ZL_SelectorDesc {
4721 pub selector_f: ZL_SelectorFn,
4722 #[doc = " Selectors optionally support multiple input types,\n using bitmap masking (ex: ZL_Type_struct | ZL_Type_string).\n In which case, it's the responsibility of the selector to select\n a successor featuring an input type compatible with current input.\n Note that it's always preferable to limit Selector's input type\n to the minimum nb of types possible,\n because it makes graph validation more accurate and effective."]
4723 pub inStreamType: ZL_Type,
4724 pub customGraphs: *const ZL_GraphID,
4725 pub nbCustomGraphs: usize,
4726 pub localParams: ZL_LocalParams,
4727 #[doc = " Optional materializer descriptor for materialized local params.\n If both materializeFn and dematerializeFn are non-null, the materializer\n will be used to create materialized objects from local params."]
4728 pub materializer: ZL_MaterializerDesc,
4729 #[doc = " Optional, the name of the graph rooted by the selector."]
4730 pub name: *const ::std::os::raw::c_char,
4731 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Selector_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the compressor."]
4732 pub opaque: ZL_OpaquePtr,
4733}
4734#[test]
4735fn bindgen_test_layout_ZL_SelectorDesc() {
4736 const UNINIT: ::std::mem::MaybeUninit<ZL_SelectorDesc> = ::std::mem::MaybeUninit::uninit();
4737 let ptr = UNINIT.as_ptr();
4738 assert_eq!(
4739 ::std::mem::size_of::<ZL_SelectorDesc>(),
4740 144usize,
4741 "Size of ZL_SelectorDesc"
4742 );
4743 assert_eq!(
4744 ::std::mem::align_of::<ZL_SelectorDesc>(),
4745 8usize,
4746 "Alignment of ZL_SelectorDesc"
4747 );
4748 assert_eq!(
4749 unsafe { ::std::ptr::addr_of!((*ptr).selector_f) as usize - ptr as usize },
4750 0usize,
4751 "Offset of field: ZL_SelectorDesc::selector_f"
4752 );
4753 assert_eq!(
4754 unsafe { ::std::ptr::addr_of!((*ptr).inStreamType) as usize - ptr as usize },
4755 8usize,
4756 "Offset of field: ZL_SelectorDesc::inStreamType"
4757 );
4758 assert_eq!(
4759 unsafe { ::std::ptr::addr_of!((*ptr).customGraphs) as usize - ptr as usize },
4760 16usize,
4761 "Offset of field: ZL_SelectorDesc::customGraphs"
4762 );
4763 assert_eq!(
4764 unsafe { ::std::ptr::addr_of!((*ptr).nbCustomGraphs) as usize - ptr as usize },
4765 24usize,
4766 "Offset of field: ZL_SelectorDesc::nbCustomGraphs"
4767 );
4768 assert_eq!(
4769 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
4770 32usize,
4771 "Offset of field: ZL_SelectorDesc::localParams"
4772 );
4773 assert_eq!(
4774 unsafe { ::std::ptr::addr_of!((*ptr).materializer) as usize - ptr as usize },
4775 80usize,
4776 "Offset of field: ZL_SelectorDesc::materializer"
4777 );
4778 assert_eq!(
4779 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
4780 112usize,
4781 "Offset of field: ZL_SelectorDesc::name"
4782 );
4783 assert_eq!(
4784 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
4785 120usize,
4786 "Offset of field: ZL_SelectorDesc::opaque"
4787 );
4788}
4789extern "C" {
4790 #[doc = " Register a selector graph given the @p desc.\n\n @note This is a new variant of @ref ZL_Compressor_registerSelectorGraph that\n reports errors using OpenZL's ZL_Report error system.\n\n @param desc The description of the selector, must be non-null.\n\n @return The new graph ID, or an error."]
4791 pub fn ZL_Compressor_registerSelectorGraph2(
4792 compressor: *mut ZL_Compressor,
4793 desc: *const ZL_SelectorDesc,
4794 ) -> ZL_Result_ZL_GraphID;
4795}
4796extern "C" {
4797 pub fn ZL_Compressor_registerSelectorGraph(
4798 cgraph: *mut ZL_Compressor,
4799 ctsd: *const ZL_SelectorDesc,
4800 ) -> ZL_GraphID;
4801}
4802extern "C" {
4803 #[doc = " Utility function to get the input types supported by @gid as an input mask.\n Throws an error if @gid is not valid or does not have exactly one input.\n See ZL_Compressor_Graph_getInput0Mask() for more details."]
4804 pub fn ZL_Selector_getInput0MaskForGraph(
4805 selCtx: *const ZL_Selector,
4806 gid: ZL_GraphID,
4807 ) -> ZL_Type;
4808}
4809extern "C" {
4810 pub fn ZL_Selector_getOpaquePtr(selector: *const ZL_Selector) -> *const ::std::os::raw::c_void;
4811}
4812extern "C" {
4813 #[doc = " @brief Query the current graph execution depth.\n\n Returns the depth at which the current graph is executing.\n Depth 1 is the root graph; each successor level increments by 1.\n This can be used by a selector/transformer to detect runaway\n graph growth.\n\n @param selCtx Selector context, must be non-NULL.\n @return Current graph execution depth (>= 1)."]
4814 pub fn ZL_Selector_getGraphDepth(selCtx: *const ZL_Selector) -> ::std::os::raw::c_uint;
4815}
4816#[repr(C)]
4817#[derive(Copy, Clone)]
4818pub struct ZL_GraphReport {
4819 pub finalCompressedSize: ZL_Report,
4820}
4821#[test]
4822fn bindgen_test_layout_ZL_GraphReport() {
4823 const UNINIT: ::std::mem::MaybeUninit<ZL_GraphReport> = ::std::mem::MaybeUninit::uninit();
4824 let ptr = UNINIT.as_ptr();
4825 assert_eq!(
4826 ::std::mem::size_of::<ZL_GraphReport>(),
4827 16usize,
4828 "Size of ZL_GraphReport"
4829 );
4830 assert_eq!(
4831 ::std::mem::align_of::<ZL_GraphReport>(),
4832 8usize,
4833 "Alignment of ZL_GraphReport"
4834 );
4835 assert_eq!(
4836 unsafe { ::std::ptr::addr_of!((*ptr).finalCompressedSize) as usize - ptr as usize },
4837 0usize,
4838 "Offset of field: ZL_GraphReport::finalCompressedSize"
4839 );
4840}
4841extern "C" {
4842 pub fn ZL_Selector_tryGraph(
4843 selCtx: *const ZL_Selector,
4844 input: *const ZL_Input,
4845 graphid: ZL_GraphID,
4846 ) -> ZL_GraphReport;
4847}
4848extern "C" {
4849 pub fn ZL_Selector_setSuccessorParams(
4850 selCtx: *const ZL_Selector,
4851 lparams: *const ZL_LocalParams,
4852 ) -> ZL_Report;
4853}
4854extern "C" {
4855 pub fn ZL_Selector_getCParam(
4856 selCtx: *const ZL_Selector,
4857 gparam: ZL_CParam,
4858 ) -> ::std::os::raw::c_int;
4859}
4860extern "C" {
4861 pub fn ZL_Selector_getLocalIntParam(
4862 selCtx: *const ZL_Selector,
4863 intParamId: ::std::os::raw::c_int,
4864 ) -> ZL_IntParam;
4865}
4866extern "C" {
4867 pub fn ZL_Selector_getLocalParam(
4868 selCtx: *const ZL_Selector,
4869 paramId: ::std::os::raw::c_int,
4870 ) -> ZL_RefParam;
4871}
4872extern "C" {
4873 pub fn ZL_Selector_getLocalCopyParam(
4874 selCtx: *const ZL_Selector,
4875 copyParamId: ::std::os::raw::c_int,
4876 ) -> ZL_CopyParam;
4877}
4878extern "C" {
4879 pub fn ZL_Selector_getLocalIntParams(selCtx: *const ZL_Selector) -> ZL_LocalIntParams;
4880}
4881extern "C" {
4882 pub fn ZL_Selector_getScratchSpace(
4883 selCtx: *const ZL_Selector,
4884 size: usize,
4885 ) -> *mut ::std::os::raw::c_void;
4886}
4887pub type ZL_CodecStateAlloc =
4888 ::std::option::Option<unsafe extern "C" fn() -> *mut ::std::os::raw::c_void>;
4889pub type ZL_CodecStateFree =
4890 ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>;
4891#[repr(C)]
4892#[derive(Debug, Copy, Clone)]
4893pub struct ZL_CodecStateManager {
4894 pub stateAlloc: ZL_CodecStateAlloc,
4895 pub stateFree: ZL_CodecStateFree,
4896 pub optionalStateID: usize,
4897}
4898#[test]
4899fn bindgen_test_layout_ZL_CodecStateManager() {
4900 const UNINIT: ::std::mem::MaybeUninit<ZL_CodecStateManager> = ::std::mem::MaybeUninit::uninit();
4901 let ptr = UNINIT.as_ptr();
4902 assert_eq!(
4903 ::std::mem::size_of::<ZL_CodecStateManager>(),
4904 24usize,
4905 "Size of ZL_CodecStateManager"
4906 );
4907 assert_eq!(
4908 ::std::mem::align_of::<ZL_CodecStateManager>(),
4909 8usize,
4910 "Alignment of ZL_CodecStateManager"
4911 );
4912 assert_eq!(
4913 unsafe { ::std::ptr::addr_of!((*ptr).stateAlloc) as usize - ptr as usize },
4914 0usize,
4915 "Offset of field: ZL_CodecStateManager::stateAlloc"
4916 );
4917 assert_eq!(
4918 unsafe { ::std::ptr::addr_of!((*ptr).stateFree) as usize - ptr as usize },
4919 8usize,
4920 "Offset of field: ZL_CodecStateManager::stateFree"
4921 );
4922 assert_eq!(
4923 unsafe { ::std::ptr::addr_of!((*ptr).optionalStateID) as usize - ptr as usize },
4924 16usize,
4925 "Offset of field: ZL_CodecStateManager::optionalStateID"
4926 );
4927}
4928pub type ZL_TypedEncoderFn = ::std::option::Option<
4929 unsafe extern "C" fn(ectx: *mut ZL_Encoder, in_: *const ZL_Input) -> ZL_Report,
4930>;
4931#[repr(C)]
4932#[derive(Debug, Copy, Clone)]
4933pub struct ZL_TypedGraphDesc {
4934 pub CTid: ZL_IDType,
4935 pub inStreamType: ZL_Type,
4936 pub outStreamTypes: *const ZL_Type,
4937 pub nbOutStreams: usize,
4938}
4939#[test]
4940fn bindgen_test_layout_ZL_TypedGraphDesc() {
4941 const UNINIT: ::std::mem::MaybeUninit<ZL_TypedGraphDesc> = ::std::mem::MaybeUninit::uninit();
4942 let ptr = UNINIT.as_ptr();
4943 assert_eq!(
4944 ::std::mem::size_of::<ZL_TypedGraphDesc>(),
4945 24usize,
4946 "Size of ZL_TypedGraphDesc"
4947 );
4948 assert_eq!(
4949 ::std::mem::align_of::<ZL_TypedGraphDesc>(),
4950 8usize,
4951 "Alignment of ZL_TypedGraphDesc"
4952 );
4953 assert_eq!(
4954 unsafe { ::std::ptr::addr_of!((*ptr).CTid) as usize - ptr as usize },
4955 0usize,
4956 "Offset of field: ZL_TypedGraphDesc::CTid"
4957 );
4958 assert_eq!(
4959 unsafe { ::std::ptr::addr_of!((*ptr).inStreamType) as usize - ptr as usize },
4960 4usize,
4961 "Offset of field: ZL_TypedGraphDesc::inStreamType"
4962 );
4963 assert_eq!(
4964 unsafe { ::std::ptr::addr_of!((*ptr).outStreamTypes) as usize - ptr as usize },
4965 8usize,
4966 "Offset of field: ZL_TypedGraphDesc::outStreamTypes"
4967 );
4968 assert_eq!(
4969 unsafe { ::std::ptr::addr_of!((*ptr).nbOutStreams) as usize - ptr as usize },
4970 16usize,
4971 "Offset of field: ZL_TypedGraphDesc::nbOutStreams"
4972 );
4973}
4974#[repr(C)]
4975#[derive(Debug, Copy, Clone)]
4976pub struct ZL_TypedEncoderDesc {
4977 pub gd: ZL_TypedGraphDesc,
4978 pub transform_f: ZL_TypedEncoderFn,
4979 pub localParams: ZL_LocalParams,
4980 pub name: *const ::std::os::raw::c_char,
4981 pub trStateMgr: ZL_CodecStateManager,
4982 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Encoder_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the compressor."]
4983 pub opaque: ZL_OpaquePtr,
4984}
4985#[test]
4986fn bindgen_test_layout_ZL_TypedEncoderDesc() {
4987 const UNINIT: ::std::mem::MaybeUninit<ZL_TypedEncoderDesc> = ::std::mem::MaybeUninit::uninit();
4988 let ptr = UNINIT.as_ptr();
4989 assert_eq!(
4990 ::std::mem::size_of::<ZL_TypedEncoderDesc>(),
4991 136usize,
4992 "Size of ZL_TypedEncoderDesc"
4993 );
4994 assert_eq!(
4995 ::std::mem::align_of::<ZL_TypedEncoderDesc>(),
4996 8usize,
4997 "Alignment of ZL_TypedEncoderDesc"
4998 );
4999 assert_eq!(
5000 unsafe { ::std::ptr::addr_of!((*ptr).gd) as usize - ptr as usize },
5001 0usize,
5002 "Offset of field: ZL_TypedEncoderDesc::gd"
5003 );
5004 assert_eq!(
5005 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
5006 24usize,
5007 "Offset of field: ZL_TypedEncoderDesc::transform_f"
5008 );
5009 assert_eq!(
5010 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
5011 32usize,
5012 "Offset of field: ZL_TypedEncoderDesc::localParams"
5013 );
5014 assert_eq!(
5015 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
5016 80usize,
5017 "Offset of field: ZL_TypedEncoderDesc::name"
5018 );
5019 assert_eq!(
5020 unsafe { ::std::ptr::addr_of!((*ptr).trStateMgr) as usize - ptr as usize },
5021 88usize,
5022 "Offset of field: ZL_TypedEncoderDesc::trStateMgr"
5023 );
5024 assert_eq!(
5025 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
5026 112usize,
5027 "Offset of field: ZL_TypedEncoderDesc::opaque"
5028 );
5029}
5030extern "C" {
5031 #[doc = " Register a custom encoder that can be used to compress.\n\n @note This is a new variant of @ref ZL_Compressor_registerTypedEncoder that\n reports errors using OpenZL's ZL_Report error system.\n\n @warning Using a custom encoder requires the decoder to be registered before\n decompression.\n\n @param desc The description of the encoder.\n\n @returns The new node ID, or an error."]
5032 pub fn ZL_Compressor_registerTypedEncoder2(
5033 compressor: *mut ZL_Compressor,
5034 desc: *const ZL_TypedEncoderDesc,
5035 ) -> ZL_Result_ZL_NodeID;
5036}
5037extern "C" {
5038 #[doc = " Register a custom Typed Transform, to be employed in upcoming graph."]
5039 pub fn ZL_Compressor_registerTypedEncoder(
5040 cgraph: *mut ZL_Compressor,
5041 ctd: *const ZL_TypedEncoderDesc,
5042 ) -> ZL_NodeID;
5043}
5044pub type ZL_VOEncoderFn = ::std::option::Option<
5045 unsafe extern "C" fn(ectx: *mut ZL_Encoder, in_: *const ZL_Input) -> ZL_Report,
5046>;
5047#[repr(C)]
5048#[derive(Debug, Copy, Clone)]
5049pub struct ZL_VOGraphDesc {
5050 pub CTid: ZL_IDType,
5051 pub inStreamType: ZL_Type,
5052 pub singletonTypes: *const ZL_Type,
5053 pub nbSingletons: usize,
5054 pub voTypes: *const ZL_Type,
5055 pub nbVOs: usize,
5056}
5057#[test]
5058fn bindgen_test_layout_ZL_VOGraphDesc() {
5059 const UNINIT: ::std::mem::MaybeUninit<ZL_VOGraphDesc> = ::std::mem::MaybeUninit::uninit();
5060 let ptr = UNINIT.as_ptr();
5061 assert_eq!(
5062 ::std::mem::size_of::<ZL_VOGraphDesc>(),
5063 40usize,
5064 "Size of ZL_VOGraphDesc"
5065 );
5066 assert_eq!(
5067 ::std::mem::align_of::<ZL_VOGraphDesc>(),
5068 8usize,
5069 "Alignment of ZL_VOGraphDesc"
5070 );
5071 assert_eq!(
5072 unsafe { ::std::ptr::addr_of!((*ptr).CTid) as usize - ptr as usize },
5073 0usize,
5074 "Offset of field: ZL_VOGraphDesc::CTid"
5075 );
5076 assert_eq!(
5077 unsafe { ::std::ptr::addr_of!((*ptr).inStreamType) as usize - ptr as usize },
5078 4usize,
5079 "Offset of field: ZL_VOGraphDesc::inStreamType"
5080 );
5081 assert_eq!(
5082 unsafe { ::std::ptr::addr_of!((*ptr).singletonTypes) as usize - ptr as usize },
5083 8usize,
5084 "Offset of field: ZL_VOGraphDesc::singletonTypes"
5085 );
5086 assert_eq!(
5087 unsafe { ::std::ptr::addr_of!((*ptr).nbSingletons) as usize - ptr as usize },
5088 16usize,
5089 "Offset of field: ZL_VOGraphDesc::nbSingletons"
5090 );
5091 assert_eq!(
5092 unsafe { ::std::ptr::addr_of!((*ptr).voTypes) as usize - ptr as usize },
5093 24usize,
5094 "Offset of field: ZL_VOGraphDesc::voTypes"
5095 );
5096 assert_eq!(
5097 unsafe { ::std::ptr::addr_of!((*ptr).nbVOs) as usize - ptr as usize },
5098 32usize,
5099 "Offset of field: ZL_VOGraphDesc::nbVOs"
5100 );
5101}
5102#[repr(C)]
5103#[derive(Debug, Copy, Clone)]
5104pub struct ZL_VOEncoderDesc {
5105 pub gd: ZL_VOGraphDesc,
5106 pub transform_f: ZL_VOEncoderFn,
5107 pub localParams: ZL_LocalParams,
5108 pub name: *const ::std::os::raw::c_char,
5109 pub trStateMgr: ZL_CodecStateManager,
5110 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Encoder_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the compressor."]
5111 pub opaque: ZL_OpaquePtr,
5112}
5113#[test]
5114fn bindgen_test_layout_ZL_VOEncoderDesc() {
5115 const UNINIT: ::std::mem::MaybeUninit<ZL_VOEncoderDesc> = ::std::mem::MaybeUninit::uninit();
5116 let ptr = UNINIT.as_ptr();
5117 assert_eq!(
5118 ::std::mem::size_of::<ZL_VOEncoderDesc>(),
5119 152usize,
5120 "Size of ZL_VOEncoderDesc"
5121 );
5122 assert_eq!(
5123 ::std::mem::align_of::<ZL_VOEncoderDesc>(),
5124 8usize,
5125 "Alignment of ZL_VOEncoderDesc"
5126 );
5127 assert_eq!(
5128 unsafe { ::std::ptr::addr_of!((*ptr).gd) as usize - ptr as usize },
5129 0usize,
5130 "Offset of field: ZL_VOEncoderDesc::gd"
5131 );
5132 assert_eq!(
5133 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
5134 40usize,
5135 "Offset of field: ZL_VOEncoderDesc::transform_f"
5136 );
5137 assert_eq!(
5138 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
5139 48usize,
5140 "Offset of field: ZL_VOEncoderDesc::localParams"
5141 );
5142 assert_eq!(
5143 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
5144 96usize,
5145 "Offset of field: ZL_VOEncoderDesc::name"
5146 );
5147 assert_eq!(
5148 unsafe { ::std::ptr::addr_of!((*ptr).trStateMgr) as usize - ptr as usize },
5149 104usize,
5150 "Offset of field: ZL_VOEncoderDesc::trStateMgr"
5151 );
5152 assert_eq!(
5153 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
5154 128usize,
5155 "Offset of field: ZL_VOEncoderDesc::opaque"
5156 );
5157}
5158extern "C" {
5159 #[doc = " Register a custom encoder that can be used to compress.\n\n @note This is a new variant of @ref ZL_Compressor_registerVOEncoder that\n reports errors using OpenZL's ZL_Report error system.\n\n @warning Using a custom encoder requires the decoder to be registered before\n decompression.\n\n @param desc The description of the encoder.\n\n @returns The new node ID, or an error."]
5160 pub fn ZL_Compressor_registerVOEncoder2(
5161 compressor: *mut ZL_Compressor,
5162 desc: *const ZL_VOEncoderDesc,
5163 ) -> ZL_Result_ZL_NodeID;
5164}
5165extern "C" {
5166 pub fn ZL_Compressor_registerVOEncoder(
5167 cgraph: *mut ZL_Compressor,
5168 ctd: *const ZL_VOEncoderDesc,
5169 ) -> ZL_NodeID;
5170}
5171pub type ZL_MIEncoderFn = ::std::option::Option<
5172 unsafe extern "C" fn(
5173 eictx: *mut ZL_Encoder,
5174 inputs: *mut *const ZL_Input,
5175 nbInputs: usize,
5176 ) -> ZL_Report,
5177>;
5178#[repr(C)]
5179#[derive(Debug, Copy, Clone)]
5180pub struct ZL_MIGraphDesc {
5181 pub CTid: ZL_IDType,
5182 pub inputTypes: *const ZL_Type,
5183 pub nbInputs: usize,
5184 pub lastInputIsVariable: ::std::os::raw::c_int,
5185 pub soTypes: *const ZL_Type,
5186 pub nbSOs: usize,
5187 pub voTypes: *const ZL_Type,
5188 pub nbVOs: usize,
5189}
5190#[test]
5191fn bindgen_test_layout_ZL_MIGraphDesc() {
5192 const UNINIT: ::std::mem::MaybeUninit<ZL_MIGraphDesc> = ::std::mem::MaybeUninit::uninit();
5193 let ptr = UNINIT.as_ptr();
5194 assert_eq!(
5195 ::std::mem::size_of::<ZL_MIGraphDesc>(),
5196 64usize,
5197 "Size of ZL_MIGraphDesc"
5198 );
5199 assert_eq!(
5200 ::std::mem::align_of::<ZL_MIGraphDesc>(),
5201 8usize,
5202 "Alignment of ZL_MIGraphDesc"
5203 );
5204 assert_eq!(
5205 unsafe { ::std::ptr::addr_of!((*ptr).CTid) as usize - ptr as usize },
5206 0usize,
5207 "Offset of field: ZL_MIGraphDesc::CTid"
5208 );
5209 assert_eq!(
5210 unsafe { ::std::ptr::addr_of!((*ptr).inputTypes) as usize - ptr as usize },
5211 8usize,
5212 "Offset of field: ZL_MIGraphDesc::inputTypes"
5213 );
5214 assert_eq!(
5215 unsafe { ::std::ptr::addr_of!((*ptr).nbInputs) as usize - ptr as usize },
5216 16usize,
5217 "Offset of field: ZL_MIGraphDesc::nbInputs"
5218 );
5219 assert_eq!(
5220 unsafe { ::std::ptr::addr_of!((*ptr).lastInputIsVariable) as usize - ptr as usize },
5221 24usize,
5222 "Offset of field: ZL_MIGraphDesc::lastInputIsVariable"
5223 );
5224 assert_eq!(
5225 unsafe { ::std::ptr::addr_of!((*ptr).soTypes) as usize - ptr as usize },
5226 32usize,
5227 "Offset of field: ZL_MIGraphDesc::soTypes"
5228 );
5229 assert_eq!(
5230 unsafe { ::std::ptr::addr_of!((*ptr).nbSOs) as usize - ptr as usize },
5231 40usize,
5232 "Offset of field: ZL_MIGraphDesc::nbSOs"
5233 );
5234 assert_eq!(
5235 unsafe { ::std::ptr::addr_of!((*ptr).voTypes) as usize - ptr as usize },
5236 48usize,
5237 "Offset of field: ZL_MIGraphDesc::voTypes"
5238 );
5239 assert_eq!(
5240 unsafe { ::std::ptr::addr_of!((*ptr).nbVOs) as usize - ptr as usize },
5241 56usize,
5242 "Offset of field: ZL_MIGraphDesc::nbVOs"
5243 );
5244}
5245#[repr(C)]
5246#[derive(Debug, Copy, Clone)]
5247pub struct ZL_MIEncoderDesc {
5248 pub gd: ZL_MIGraphDesc,
5249 pub transform_f: ZL_MIEncoderFn,
5250 pub localParams: ZL_LocalParams,
5251 pub name: *const ::std::os::raw::c_char,
5252 pub trStateMgr: ZL_CodecStateManager,
5253 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Encoder_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the compressor."]
5254 pub opaque: ZL_OpaquePtr,
5255 #[doc = " Optional materializer descriptor for materialized local params.\n If both materializeFn and dematerializeFn are non-null, the materializer\n will be used to create materialized objects from local params."]
5256 pub materializer: ZL_MaterializerDesc,
5257 #[doc = " Optional materializer descriptor for materialized dicts.\n If both materializeFn and dematerializeFn are non-null, the materializer\n will be used to create materialized objects. Create a node with\n materialization using ZL_Compressor_parameterizeNode()."]
5258 pub dictMat: ZL_MaterializerDesc2,
5259 #[doc = " Optional dictionary ID associated with this encoder.\n When set, identifies the dictionary that this encoder requires.\n A zero-initialized value (ZL_DICT_ID_NULL) means no dictionary is\n associated."]
5260 pub dictID: ZL_DictID,
5261 #[doc = " Optional materializer for compression-only materialized parameters\n (MParams). If materializeFn is non-null, it will be called during\n compressor deserialization to create the materialized object from\n the serialized MParam blob. Unlike dicts, MParams are NOT required\n at decompression time."]
5262 pub mparamMat: ZL_MaterializerDesc2,
5263 #[doc = " Optional MParam associated with this encoder. The provided content blob\n will be materialized as dictated by @p mparamMat . OpenZL will not take\n ownership of the content provided. The caller is free to free the buffer\n anytime after registering the MIEncoder with\n ZL_Compressor_registerMIEncoder()."]
5264 pub mparam: ZL_MParam,
5265}
5266#[test]
5267fn bindgen_test_layout_ZL_MIEncoderDesc() {
5268 const UNINIT: ::std::mem::MaybeUninit<ZL_MIEncoderDesc> = ::std::mem::MaybeUninit::uninit();
5269 let ptr = UNINIT.as_ptr();
5270 assert_eq!(
5271 ::std::mem::size_of::<ZL_MIEncoderDesc>(),
5272 368usize,
5273 "Size of ZL_MIEncoderDesc"
5274 );
5275 assert_eq!(
5276 ::std::mem::align_of::<ZL_MIEncoderDesc>(),
5277 8usize,
5278 "Alignment of ZL_MIEncoderDesc"
5279 );
5280 assert_eq!(
5281 unsafe { ::std::ptr::addr_of!((*ptr).gd) as usize - ptr as usize },
5282 0usize,
5283 "Offset of field: ZL_MIEncoderDesc::gd"
5284 );
5285 assert_eq!(
5286 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
5287 64usize,
5288 "Offset of field: ZL_MIEncoderDesc::transform_f"
5289 );
5290 assert_eq!(
5291 unsafe { ::std::ptr::addr_of!((*ptr).localParams) as usize - ptr as usize },
5292 72usize,
5293 "Offset of field: ZL_MIEncoderDesc::localParams"
5294 );
5295 assert_eq!(
5296 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
5297 120usize,
5298 "Offset of field: ZL_MIEncoderDesc::name"
5299 );
5300 assert_eq!(
5301 unsafe { ::std::ptr::addr_of!((*ptr).trStateMgr) as usize - ptr as usize },
5302 128usize,
5303 "Offset of field: ZL_MIEncoderDesc::trStateMgr"
5304 );
5305 assert_eq!(
5306 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
5307 152usize,
5308 "Offset of field: ZL_MIEncoderDesc::opaque"
5309 );
5310 assert_eq!(
5311 unsafe { ::std::ptr::addr_of!((*ptr).materializer) as usize - ptr as usize },
5312 176usize,
5313 "Offset of field: ZL_MIEncoderDesc::materializer"
5314 );
5315 assert_eq!(
5316 unsafe { ::std::ptr::addr_of!((*ptr).dictMat) as usize - ptr as usize },
5317 208usize,
5318 "Offset of field: ZL_MIEncoderDesc::dictMat"
5319 );
5320 assert_eq!(
5321 unsafe { ::std::ptr::addr_of!((*ptr).dictID) as usize - ptr as usize },
5322 248usize,
5323 "Offset of field: ZL_MIEncoderDesc::dictID"
5324 );
5325 assert_eq!(
5326 unsafe { ::std::ptr::addr_of!((*ptr).mparamMat) as usize - ptr as usize },
5327 280usize,
5328 "Offset of field: ZL_MIEncoderDesc::mparamMat"
5329 );
5330 assert_eq!(
5331 unsafe { ::std::ptr::addr_of!((*ptr).mparam) as usize - ptr as usize },
5332 320usize,
5333 "Offset of field: ZL_MIEncoderDesc::mparam"
5334 );
5335}
5336extern "C" {
5337 #[doc = " Register a custom encoder that can be used to compress.\n\n @note This is a new variant of @ref ZL_Compressor_registerMIEncoder that\n reports errors using OpenZL's ZL_Report error system.\n\n @warning Using a custom encoder requires the decoder to be registered before\n decompression.\n\n @param desc The description of the encoder.\n\n @returns The new node ID, or an error."]
5338 pub fn ZL_Compressor_registerMIEncoder2(
5339 compressor: *mut ZL_Compressor,
5340 desc: *const ZL_MIEncoderDesc,
5341 ) -> ZL_Result_ZL_NodeID;
5342}
5343extern "C" {
5344 pub fn ZL_Compressor_registerMIEncoder(
5345 cgraph: *mut ZL_Compressor,
5346 ctd: *const ZL_MIEncoderDesc,
5347 ) -> ZL_NodeID;
5348}
5349extern "C" {
5350 #[doc = " Registration might fail, for example if the Descriptor is incorrectly filled.\n In which case, the returned nodeid is ZL_NODE_ILLEGAL.\n Any further operation attempted with such a Node will also fail.\n Such an outcome can be tested with ZL_NodeID_isValid().\n Note: this is mostly for debugging,\n once a Descriptor is valid, registration can be assumed to remain successful."]
5351 pub fn ZL_NodeID_isValid(nodeid: ZL_NodeID) -> ::std::os::raw::c_int;
5352}
5353extern "C" {
5354 pub fn ZL_Encoder_getCParam(eic: *const ZL_Encoder, gparam: ZL_CParam)
5355 -> ::std::os::raw::c_int;
5356}
5357extern "C" {
5358 pub fn ZL_Encoder_getLocalIntParam(
5359 eic: *const ZL_Encoder,
5360 intParamId: ::std::os::raw::c_int,
5361 ) -> ZL_IntParam;
5362}
5363extern "C" {
5364 pub fn ZL_Encoder_getLocalParam(
5365 eic: *const ZL_Encoder,
5366 paramId: ::std::os::raw::c_int,
5367 ) -> ZL_RefParam;
5368}
5369extern "C" {
5370 pub fn ZL_Encoder_getLocalCopyParam(
5371 eic: *const ZL_Encoder,
5372 copyParamId: ::std::os::raw::c_int,
5373 ) -> ZL_CopyParam;
5374}
5375extern "C" {
5376 pub fn ZL_Encoder_getLocalIntParams(eic: *const ZL_Encoder) -> ZL_LocalIntParams;
5377}
5378extern "C" {
5379 pub fn ZL_Encoder_getLocalParams(eic: *const ZL_Encoder) -> *const ZL_LocalParams;
5380}
5381extern "C" {
5382 #[doc = " @returns The materialized dictionary object associated with this node, if\n there is one. Otherwise NULL."]
5383 pub fn ZL_Encoder_getMaterializedDict(
5384 eictx: *const ZL_Encoder,
5385 ) -> *const ::std::os::raw::c_void;
5386}
5387extern "C" {
5388 #[doc = " @returns The materialized MParam object associated with this node, if\n there is one. Otherwise NULL. MParams are compression-only resources\n that are not required at decompression time."]
5389 pub fn ZL_Encoder_getMParam(eictx: *const ZL_Encoder) -> *const ::std::os::raw::c_void;
5390}
5391extern "C" {
5392 pub fn ZL_Encoder_getScratchSpace(
5393 eic: *mut ZL_Encoder,
5394 size: usize,
5395 ) -> *mut ::std::os::raw::c_void;
5396}
5397extern "C" {
5398 pub fn ZL_Encoder_createTypedStream(
5399 eic: *mut ZL_Encoder,
5400 outcomeIndex: ::std::os::raw::c_int,
5401 eltsCapacity: usize,
5402 eltWidth: usize,
5403 ) -> *mut ZL_Output;
5404}
5405extern "C" {
5406 pub fn ZL_Encoder_createStringStream(
5407 eic: *mut ZL_Encoder,
5408 outcomeIndex: ::std::os::raw::c_int,
5409 nbStringsMax: usize,
5410 sumStringLensMax: usize,
5411 ) -> *mut ZL_Output;
5412}
5413extern "C" {
5414 pub fn ZL_Encoder_sendCodecHeader(
5415 ei: *mut ZL_Encoder,
5416 trh: *const ::std::os::raw::c_void,
5417 trhSize: usize,
5418 );
5419}
5420extern "C" {
5421 #[doc = " @returns Returns a state, as generated by the Transform's State Manager.\n The state's lifetime is managed by the host CCtx, it will be free\n automatically at end of CCtx lifetime (and can't be forcefully free\n manually). The state may be cached from a previous run with a compatible\n transform (same state signature)."]
5422 pub fn ZL_Encoder_getState(ei: *mut ZL_Encoder) -> *mut ::std::os::raw::c_void;
5423}
5424extern "C" {
5425 #[doc = " @returns The opaque pointer provided in the transform description.\n @warning Usage of the opaque pointer must be thread-safe, and must\n not not modify the state in any way that impacts encoding!"]
5426 pub fn ZL_Encoder_getOpaquePtr(eictx: *const ZL_Encoder) -> *const ::std::os::raw::c_void;
5427}
5428extern "C" {
5429 #[doc = " @brief Decompresses a frame hosting a single serialized output.\n\n @param dst Destination buffer for decompressed data\n @param dstCapacity Size of destination buffer in bytes\n @param src Source compressed data\n @param srcSize Size of source data in bytes\n @return Either an error (check with ZL_isError()) or decompressed size on\n success"]
5430 pub fn ZL_decompress(
5431 dst: *mut ::std::os::raw::c_void,
5432 dstCapacity: usize,
5433 src: *const ::std::os::raw::c_void,
5434 srcSize: usize,
5435 ) -> ZL_Report;
5436}
5437extern "C" {
5438 #[doc = " @brief Gets the decompressed size of content from a single-output frame.\n\n Useful to determine the size of buffer to allocate.\n\n @param compressed Pointer to compressed data\n @param cSize Size of compressed frame\nor at a minimum the size of the complete frame header\n @return Decompressed size in bytes, or error code\n\n @note Huge content sizes (> 4 GB) can't be represented on 32-bit systems\n @note For String type, @return size of all strings concatenated"]
5439 pub fn ZL_getDecompressedSize(
5440 compressed: *const ::std::os::raw::c_void,
5441 cSize: usize,
5442 ) -> ZL_Report;
5443}
5444extern "C" {
5445 #[doc = " @brief Gets the size of the compressed frame.\n This method could be useful when the compressed frame only represents\n a first portion of a larger buffer.\n\n @param compressed Pointer to compressed data.\n Must point at the start of a compressed frame.\n @param testedSize Size of data @p compressed points to.\n To be useful, at a minimum, this size must be:\n - frame header + chunk header for version < ZL_CHUNK_VERSION_MIN.\n - >= compressedSize for frames of versions >= ZL_CHUNK_VERSION_MIN.\n @return Compressed frame size in bytes, or error code\n\n @note Huge content sizes (> 4 GB) can't be represented on 32-bit systems"]
5446 pub fn ZL_getCompressedSize(
5447 compressed: *const ::std::os::raw::c_void,
5448 testedSize: usize,
5449 ) -> ZL_Report;
5450}
5451extern "C" {
5452 #[doc = " @brief Creates a new decompression context.\n\n @return Pointer to new context, or NULL on error"]
5453 pub fn ZL_DCtx_create() -> *mut ZL_DCtx;
5454}
5455extern "C" {
5456 #[doc = " @brief Frees a decompression context.\n\n @param dctx Decompression context to free"]
5457 pub fn ZL_DCtx_free(dctx: *mut ZL_DCtx);
5458}
5459#[doc = " @brief Keep parameters across decompression sessions.\n\n By default, parameters are reset between decompression sessions.\n Setting this parameter to 1 keeps the parameters across sessions."]
5460pub const ZL_DParam_stickyParameters: ZL_DParam = 1;
5461#[doc = " @brief Enable checking the checksum of the compressed frame.\n\n The following two parameters control whether checksums are checked during\n decompression. These checks can be disabled to achieve faster speeds in\n exchange for the risk of data corruption going unnoticed.\n\n Disabling these checks is more effective when decompression speed is\n already fast. Expected improvements: ~20-30% for speeds > 2GB/s, 10-15%\n for speeds between 1GB/s and 2GB/s, and 1-5% for speeds < 1GB/s.\n\n Valid values use the ZS2_GPARAM_* format.\n @note Default 0 currently means check the checksum, might change in\n future"]
5462pub const ZL_DParam_checkCompressedChecksum: ZL_DParam = 2;
5463#[doc = " @brief Enable checking the checksum of the uncompressed content.\n\n Valid values use the ZS2_GPARAM_* format.\n @note Default 0 currently means check the checksum, might change in\n future"]
5464pub const ZL_DParam_checkContentChecksum: ZL_DParam = 3;
5465#[doc = " @brief Enable codec fusion during decompression.\n\n Codec fusion combines multiple adjacent codec nodes into a single\n optimized decoder. Setting this to ZL_TernaryParam_disable causes each\n codec in the graph to be decoded individually, which can be useful for\n debugging or testing codec correctness without fusion.\n\n Valid values use the ZL_TernaryParam format defaulting to enabled."]
5466pub const ZL_DParam_enableCodecFusion: ZL_DParam = 4;
5467#[doc = " @brief Global decompression parameters."]
5468pub type ZL_DParam = ::std::os::raw::c_uint;
5469extern "C" {
5470 #[doc = " @brief Sets global parameters via the decompression context.\n\n @param dctx Decompression context\n @param gdparam Parameter to set\n @param value Value to set for the parameter\n @return Error code or success\n\n @note By default, parameters are reset at end of decompression session.\n To preserve them across sessions, set stickyParameters=1"]
5471 pub fn ZL_DCtx_setParameter(
5472 dctx: *mut ZL_DCtx,
5473 gdparam: ZL_DParam,
5474 value: ::std::os::raw::c_int,
5475 ) -> ZL_Report;
5476}
5477extern "C" {
5478 #[doc = " @brief Reads a parameter's configured value in the decompression context.\n\n @param dctx Decompression context\n @param gdparam Parameter to query\n @return The value set for the given parameter, or 0 if unset/nonexistent"]
5479 pub fn ZL_DCtx_getParameter(dctx: *const ZL_DCtx, gdparam: ZL_DParam) -> ::std::os::raw::c_int;
5480}
5481extern "C" {
5482 #[doc = " @brief Resets parameters selection from a blank slate.\n\n Useful when unsure if ZL_DParam_stickyParameters is set to 1.\n\n @param dctx Decompression context\n @return Error code or success"]
5483 pub fn ZL_DCtx_resetParameters(dctx: *mut ZL_DCtx) -> ZL_Report;
5484}
5485extern "C" {
5486 pub fn ZL_DCtx_setStreamArena(dctx: *mut ZL_DCtx, sat: ZL_DataArenaType) -> ZL_Report;
5487}
5488extern "C" {
5489 #[doc = " @brief Gets a verbose error string containing context about the error.\n\n Useful for debugging and submitting bug reports to OpenZL developers.\n\n @param dctx Decompression context\n @param report Error report to get context for\n @return Error context string\n\n @note String is stored within the dctx and is only valid for the lifetime of\n the dctx"]
5490 pub fn ZL_DCtx_getErrorContextString(
5491 dctx: *const ZL_DCtx,
5492 report: ZL_Report,
5493 ) -> *const ::std::os::raw::c_char;
5494}
5495extern "C" {
5496 #[doc = " @brief Gets error context string from error code.\n\n @param dctx Decompression context\n @param error Error code to get context for\n @return Error context string\n\n @note String is stored within the dctx and is only valid for the lifetime of\n the dctx"]
5497 pub fn ZL_DCtx_getErrorContextString_fromError(
5498 dctx: *const ZL_DCtx,
5499 error: ZL_Error,
5500 ) -> *const ::std::os::raw::c_char;
5501}
5502extern "C" {
5503 #[doc = " @brief Gets the array of warnings from the previous operation.\n\n @param dctx Decompression context\n @return Array of warnings encountered during the previous operation\n\n @note Array and errors' lifetimes are valid until the next non-const call on\n the DCtx"]
5504 pub fn ZL_DCtx_getWarnings(dctx: *const ZL_DCtx) -> ZL_Error_Array;
5505}
5506extern "C" {
5507 #[doc = " @brief Decompresses data with explicit state management.\n\n Same as ZL_decompress(), but with explicit state management.\n The state can be used to store advanced parameters.\n\n @param dctx Decompression context\n @param dst Destination buffer for decompressed data\n @param dstCapacity Size of destination buffer in bytes\n @param compressed Source compressed data\n @param cSize Size of compressed data in bytes\n @return Error code or decompressed size on success"]
5508 pub fn ZL_DCtx_decompress(
5509 dctx: *mut ZL_DCtx,
5510 dst: *mut ::std::os::raw::c_void,
5511 dstCapacity: usize,
5512 compressed: *const ::std::os::raw::c_void,
5513 cSize: usize,
5514 ) -> ZL_Report;
5515}
5516extern "C" {
5517 #[doc = " @brief Gets the number of outputs stored in a compressed frame.\n\n Doesn't need the whole frame, just enough to read the requested information.\n\n @param compressed Pointer to compressed data\n @param cSize Size of compressed data\n @return Number of outputs, or error on failure (invalid frame, size too\n small, etc.)"]
5518 pub fn ZL_getNumOutputs(compressed: *const ::std::os::raw::c_void, cSize: usize) -> ZL_Report;
5519}
5520extern "C" {
5521 #[doc = " @brief Gets the output type for single-output frames.\n\n Only works for single-output frames. Provides the type of the single output.\n\n @param stPtr Pointer to store the output type\n @param compressed Pointer to compressed data\n @param cSize Size of compressed data\n @return Error code or success\n\n @note Only works for single-output frames"]
5522 pub fn ZL_getOutputType(
5523 stPtr: *mut ZL_Type,
5524 compressed: *const ::std::os::raw::c_void,
5525 cSize: usize,
5526 ) -> ZL_Report;
5527}
5528#[repr(C)]
5529#[derive(Debug, Copy, Clone)]
5530pub struct ZL_FrameInfo {
5531 _unused: [u8; 0],
5532}
5533extern "C" {
5534 #[doc = " @brief Creates a frame information object from compressed data.\n\n @param compressed Pointer to compressed data\n @param cSize Size of compressed data\n @return Pointer to frame info object, or NULL on error"]
5535 pub fn ZL_FrameInfo_create(
5536 compressed: *const ::std::os::raw::c_void,
5537 cSize: usize,
5538 ) -> *mut ZL_FrameInfo;
5539}
5540extern "C" {
5541 #[doc = " @brief Frees a frame information object.\n\n @param fi Frame information object to free"]
5542 pub fn ZL_FrameInfo_free(fi: *mut ZL_FrameInfo);
5543}
5544extern "C" {
5545 #[doc = " @brief Gets the format version of the frame.\n\n @param fi Frame information object\n @return The version number, or error if unsupported or invalid"]
5546 pub fn ZL_FrameInfo_getFormatVersion(fi: *const ZL_FrameInfo) -> ZL_Report;
5547}
5548extern "C" {
5549 #[doc = " @brief Gets the number of regenerated outputs on decompression.\n\n @param fi Frame information object\n @return The number of outputs on decompression"]
5550 pub fn ZL_FrameInfo_getNumOutputs(fi: *const ZL_FrameInfo) -> ZL_Report;
5551}
5552extern "C" {
5553 #[doc = " @brief Gets the output type for a specific output ID.\n\n @param fi Frame information object\n @param outputID Output ID (starts at 0, single output has ID 0)\n @return Output type, or error code"]
5554 pub fn ZL_FrameInfo_getOutputType(
5555 fi: *const ZL_FrameInfo,
5556 outputID: ::std::os::raw::c_int,
5557 ) -> ZL_Report;
5558}
5559extern "C" {
5560 #[doc = " @brief Gets the decompressed size of a specific output.\n\n @param fi Frame information object\n @param outputID Output ID (starts at 0)\n @return Size of specified output in bytes, or error code"]
5561 pub fn ZL_FrameInfo_getDecompressedSize(
5562 fi: *const ZL_FrameInfo,
5563 outputID: ::std::os::raw::c_int,
5564 ) -> ZL_Report;
5565}
5566extern "C" {
5567 #[doc = " @brief Gets the number of elements in a specific output.\n\n @param fi Frame information object\n @param outputID Output ID (starts at 0)\n @return Number of elements in specified output, or error code"]
5568 pub fn ZL_FrameInfo_getNumElts(
5569 fi: *const ZL_FrameInfo,
5570 outputID: ::std::os::raw::c_int,
5571 ) -> ZL_Report;
5572}
5573#[repr(C)]
5574#[derive(Debug, Copy, Clone)]
5575pub struct ZL_Result_ZL_Comment_inner {
5576 pub _code: ZL_ErrorCode,
5577 pub _value: ZL_Comment,
5578}
5579#[test]
5580fn bindgen_test_layout_ZL_Result_ZL_Comment_inner() {
5581 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_Comment_inner> =
5582 ::std::mem::MaybeUninit::uninit();
5583 let ptr = UNINIT.as_ptr();
5584 assert_eq!(
5585 ::std::mem::size_of::<ZL_Result_ZL_Comment_inner>(),
5586 24usize,
5587 "Size of ZL_Result_ZL_Comment_inner"
5588 );
5589 assert_eq!(
5590 ::std::mem::align_of::<ZL_Result_ZL_Comment_inner>(),
5591 8usize,
5592 "Alignment of ZL_Result_ZL_Comment_inner"
5593 );
5594 assert_eq!(
5595 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
5596 0usize,
5597 "Offset of field: ZL_Result_ZL_Comment_inner::_code"
5598 );
5599 assert_eq!(
5600 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
5601 8usize,
5602 "Offset of field: ZL_Result_ZL_Comment_inner::_value"
5603 );
5604}
5605#[repr(C)]
5606#[derive(Copy, Clone)]
5607pub union ZL_Result_ZL_Comment_u {
5608 pub _code: ZL_ErrorCode,
5609 pub _value: ZL_Result_ZL_Comment_inner,
5610 pub _error: ZL_Error,
5611}
5612#[test]
5613fn bindgen_test_layout_ZL_Result_ZL_Comment_u() {
5614 const UNINIT: ::std::mem::MaybeUninit<ZL_Result_ZL_Comment_u> =
5615 ::std::mem::MaybeUninit::uninit();
5616 let ptr = UNINIT.as_ptr();
5617 assert_eq!(
5618 ::std::mem::size_of::<ZL_Result_ZL_Comment_u>(),
5619 24usize,
5620 "Size of ZL_Result_ZL_Comment_u"
5621 );
5622 assert_eq!(
5623 ::std::mem::align_of::<ZL_Result_ZL_Comment_u>(),
5624 8usize,
5625 "Alignment of ZL_Result_ZL_Comment_u"
5626 );
5627 assert_eq!(
5628 unsafe { ::std::ptr::addr_of!((*ptr)._code) as usize - ptr as usize },
5629 0usize,
5630 "Offset of field: ZL_Result_ZL_Comment_u::_code"
5631 );
5632 assert_eq!(
5633 unsafe { ::std::ptr::addr_of!((*ptr)._value) as usize - ptr as usize },
5634 0usize,
5635 "Offset of field: ZL_Result_ZL_Comment_u::_value"
5636 );
5637 assert_eq!(
5638 unsafe { ::std::ptr::addr_of!((*ptr)._error) as usize - ptr as usize },
5639 0usize,
5640 "Offset of field: ZL_Result_ZL_Comment_u::_error"
5641 );
5642}
5643pub type ZL_Result_ZL_Comment = ZL_Result_ZL_Comment_u;
5644extern "C" {
5645 #[link_name = "ZL_Result_ZL_Comment_extract__extern"]
5646 pub fn ZL_Result_ZL_Comment_extract(
5647 result: ZL_Result_ZL_Comment,
5648 error: *mut ZL_Error,
5649 ) -> ZL_Comment;
5650}
5651pub type ZL_Result_ZL_Comment_fake_type_needs_semicolon = ::std::os::raw::c_int;
5652extern "C" {
5653 #[doc = " @brief Gets the comment stored in the FrameInfo.\n\n @returns The comment or an error. If no comment is present it\n returns a comment with `size == 0`. The buffer returned is owned by @p zfi"]
5654 pub fn ZL_FrameInfo_getComment(zfi: *const ZL_FrameInfo) -> ZL_Result_ZL_Comment;
5655}
5656#[doc = " @brief Information about a decompressed typed output."]
5657#[repr(C)]
5658#[derive(Debug, Copy, Clone)]
5659pub struct ZL_OutputInfo {
5660 #[doc = "< Type of the output"]
5661 pub type_: ZL_Type,
5662 #[doc = "< width of elements in bytes"]
5663 pub fixedWidth: u32,
5664 #[doc = "< Decompressed size in bytes"]
5665 pub decompressedByteSize: u64,
5666 #[doc = "< Number of elements"]
5667 pub numElts: u64,
5668}
5669#[test]
5670fn bindgen_test_layout_ZL_OutputInfo() {
5671 const UNINIT: ::std::mem::MaybeUninit<ZL_OutputInfo> = ::std::mem::MaybeUninit::uninit();
5672 let ptr = UNINIT.as_ptr();
5673 assert_eq!(
5674 ::std::mem::size_of::<ZL_OutputInfo>(),
5675 24usize,
5676 "Size of ZL_OutputInfo"
5677 );
5678 assert_eq!(
5679 ::std::mem::align_of::<ZL_OutputInfo>(),
5680 8usize,
5681 "Alignment of ZL_OutputInfo"
5682 );
5683 assert_eq!(
5684 unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
5685 0usize,
5686 "Offset of field: ZL_OutputInfo::type_"
5687 );
5688 assert_eq!(
5689 unsafe { ::std::ptr::addr_of!((*ptr).fixedWidth) as usize - ptr as usize },
5690 4usize,
5691 "Offset of field: ZL_OutputInfo::fixedWidth"
5692 );
5693 assert_eq!(
5694 unsafe { ::std::ptr::addr_of!((*ptr).decompressedByteSize) as usize - ptr as usize },
5695 8usize,
5696 "Offset of field: ZL_OutputInfo::decompressedByteSize"
5697 );
5698 assert_eq!(
5699 unsafe { ::std::ptr::addr_of!((*ptr).numElts) as usize - ptr as usize },
5700 16usize,
5701 "Offset of field: ZL_OutputInfo::numElts"
5702 );
5703}
5704extern "C" {
5705 #[doc = " @brief Decompresses typed content from frames with a single typed output\n into a pre-allocated buffer @p dst .\n Information about output type is written into @p outputInfo .\n\n @param dctx Decompression context\n @param outputInfo Output metadata filled on success\n @param dst Destination buffer (must be large enough)\n @param dstByteCapacity Size of destination buffer in bytes\n @param compressed Pointer to compressed data\n @param cSize Size of compressed data in bytes\n @return Error code or success\n\n @note Only works for frames with a single typed output,\n and even then, does not work for String type.\n @note For Numeric type, dst must be correctly aligned (if unknown, assume\n 64-bit numeric)\n @note Numeric values are written using host's endianness\n @note On error, @p outputInfo content is undefined and should not be read"]
5706 pub fn ZL_DCtx_decompressTyped(
5707 dctx: *mut ZL_DCtx,
5708 outputInfo: *mut ZL_OutputInfo,
5709 dst: *mut ::std::os::raw::c_void,
5710 dstByteCapacity: usize,
5711 compressed: *const ::std::os::raw::c_void,
5712 cSize: usize,
5713 ) -> ZL_Report;
5714}
5715#[doc = " @brief Typed buffer object that can own and auto-size their buffers.\n\n TypedBuffer uses standard C malloc/free to allocate buffers.\n Future versions could allow insertion of a custom allocator."]
5716pub type ZL_TypedBuffer = ZL_Output;
5717extern "C" {
5718 #[doc = " @brief Creates an empty typed buffer object.\n\n On creation, the TypedBuffer object is empty.\n By default, when provided as an empty shell,\n it will automatically allocate and fill its own buffer\n during invocation of ZL_DCtx_decompressTBuffer().\n A TypedBuffer object is not reusable and must be freed after usage.\n Releasing the object also releases its owned buffers.\n\n @return Pointer to new typed buffer, or NULL on error"]
5719 pub fn ZL_TypedBuffer_create() -> *mut ZL_TypedBuffer;
5720}
5721extern "C" {
5722 #[doc = " @brief Frees a typed buffer object.\n\n @param tbuffer Typed buffer to free"]
5723 pub fn ZL_TypedBuffer_free(tbuffer: *mut ZL_TypedBuffer);
5724}
5725extern "C" {
5726 #[doc = " @brief Creates a pre-allocated typed buffer for serial data.\n\n The object will use the referenced buffer, and not allocate its own one.\n It will be filled during invocation of ZL_DCtx_decompressTBuffer().\n Releasing the ZL_TypedBuffer object will not release the referenced buffer.\n\n @param buffer buffer to write into\n @param bufferCapacity maximum size to write into buffer\n @return Pointer to wrapped typed buffer, or NULL on error"]
5727 pub fn ZL_TypedBuffer_createWrapSerial(
5728 buffer: *mut ::std::os::raw::c_void,
5729 bufferCapacity: usize,
5730 ) -> *mut ZL_TypedBuffer;
5731}
5732extern "C" {
5733 #[doc = " @brief Creates a pre-allocated typed buffer for struct data.\n\n @param structBuffer buffer to write struct into.\n Its size must be at least @p structWidth * @p structCapacity\n @param structWidth Width of each struct in bytes\n @param structCapacity Maximum number of struct that can be written into @p\n structBuffer\n @return Pointer to wrapped typed buffer, or NULL on error"]
5734 pub fn ZL_TypedBuffer_createWrapStruct(
5735 structBuffer: *mut ::std::os::raw::c_void,
5736 structWidth: usize,
5737 numStructs: usize,
5738 ) -> *mut ZL_TypedBuffer;
5739}
5740extern "C" {
5741 #[doc = " @brief Creates a pre-allocated typed buffer for numeric data.\n\n @param numArray buffer to write the array of numeric values into\n The array size must be >= @p numWidth * @p numCapacity.\n It must also be correctly aligned for the numeric width requested.\n @param numWidth Width of numeric values in bytes\n @param numCapacity Maximum number of numeric value that can be written into\n @p numArray\n @return Pointer to wrapped typed buffer, or NULL on error"]
5742 pub fn ZL_TypedBuffer_createWrapNumeric(
5743 numArray: *mut ::std::os::raw::c_void,
5744 numWidth: usize,
5745 numCapacity: usize,
5746 ) -> *mut ZL_TypedBuffer;
5747}
5748extern "C" {
5749 #[doc = " @brief Creates a pre-allocated ZL_TypedBuffer for String data.\n\n @param stringBuffer The buffer where the concatenation of all Strings will be\n written.\n @param stringBufferCapacity Size of stringBuffer\n @param lenBuffer Buffer for the array of lengths, which are 32-bit unsigned.\n @param maxNumStrings Maximum number of strings that can be written.\n @return Pointer to wrapped typed buffer, or NULL on error"]
5750 pub fn ZL_TypedBuffer_createWrapString(
5751 stringBuffer: *mut ::std::os::raw::c_void,
5752 stringBufferCapacity: usize,
5753 lenBuffer: *mut u32,
5754 maxNumStrings: usize,
5755 ) -> *mut ZL_TypedBuffer;
5756}
5757extern "C" {
5758 #[doc = " @brief Decompresses a frame with a single typed output into a TypedBuffer.\n\n This prototype works for frames with a single typed output only.\n Data will be decompressed into the output buffer.\n\n @param dctx Decompression context\n @param output TypedBuffer object (must be created first)\n @param compressed Pointer to compressed data\n @param cSize Size of compressed data in bytes\n @return Error code or size in bytes of the main buffer inside output\n\n @note Output is filled on success, but undefined on error, and can only be\n free() in this case.\n @note ZL_TypedBuffer object is required to decompress String type"]
5759 pub fn ZL_DCtx_decompressTBuffer(
5760 dctx: *mut ZL_DCtx,
5761 output: *mut ZL_TypedBuffer,
5762 compressed: *const ::std::os::raw::c_void,
5763 cSize: usize,
5764 ) -> ZL_Report;
5765}
5766extern "C" {
5767 #[doc = " @brief Decompresses a frame into multiple TypedBuffers.\n\n @param dctx Decompression context\n @param outputs Array of ZL_TypedBuffer* objects (must be created using\n ZL_TypedBuffer_create or pre-allocated creation methods)\n @param nbOutputs Exact number of outputs expected from the frame\n (can be obtained from ZL_FrameInfo_getNumOutputs())\n @param compressed Pointer to compressed data\n @param cSize Size of compressed data in bytes\n @return Error code or number of decompressed TypedBuffers\n\n @note Requires exact number of outputs (not permissive)\n @note @p outputs are filled on success, but undefined on error\n @note TypedBuffer lifetimes are controlled by the caller"]
5768 pub fn ZL_DCtx_decompressMultiTBuffer(
5769 dctx: *mut ZL_DCtx,
5770 outputs: *mut *mut ZL_TypedBuffer,
5771 nbOutputs: usize,
5772 compressed: *const ::std::os::raw::c_void,
5773 cSize: usize,
5774 ) -> ZL_Report;
5775}
5776extern "C" {
5777 #[doc = " @brief Gets the type of the typed buffer.\n\n @param tbuffer Typed buffer object\n @return Type of the buffer"]
5778 pub fn ZL_TypedBuffer_type(tbuffer: *const ZL_TypedBuffer) -> ZL_Type;
5779}
5780extern "C" {
5781 #[doc = " @brief Gets the number of bytes written into the internal buffer.\n\n @param tbuffer Typed buffer object\n @return Number of bytes in the internal buffer.\n\n @note Generally equals eltWidth * nbElts,\n but for String type equals sum(stringLens)\n @note ZL_DCtx_decompressTBuffer() returns the same value"]
5782 pub fn ZL_TypedBuffer_byteSize(tbuffer: *const ZL_TypedBuffer) -> usize;
5783}
5784extern "C" {
5785 #[doc = " @brief Gets direct access to the internal buffer for reading operation.\n\n @param tbuffer Typed buffer object\n @return Pointer to the beginning of buffer (for String type, points at the\n beginning of the first string).\n\n @warning Users must pay attention to buffer boundaries\n @note Buffer size is provided by ZL_TypedBuffer_byteSize()"]
5786 pub fn ZL_TypedBuffer_rPtr(tbuffer: *const ZL_TypedBuffer) -> *const ::std::os::raw::c_void;
5787}
5788extern "C" {
5789 #[doc = " @brief Gets the number of elements in the typed buffer.\n\n @param tbuffer Typed buffer object\n @return Number of elements in the buffer\n\n @note for Serial type, this is the number of bytes."]
5790 pub fn ZL_TypedBuffer_numElts(tbuffer: *const ZL_TypedBuffer) -> usize;
5791}
5792extern "C" {
5793 #[doc = " @brief Gets the size of each element for fixed-size types.\n\n @param tbuffer Typed buffer object\n @return Size of each element in bytes, or 0 for String type\n\n @note Not valid for String type (returns 0)"]
5794 pub fn ZL_TypedBuffer_eltWidth(tbuffer: *const ZL_TypedBuffer) -> usize;
5795}
5796extern "C" {
5797 #[doc = " @brief Gets pointer to the array of string lengths.\n\n @param tbuffer Typed buffer object\n @return Pointer to beginning of string lengths array, or NULL if incorrect\n type\n\n @note **Only valid for String type**\n @note Array size equals ZL_TypedBuffer_numElts()"]
5798 pub fn ZL_TypedBuffer_rStringLens(tbuffer: *const ZL_TypedBuffer) -> *const u32;
5799}
5800extern "C" {
5801 #[doc = " @brief Gets the size of the OpenZL header.\n\n Useful to determine header overhead.\n\n @param src Source compressed data\n @param srcSize Size of source data\n @return Header size in bytes, or error code\n\n @note This is a temporary function, not guaranteed to remain in future\n versions"]
5802 pub fn ZL_getHeaderSize(src: *const ::std::os::raw::c_void, srcSize: usize) -> ZL_Report;
5803}
5804extern "C" {
5805 #[doc = " Attach introspection hooks to the DCtx. Hooks allow code to run at specific\n DWAYPOINTs during decompression. A hook set to NULL will simply be skipped.\n There can only be one set of hooks attached at a time; calling this again\n will overwrite the previous hooks. The caller is responsible for maintaining\n the lifetime of the objects referenced by the hooks.\n\n @note This will only do something if the library is compiled with the\n ALLOW_INTROSPECTION option. Otherwise, all the hooks will be no-ops."]
5806 pub fn ZL_DCtx_attachDecompressIntrospectionHooks(
5807 dctx: *mut ZL_DCtx,
5808 hooks: *const ZL_DecompressIntrospectionHooks,
5809 ) -> ZL_Report;
5810}
5811extern "C" {
5812 #[doc = " Detach any decompression introspection hooks currently attached to the DCtx."]
5813 pub fn ZL_DCtx_detachAllDecompressIntrospectionHooks(dctx: *mut ZL_DCtx) -> ZL_Report;
5814}
5815pub type ZL_DPipeDstCapacityFn = ::std::option::Option<
5816 unsafe extern "C" fn(src: *const ::std::os::raw::c_void, srcSize: usize) -> usize,
5817>;
5818pub type ZL_PipeDecoderFn = ::std::option::Option<
5819 unsafe extern "C" fn(
5820 dst: *mut ::std::os::raw::c_void,
5821 dstCapacity: usize,
5822 src: *const ::std::os::raw::c_void,
5823 srcSize: usize,
5824 ) -> usize,
5825>;
5826#[repr(C)]
5827#[derive(Debug, Copy, Clone)]
5828pub struct ZL_PipeDecoderDesc {
5829 pub CTid: ZL_IDType,
5830 pub dstBound_f: ZL_DPipeDstCapacityFn,
5831 pub transform_f: ZL_PipeDecoderFn,
5832 pub name: *const ::std::os::raw::c_char,
5833}
5834#[test]
5835fn bindgen_test_layout_ZL_PipeDecoderDesc() {
5836 const UNINIT: ::std::mem::MaybeUninit<ZL_PipeDecoderDesc> = ::std::mem::MaybeUninit::uninit();
5837 let ptr = UNINIT.as_ptr();
5838 assert_eq!(
5839 ::std::mem::size_of::<ZL_PipeDecoderDesc>(),
5840 32usize,
5841 "Size of ZL_PipeDecoderDesc"
5842 );
5843 assert_eq!(
5844 ::std::mem::align_of::<ZL_PipeDecoderDesc>(),
5845 8usize,
5846 "Alignment of ZL_PipeDecoderDesc"
5847 );
5848 assert_eq!(
5849 unsafe { ::std::ptr::addr_of!((*ptr).CTid) as usize - ptr as usize },
5850 0usize,
5851 "Offset of field: ZL_PipeDecoderDesc::CTid"
5852 );
5853 assert_eq!(
5854 unsafe { ::std::ptr::addr_of!((*ptr).dstBound_f) as usize - ptr as usize },
5855 8usize,
5856 "Offset of field: ZL_PipeDecoderDesc::dstBound_f"
5857 );
5858 assert_eq!(
5859 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
5860 16usize,
5861 "Offset of field: ZL_PipeDecoderDesc::transform_f"
5862 );
5863 assert_eq!(
5864 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
5865 24usize,
5866 "Offset of field: ZL_PipeDecoderDesc::name"
5867 );
5868}
5869extern "C" {
5870 #[doc = " Register a custom decoder transform, should it be needed during\n decompression of a zstrong frame.\n A decoder transform is expected to reverse the encoding transform of same\n @CTid.\n This function is specialized for the registration of simple pipe decoder\n transforms. Counterpart to ZL_Compressor_registerPipeEncoder()."]
5871 pub fn ZL_DCtx_registerPipeDecoder(
5872 dctx: *mut ZL_DCtx,
5873 dtd: *const ZL_PipeDecoderDesc,
5874 ) -> ZL_Report;
5875}
5876pub type ZL_SplitDstCapacityFn =
5877 ::std::option::Option<unsafe extern "C" fn(src: *const ZL_RBuffer) -> usize>;
5878pub type ZL_SplitDecoderFn =
5879 ::std::option::Option<unsafe extern "C" fn(dst: ZL_WBuffer, src: *const ZL_RBuffer) -> usize>;
5880#[repr(C)]
5881#[derive(Debug, Copy, Clone)]
5882pub struct ZL_SplitDecoderDesc {
5883 pub CTid: ZL_IDType,
5884 pub nbInputStreams: usize,
5885 pub dstBound_f: ZL_SplitDstCapacityFn,
5886 pub transform_f: ZL_SplitDecoderFn,
5887 pub name: *const ::std::os::raw::c_char,
5888}
5889#[test]
5890fn bindgen_test_layout_ZL_SplitDecoderDesc() {
5891 const UNINIT: ::std::mem::MaybeUninit<ZL_SplitDecoderDesc> = ::std::mem::MaybeUninit::uninit();
5892 let ptr = UNINIT.as_ptr();
5893 assert_eq!(
5894 ::std::mem::size_of::<ZL_SplitDecoderDesc>(),
5895 40usize,
5896 "Size of ZL_SplitDecoderDesc"
5897 );
5898 assert_eq!(
5899 ::std::mem::align_of::<ZL_SplitDecoderDesc>(),
5900 8usize,
5901 "Alignment of ZL_SplitDecoderDesc"
5902 );
5903 assert_eq!(
5904 unsafe { ::std::ptr::addr_of!((*ptr).CTid) as usize - ptr as usize },
5905 0usize,
5906 "Offset of field: ZL_SplitDecoderDesc::CTid"
5907 );
5908 assert_eq!(
5909 unsafe { ::std::ptr::addr_of!((*ptr).nbInputStreams) as usize - ptr as usize },
5910 8usize,
5911 "Offset of field: ZL_SplitDecoderDesc::nbInputStreams"
5912 );
5913 assert_eq!(
5914 unsafe { ::std::ptr::addr_of!((*ptr).dstBound_f) as usize - ptr as usize },
5915 16usize,
5916 "Offset of field: ZL_SplitDecoderDesc::dstBound_f"
5917 );
5918 assert_eq!(
5919 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
5920 24usize,
5921 "Offset of field: ZL_SplitDecoderDesc::transform_f"
5922 );
5923 assert_eq!(
5924 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
5925 32usize,
5926 "Offset of field: ZL_SplitDecoderDesc::name"
5927 );
5928}
5929extern "C" {
5930 #[doc = " Register a custom split decoder transform.\n This is supposed to be the reverse of the encoding transform of same @CTid.\n Counterpart to ZS2_registerSplitTransform()."]
5931 pub fn ZL_DCtx_registerSplitDecoder(
5932 dctx: *mut ZL_DCtx,
5933 dtd: *const ZL_SplitDecoderDesc,
5934 ) -> ZL_Report;
5935}
5936pub type ZL_TypedDecoderFn = ::std::option::Option<
5937 unsafe extern "C" fn(dictx: *mut ZL_Decoder, src: *mut *const ZL_Input) -> ZL_Report,
5938>;
5939#[repr(C)]
5940#[derive(Debug, Copy, Clone)]
5941pub struct ZL_TypedDecoderDesc {
5942 pub gd: ZL_TypedGraphDesc,
5943 pub transform_f: ZL_TypedDecoderFn,
5944 pub name: *const ::std::os::raw::c_char,
5945 pub trStateMgr: ZL_CodecStateManager,
5946 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Decoder_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the dctx."]
5947 pub opaque: ZL_OpaquePtr,
5948}
5949#[test]
5950fn bindgen_test_layout_ZL_TypedDecoderDesc() {
5951 const UNINIT: ::std::mem::MaybeUninit<ZL_TypedDecoderDesc> = ::std::mem::MaybeUninit::uninit();
5952 let ptr = UNINIT.as_ptr();
5953 assert_eq!(
5954 ::std::mem::size_of::<ZL_TypedDecoderDesc>(),
5955 88usize,
5956 "Size of ZL_TypedDecoderDesc"
5957 );
5958 assert_eq!(
5959 ::std::mem::align_of::<ZL_TypedDecoderDesc>(),
5960 8usize,
5961 "Alignment of ZL_TypedDecoderDesc"
5962 );
5963 assert_eq!(
5964 unsafe { ::std::ptr::addr_of!((*ptr).gd) as usize - ptr as usize },
5965 0usize,
5966 "Offset of field: ZL_TypedDecoderDesc::gd"
5967 );
5968 assert_eq!(
5969 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
5970 24usize,
5971 "Offset of field: ZL_TypedDecoderDesc::transform_f"
5972 );
5973 assert_eq!(
5974 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
5975 32usize,
5976 "Offset of field: ZL_TypedDecoderDesc::name"
5977 );
5978 assert_eq!(
5979 unsafe { ::std::ptr::addr_of!((*ptr).trStateMgr) as usize - ptr as usize },
5980 40usize,
5981 "Offset of field: ZL_TypedDecoderDesc::trStateMgr"
5982 );
5983 assert_eq!(
5984 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
5985 64usize,
5986 "Offset of field: ZL_TypedDecoderDesc::opaque"
5987 );
5988}
5989extern "C" {
5990 #[doc = " Register a custom typed decoder transform.\n Counterpart to ZS2_registerTypedTransform().\n\n Note: Split transforms and Pipe Transforms\n can be converted into Typed transforms, since it's a strict superset."]
5991 pub fn ZL_DCtx_registerTypedDecoder(
5992 dctx: *mut ZL_DCtx,
5993 dtd: *const ZL_TypedDecoderDesc,
5994 ) -> ZL_Report;
5995}
5996pub type ZL_VODecoderFn = ::std::option::Option<
5997 unsafe extern "C" fn(
5998 dictx: *mut ZL_Decoder,
5999 compulsorySrcs: *mut *const ZL_Input,
6000 nbCompulsorySrcs: usize,
6001 variableSrcs: *mut *const ZL_Input,
6002 nbVariableSrcs: usize,
6003 ) -> ZL_Report,
6004>;
6005#[repr(C)]
6006#[derive(Debug, Copy, Clone)]
6007pub struct ZL_VODecoderDesc {
6008 pub gd: ZL_VOGraphDesc,
6009 pub transform_f: ZL_VODecoderFn,
6010 pub name: *const ::std::os::raw::c_char,
6011 pub trStateMgr: ZL_CodecStateManager,
6012 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Decoder_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the dctx."]
6013 pub opaque: ZL_OpaquePtr,
6014}
6015#[test]
6016fn bindgen_test_layout_ZL_VODecoderDesc() {
6017 const UNINIT: ::std::mem::MaybeUninit<ZL_VODecoderDesc> = ::std::mem::MaybeUninit::uninit();
6018 let ptr = UNINIT.as_ptr();
6019 assert_eq!(
6020 ::std::mem::size_of::<ZL_VODecoderDesc>(),
6021 104usize,
6022 "Size of ZL_VODecoderDesc"
6023 );
6024 assert_eq!(
6025 ::std::mem::align_of::<ZL_VODecoderDesc>(),
6026 8usize,
6027 "Alignment of ZL_VODecoderDesc"
6028 );
6029 assert_eq!(
6030 unsafe { ::std::ptr::addr_of!((*ptr).gd) as usize - ptr as usize },
6031 0usize,
6032 "Offset of field: ZL_VODecoderDesc::gd"
6033 );
6034 assert_eq!(
6035 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
6036 40usize,
6037 "Offset of field: ZL_VODecoderDesc::transform_f"
6038 );
6039 assert_eq!(
6040 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
6041 48usize,
6042 "Offset of field: ZL_VODecoderDesc::name"
6043 );
6044 assert_eq!(
6045 unsafe { ::std::ptr::addr_of!((*ptr).trStateMgr) as usize - ptr as usize },
6046 56usize,
6047 "Offset of field: ZL_VODecoderDesc::trStateMgr"
6048 );
6049 assert_eq!(
6050 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
6051 80usize,
6052 "Offset of field: ZL_VODecoderDesc::opaque"
6053 );
6054}
6055extern "C" {
6056 #[doc = " Register a variable output decoder transform.\n Counterpart to ZS2_registerVOTransform()."]
6057 pub fn ZL_DCtx_registerVODecoder(dctx: *mut ZL_DCtx, dtd: *const ZL_VODecoderDesc)
6058 -> ZL_Report;
6059}
6060pub type ZL_MIDecoderFn = ::std::option::Option<
6061 unsafe extern "C" fn(
6062 dictx: *mut ZL_Decoder,
6063 compulsorySrcs: *mut *const ZL_Input,
6064 nbCompulsorySrcs: usize,
6065 variableSrcs: *mut *const ZL_Input,
6066 nbVariableSrcs: usize,
6067 ) -> ZL_Report,
6068>;
6069#[repr(C)]
6070#[derive(Debug, Copy, Clone)]
6071pub struct ZL_MIDecoderDesc {
6072 pub gd: ZL_MIGraphDesc,
6073 pub transform_f: ZL_MIDecoderFn,
6074 pub name: *const ::std::os::raw::c_char,
6075 pub trStateMgr: ZL_CodecStateManager,
6076 #[doc = " Optionally an opaque pointer that can be queried with\n ZL_Decoder_getOpaquePtr().\n OpenZL unconditionally takes ownership of this pointer, even if\n registration fails, and it lives for the lifetime of the dctx."]
6077 pub opaque: ZL_OpaquePtr,
6078}
6079#[test]
6080fn bindgen_test_layout_ZL_MIDecoderDesc() {
6081 const UNINIT: ::std::mem::MaybeUninit<ZL_MIDecoderDesc> = ::std::mem::MaybeUninit::uninit();
6082 let ptr = UNINIT.as_ptr();
6083 assert_eq!(
6084 ::std::mem::size_of::<ZL_MIDecoderDesc>(),
6085 128usize,
6086 "Size of ZL_MIDecoderDesc"
6087 );
6088 assert_eq!(
6089 ::std::mem::align_of::<ZL_MIDecoderDesc>(),
6090 8usize,
6091 "Alignment of ZL_MIDecoderDesc"
6092 );
6093 assert_eq!(
6094 unsafe { ::std::ptr::addr_of!((*ptr).gd) as usize - ptr as usize },
6095 0usize,
6096 "Offset of field: ZL_MIDecoderDesc::gd"
6097 );
6098 assert_eq!(
6099 unsafe { ::std::ptr::addr_of!((*ptr).transform_f) as usize - ptr as usize },
6100 64usize,
6101 "Offset of field: ZL_MIDecoderDesc::transform_f"
6102 );
6103 assert_eq!(
6104 unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
6105 72usize,
6106 "Offset of field: ZL_MIDecoderDesc::name"
6107 );
6108 assert_eq!(
6109 unsafe { ::std::ptr::addr_of!((*ptr).trStateMgr) as usize - ptr as usize },
6110 80usize,
6111 "Offset of field: ZL_MIDecoderDesc::trStateMgr"
6112 );
6113 assert_eq!(
6114 unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
6115 104usize,
6116 "Offset of field: ZL_MIDecoderDesc::opaque"
6117 );
6118}
6119extern "C" {
6120 #[doc = " Register an MI decoder transform.\n Counterpart to ZS2_registerMITransform()."]
6121 pub fn ZL_DCtx_registerMIDecoder(dctx: *mut ZL_DCtx, dtd: *const ZL_MIDecoderDesc)
6122 -> ZL_Report;
6123}
6124extern "C" {
6125 pub fn ZL_Decoder_getScratchSpace(
6126 dictx: *mut ZL_Decoder,
6127 size: usize,
6128 ) -> *mut ::std::os::raw::c_void;
6129}
6130extern "C" {
6131 pub fn ZL_Decoder_create1OutStream(
6132 dictx: *mut ZL_Decoder,
6133 eltsCapacity: usize,
6134 eltWidth: usize,
6135 ) -> *mut ZL_Output;
6136}
6137extern "C" {
6138 pub fn ZL_Decoder_create1StringStream(
6139 dictx: *mut ZL_Decoder,
6140 nbStringsMax: usize,
6141 sumStringLensMax: usize,
6142 ) -> *mut ZL_Output;
6143}
6144extern "C" {
6145 pub fn ZL_Decoder_createTypedStream(
6146 dictx: *mut ZL_Decoder,
6147 index: ::std::os::raw::c_int,
6148 eltsCapacity: usize,
6149 eltWidth: usize,
6150 ) -> *mut ZL_Output;
6151}
6152extern "C" {
6153 pub fn ZL_Decoder_createStringStream(
6154 dictx: *mut ZL_Decoder,
6155 index: ::std::os::raw::c_int,
6156 nbStringsMax: usize,
6157 sumStringLensMax: usize,
6158 ) -> *mut ZL_Output;
6159}
6160extern "C" {
6161 pub fn ZL_Decoder_getCodecHeader(dictx: *const ZL_Decoder) -> ZL_RBuffer;
6162}
6163extern "C" {
6164 #[doc = " @returns The opaque pointer provided in the transform description.\n @warning Usage of the opaque pointer must be thread-safe, and must\n not not modify the state in any way that impacts decoding!"]
6165 pub fn ZL_Decoder_getOpaquePtr(dictx: *const ZL_Decoder) -> *const ::std::os::raw::c_void;
6166}
6167extern "C" {
6168 #[doc = " @returns Returns a state, as generated by the Transform's State Manager."]
6169 pub fn ZL_Decoder_getState(dictx: *const ZL_Decoder) -> *mut ::std::os::raw::c_void;
6170}
6171pub const ZL_GraphType_standard: ZL_GraphType = 0;
6172pub const ZL_GraphType_static: ZL_GraphType = 1;
6173pub const ZL_GraphType_selector: ZL_GraphType = 2;
6174pub const ZL_GraphType_function: ZL_GraphType = 3;
6175pub const ZL_GraphType_multiInput: ZL_GraphType = 4;
6176pub const ZL_GraphType_parameterized: ZL_GraphType = 5;
6177pub const ZL_GraphType_segmenter: ZL_GraphType = 6;
6178pub type ZL_GraphType = ::std::os::raw::c_uint;
6179pub type ZL_Compressor_ForEachGraphCallback = ::std::option::Option<
6180 unsafe extern "C" fn(
6181 opaque: *mut ::std::os::raw::c_void,
6182 compressor: *const ZL_Compressor,
6183 graphID: ZL_GraphID,
6184 ) -> ZL_Report,
6185>;
6186extern "C" {
6187 #[doc = " Calls @p callback on every graph registered in the @p compressor.\n If @p callback returns an error, short-circuit and return that error.\n @returns Success if all callbacks succeed, or the first error.\n @note The callback will not be called on standard graphs, since they\n aren't registered in the @p compressor."]
6188 pub fn ZL_Compressor_forEachGraph(
6189 compressor: *const ZL_Compressor,
6190 callback: ZL_Compressor_ForEachGraphCallback,
6191 opaque: *mut ::std::os::raw::c_void,
6192 ) -> ZL_Report;
6193}
6194pub type ZL_Compressor_ForEachNodeCallback = ::std::option::Option<
6195 unsafe extern "C" fn(
6196 opaque: *mut ::std::os::raw::c_void,
6197 compressor: *const ZL_Compressor,
6198 graphID: ZL_NodeID,
6199 ) -> ZL_Report,
6200>;
6201extern "C" {
6202 #[doc = " Calls @p callback on every node registered in the @p compressor.\n If @p callback returns an error, short-circuit and return that error.\n @returns Success if all callbacks succeed, or the first error.\n @note The callback will not be called on standard nodes, since they\n aren't registered in the @p compressor."]
6203 pub fn ZL_Compressor_forEachNode(
6204 compressor: *const ZL_Compressor,
6205 callback: ZL_Compressor_ForEachNodeCallback,
6206 opaque: *mut ::std::os::raw::c_void,
6207 ) -> ZL_Report;
6208}
6209pub type ZL_Compressor_ForEachParamCallback = ::std::option::Option<
6210 unsafe extern "C" fn(
6211 opaque: *mut ::std::os::raw::c_void,
6212 param: ZL_CParam,
6213 val: ::std::os::raw::c_int,
6214 ) -> ZL_Report,
6215>;
6216extern "C" {
6217 #[doc = " Calls @p callback on every param set in the @p compressor.\n If @p callback returns an error, short-circuit and return that error.\n @returns Success if all callbacks succeed, or the first error.\n @note The callback will not be called on params that are equal to\n the default value (0)."]
6218 pub fn ZL_Compressor_forEachParam(
6219 compressor: *const ZL_Compressor,
6220 callback: ZL_Compressor_ForEachParamCallback,
6221 opaque: *mut ::std::os::raw::c_void,
6222 ) -> ZL_Report;
6223}
6224extern "C" {
6225 #[doc = " @param[out] graphID If the function returns true, filled with\n the starting GraphID, otherwise filled with ZL_GRAPH_ILLEGAL.\n @returns True iff the compressor has the starting GraphID set."]
6226 pub fn ZL_Compressor_getStartingGraphID(
6227 compressor: *const ZL_Compressor,
6228 graphID: *mut ZL_GraphID,
6229 ) -> bool;
6230}
6231extern "C" {
6232 #[doc = " @returns The @ref ZL_GraphType of the given graph.\n @note This is the original type the graph was registered with."]
6233 pub fn ZL_Compressor_getGraphType(
6234 compressor: *const ZL_Compressor,
6235 graph: ZL_GraphID,
6236 ) -> ZL_GraphType;
6237}
6238extern "C" {
6239 #[doc = " @returns the (optional) @p name given to this graphid.\n When none provided, returns \"\".\n When graphid is illegal (invalid), returns NULL."]
6240 pub fn ZL_Compressor_Graph_getName(
6241 cgraph: *const ZL_Compressor,
6242 graphid: ZL_GraphID,
6243 ) -> *const ::std::os::raw::c_char;
6244}
6245extern "C" {
6246 #[doc = " @returns The input stream types that @p graphid is compatible with.\n @pre @p graph must be valid, and must have a single input stream"]
6247 pub fn ZL_Compressor_Graph_getInput0Mask(
6248 cgraph: *const ZL_Compressor,
6249 graphid: ZL_GraphID,
6250 ) -> ZL_Type;
6251}
6252extern "C" {
6253 #[doc = " @returns The input stream types that @p graphid input @p inputIdx is\n compatible with."]
6254 pub fn ZL_Compressor_Graph_getInputMask(
6255 compressor: *const ZL_Compressor,
6256 graphid: ZL_GraphID,
6257 inputIdx: usize,
6258 ) -> ZL_Type;
6259}
6260extern "C" {
6261 #[doc = " @returns The number of input streams that @p graphid expects."]
6262 pub fn ZL_Compressor_Graph_getNumInputs(
6263 compressor: *const ZL_Compressor,
6264 graphid: ZL_GraphID,
6265 ) -> usize;
6266}
6267extern "C" {
6268 #[doc = " @returns True if @p graphid is a multi input graph whose last\n input may show up zero or more times."]
6269 pub fn ZL_Compressor_Graph_isVariableInput(
6270 compressor: *const ZL_Compressor,
6271 graphid: ZL_GraphID,
6272 ) -> bool;
6273}
6274extern "C" {
6275 #[doc = " @returns The head node of the graph if @p graphid is a static graph,\n otherwise returns ZL_NODE_ILLEGAL."]
6276 pub fn ZL_Compressor_Graph_getHeadNode(
6277 compressor: *const ZL_Compressor,
6278 graphid: ZL_GraphID,
6279 ) -> ZL_NodeID;
6280}
6281extern "C" {
6282 #[doc = " @returns If the provided @p graphid was created by modifying another\n existing graph, i.e., its type is `ZL_GraphType_parameterized`,\n the `ZL_GraphID` of that other graph. Otherwise, it returns\n `ZL_GRAPH_ILLEGAL`."]
6283 pub fn ZL_Compressor_Graph_getBaseGraphID(
6284 compressor: *const ZL_Compressor,
6285 graphid: ZL_GraphID,
6286 ) -> ZL_GraphID;
6287}
6288extern "C" {
6289 #[doc = " @returns The successor of the head node in the graph if @p graphid is a\n static graph, otherwise returns an empty list.\n @note The array is valid for the lifetime of the @p compressor."]
6290 pub fn ZL_Compressor_Graph_getSuccessors(
6291 compressor: *const ZL_Compressor,
6292 graphid: ZL_GraphID,
6293 ) -> ZL_GraphIDList;
6294}
6295extern "C" {
6296 #[doc = " @returns The custom nodes of @p graphid, which is only non-empty for\n dynamic and multi-input graphs.\n @note The array is valid for the lifetime of the @p compressor."]
6297 pub fn ZL_Compressor_Graph_getCustomNodes(
6298 compressor: *const ZL_Compressor,
6299 graphid: ZL_GraphID,
6300 ) -> ZL_NodeIDList;
6301}
6302extern "C" {
6303 #[doc = " @returns The custom graphs of @p graphid, which is only non-empty for\n selector, dynamic, and multi-input graphs.\n @note The array is valid for the lifetime of the @p compressor."]
6304 pub fn ZL_Compressor_Graph_getCustomGraphs(
6305 compressor: *const ZL_Compressor,
6306 graphid: ZL_GraphID,
6307 ) -> ZL_GraphIDList;
6308}
6309extern "C" {
6310 #[doc = " @returns The local params of @p graphid.\n @note The params for the lifetime of the @p compressor."]
6311 pub fn ZL_Compressor_Graph_getLocalParams(
6312 compressor: *const ZL_Compressor,
6313 graphid: ZL_GraphID,
6314 ) -> ZL_LocalParams;
6315}
6316extern "C" {
6317 #[doc = " @returns The number of input streams that @p node expects\n in the context of the @p cgraph."]
6318 pub fn ZL_Compressor_Node_getNumInputs(cgraph: *const ZL_Compressor, node: ZL_NodeID) -> usize;
6319}
6320extern "C" {
6321 #[doc = " @returns The input stream type that @p node expects\n @pre @p node must be valid, and must have a single input stream"]
6322 pub fn ZL_Compressor_Node_getInput0Type(
6323 cgraph: *const ZL_Compressor,
6324 node: ZL_NodeID,
6325 ) -> ZL_Type;
6326}
6327extern "C" {
6328 #[doc = " @returns The input stream type that @p node has at index @p inputIndex in\n the context of the @p cgraph\n\n @pre @p inputIndex is less than #ZL_Compressor_Node_getNumInputs(@p cgraph ,\n @p node). It is an error to pass an @p inputIndex greater or equal to the\n number of inputs. Note that all input streams within a group of variable\n inputs share the same @p inputIndex."]
6329 pub fn ZL_Compressor_Node_getInputType(
6330 cgraph: *const ZL_Compressor,
6331 nodeid: ZL_NodeID,
6332 inputIndex: ZL_IDType,
6333 ) -> ZL_Type;
6334}
6335extern "C" {
6336 #[doc = " @returns True if @p nodeid is a multi input codec whose last\n input may show up zero or more times."]
6337 pub fn ZL_Compressor_Node_isVariableInput(
6338 compressor: *const ZL_Compressor,
6339 nodeid: ZL_NodeID,
6340 ) -> bool;
6341}
6342extern "C" {
6343 #[doc = " @returns The number of output outcomes that @p node has\n in the context of the @p cgraph."]
6344 pub fn ZL_Compressor_Node_getNumOutcomes(
6345 cgraph: *const ZL_Compressor,
6346 node: ZL_NodeID,
6347 ) -> usize;
6348}
6349extern "C" {
6350 #[doc = " @returns The number of variable output that @p node has\n in the context of the @p cgraph."]
6351 pub fn ZL_Compressor_Node_getNumVariableOutcomes(
6352 cgraph: *const ZL_Compressor,
6353 node: ZL_NodeID,
6354 ) -> usize;
6355}
6356extern "C" {
6357 #[doc = " @returns The output stream type that @p node has at index @p outputIndex in\n the context of the @p cgraph\n\n @pre @p outputIndex is less than #ZS2_Compressor_Node_getNbOutputs(@p cgraph\n , @p node)"]
6358 pub fn ZL_Compressor_Node_getOutputType(
6359 cgraph: *const ZL_Compressor,
6360 node: ZL_NodeID,
6361 outputIndex: ::std::os::raw::c_int,
6362 ) -> ZL_Type;
6363}
6364extern "C" {
6365 #[doc = " @returns The local params of @p nodeid.\n @note The params for the lifetime of the @p compressor."]
6366 pub fn ZL_Compressor_Node_getLocalParams(
6367 cgraph: *const ZL_Compressor,
6368 nodeid: ZL_NodeID,
6369 ) -> ZL_LocalParams;
6370}
6371extern "C" {
6372 #[doc = " @returns the max format version that @p node supports\n in the context of the @p cgraph."]
6373 pub fn ZL_Compressor_Node_getMaxVersion(
6374 cgraph: *const ZL_Compressor,
6375 node: ZL_NodeID,
6376 ) -> ::std::os::raw::c_uint;
6377}
6378extern "C" {
6379 #[doc = " @returns the min format version that @p node supports\n in the context of the @p cgraph."]
6380 pub fn ZL_Compressor_Node_getMinVersion(
6381 cgraph: *const ZL_Compressor,
6382 node: ZL_NodeID,
6383 ) -> ::std::os::raw::c_uint;
6384}
6385extern "C" {
6386 #[doc = " @returns The transform ID for the node, which is the ID that is written into\n the frame header, and how we determine which decoder to use."]
6387 pub fn ZL_Compressor_Node_getCodecID(
6388 cgraph: *const ZL_Compressor,
6389 node: ZL_NodeID,
6390 ) -> ZL_IDType;
6391}
6392extern "C" {
6393 #[doc = " @returns If the provided @p node was created by modifying another existing\n node, the `ZL_NodeID` of that other node. Otherwise, `ZL_NODE_ILLEGAL`."]
6394 pub fn ZL_Compressor_Node_getBaseNodeID(
6395 cgraph: *const ZL_Compressor,
6396 node: ZL_NodeID,
6397 ) -> ZL_NodeID;
6398}
6399extern "C" {
6400 #[doc = " @returns The name of the node if available, else \"\", and returns NULL if @p\n node is invalid."]
6401 pub fn ZL_Compressor_Node_getName(
6402 cgraph: *const ZL_Compressor,
6403 node: ZL_NodeID,
6404 ) -> *const ::std::os::raw::c_char;
6405}
6406extern "C" {
6407 #[doc = " @returns a boolean value indicating whether the node is standard or not."]
6408 pub fn ZL_Compressor_Node_isStandard(cgraph: *const ZL_Compressor, node: ZL_NodeID) -> bool;
6409}
6410extern "C" {
6411 #[doc = " @returns The dict ID associated with the @p node or ZL_DICT_ID_NULL if no\n dict is associated."]
6412 pub fn ZL_Compressor_Node_getDictID(cgraph: *const ZL_Compressor, node: ZL_NodeID)
6413 -> ZL_DictID;
6414}
6415extern "C" {
6416 #[doc = " @returns The dict index within the compressor's bundle for the @p node.\n Returns an error if no dictionary is associated with this node.\n @note Only valid after ZL_Compressor_validate() has been called."]
6417 pub fn ZL_Compressor_Node_getDictIndex(
6418 cgraph: *const ZL_Compressor,
6419 node: ZL_NodeID,
6420 ) -> ZL_Report;
6421}
6422extern "C" {
6423 #[doc = " @returns The MParam ID associated with the @p node or ZL_MPARAM_ID_NULL if no\n MParam is associated."]
6424 pub fn ZL_Compressor_Node_getMParamID(
6425 cgraph: *const ZL_Compressor,
6426 node: ZL_NodeID,
6427 ) -> ZL_MParamID;
6428}
6429extern "C" {
6430 #[doc = " @returns A pointer to the *unmaterialized* MParam associated with the @p\n node, or NULL if no MParam is associated."]
6431 pub fn ZL_Compressor_Node_getMParam(
6432 cgraph: *const ZL_Compressor,
6433 node: ZL_NodeID,
6434 ) -> *const ZL_MParam;
6435}
6436extern "C" {
6437 #[doc = " @returns The *materialized* Mparam object associated with the @p node or NULL\n if no MParam is associated."]
6438 pub fn ZL_Compressor_Node_getMParamObj(
6439 cgraph: *const ZL_Compressor,
6440 node: ZL_NodeID,
6441 ) -> *const ::std::os::raw::c_void;
6442}
6443extern "C" {
6444 #[doc = " @returns The number of unique MParam blobs stored in the @p compressor."]
6445 pub fn ZL_Compressor_numMParams(compressor: *const ZL_Compressor) -> usize;
6446}
6447pub type ZL_Compressor_ForEachMParamCallback = ::std::option::Option<
6448 unsafe extern "C" fn(
6449 opaque: *mut ::std::os::raw::c_void,
6450 mparam: *const ZL_MParam,
6451 ) -> ZL_Report,
6452>;
6453extern "C" {
6454 #[doc = " Calls @p callback on every unique MParam stored in the @p compressor.\n If @p callback returns an error, short-circuit and return that error.\n @returns Success if all callbacks succeed, or the first error."]
6455 pub fn ZL_Compressor_forEachMParam(
6456 compressor: *const ZL_Compressor,
6457 callback: ZL_Compressor_ForEachMParamCallback,
6458 opaque: *mut ::std::os::raw::c_void,
6459 ) -> ZL_Report;
6460}
6461#[repr(C)]
6462#[derive(Debug, Copy, Clone)]
6463pub struct ZL_ReflectionCtx_s {
6464 _unused: [u8; 0],
6465}
6466#[doc = " Reflection API for introspecting a compressed frame.\n\n 1. Create a reflection context with ZL_ReflectionCtx_create().\n 2. Register the transforms used in the frame with\n ZL_ReflectionCtx_registerTypedDecoder() and friends.\n 3. Set the compressed frame to process with\n ZL_ReflectionCtx_setCompressedFrame().\n 4. Get the information you need with the various\n ZS2_ReflectionCtx_get*()\n 5. Free the context with ZL_ReflectionCtx_free().\n\n NOTE: This API is guaranteed to be safe on corrupted input.\n WARNING: Logic errors in the API usage will crash the process.\n For example trying to call any getter (e.g.\n ZL_ReflectionCtx_getNumStreams_lastChunk()) before calling\n ZL_ReflectionCtx_setCompressedFrame() and getting a successful return\n code."]
6467pub type ZL_ReflectionCtx = ZL_ReflectionCtx_s;
6468#[repr(C)]
6469#[derive(Debug, Copy, Clone)]
6470pub struct ZL_DataInfo_s {
6471 _unused: [u8; 0],
6472}
6473pub type ZL_DataInfo = ZL_DataInfo_s;
6474#[repr(C)]
6475#[derive(Debug, Copy, Clone)]
6476pub struct ZL_CodecInfo_s {
6477 _unused: [u8; 0],
6478}
6479pub type ZL_CodecInfo = ZL_CodecInfo_s;
6480extern "C" {
6481 pub fn ZL_ReflectionCtx_create() -> *mut ZL_ReflectionCtx;
6482}
6483extern "C" {
6484 pub fn ZL_ReflectionCtx_free(rctx: *mut ZL_ReflectionCtx);
6485}
6486extern "C" {
6487 #[doc = " @returns The dctx that will be used for decompression so the user\n can set parameters and register custom transforms if the helpers\n provided aren't sufficient.\n\n @pre Must be called before ZL_ReflectionCtx_setCompressedFrame()."]
6488 pub fn ZL_ReflectionCtx_getDCtx(rctx: *mut ZL_ReflectionCtx) -> *mut ZL_DCtx;
6489}
6490extern "C" {
6491 #[doc = " Registers a custom transform to be used when decoding the frame.\n @pre Must be called before ZL_ReflectionCtx_setCompressedFrame()."]
6492 pub fn ZL_ReflectionCtx_registerTypedDecoder(
6493 rctx: *mut ZL_ReflectionCtx,
6494 dtd: *const ZL_TypedDecoderDesc,
6495 );
6496}
6497extern "C" {
6498 #[doc = " Registers a custom transform to be used when decoding the frame.\n @pre Must be called before ZL_ReflectionCtx_setCompressedFrame()."]
6499 pub fn ZL_ReflectionCtx_registerVODecoder(
6500 rctx: *mut ZL_ReflectionCtx,
6501 dtd: *const ZL_VODecoderDesc,
6502 );
6503}
6504extern "C" {
6505 #[doc = " Registers a custom transform to be used when decoding the frame.\n @pre Must be called before ZL_ReflectionCtx_setCompressedFrame()."]
6506 pub fn ZL_ReflectionCtx_registerMIDecoder(
6507 rctx: *mut ZL_ReflectionCtx,
6508 dtd: *const ZL_MIDecoderDesc,
6509 );
6510}
6511extern "C" {
6512 #[doc = " Decompresses the frame in @p src and build all the information needed to\n introspect the frame.\n\n @pre Must only be called once per @p rctx.\n\n @returns ZL_returnSuccess() if decompression sueeeded."]
6513 pub fn ZL_ReflectionCtx_setCompressedFrame(
6514 rctx: *mut ZL_ReflectionCtx,
6515 src: *const ::std::os::raw::c_void,
6516 srcSize: usize,
6517 ) -> ZL_Report;
6518}
6519extern "C" {
6520 #[doc = " @returns The frame format version.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6521 pub fn ZL_ReflectionCtx_getFrameFormatVersion(rctx: *const ZL_ReflectionCtx) -> u32;
6522}
6523extern "C" {
6524 #[doc = " @returns The size of the frame header.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6525 pub fn ZL_ReflectionCtx_getFrameHeaderSize(rctx: *const ZL_ReflectionCtx) -> usize;
6526}
6527extern "C" {
6528 #[doc = " @returns The size of the frame footer.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6529 pub fn ZL_ReflectionCtx_getFrameFooterSize(rctx: *const ZL_ReflectionCtx) -> usize;
6530}
6531extern "C" {
6532 #[doc = " @returns The total size of all the transform headers.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6533 pub fn ZL_ReflectionCtx_getTotalTransformHeaderSize_lastChunk(
6534 rctx: *const ZL_ReflectionCtx,
6535 ) -> usize;
6536}
6537extern "C" {
6538 #[doc = " @returns The total number of streams in the decoder graph. This includes\n streams stored in the frame, input streams to the frame, and intermediate\n streams.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6539 pub fn ZL_ReflectionCtx_getNumStreams_lastChunk(rctx: *const ZL_ReflectionCtx) -> usize;
6540}
6541extern "C" {
6542 #[doc = " @returns The stream at @p index\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success.\n @pre @p index is valid."]
6543 pub fn ZL_ReflectionCtx_getStream_lastChunk(
6544 rctx: *const ZL_ReflectionCtx,
6545 index: usize,
6546 ) -> *const ZL_DataInfo;
6547}
6548extern "C" {
6549 #[doc = " @returns The number of input streams to the compressed frame.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6550 pub fn ZL_ReflectionCtx_getNumInputs(rctx: *const ZL_ReflectionCtx) -> usize;
6551}
6552extern "C" {
6553 #[doc = " @returns The input stream at @p index\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success.\n @pre @p index is valid."]
6554 pub fn ZL_ReflectionCtx_getInput(
6555 rctx: *const ZL_ReflectionCtx,
6556 index: usize,
6557 ) -> *const ZL_DataInfo;
6558}
6559extern "C" {
6560 #[doc = " @returns The number of streams stored in the compressed frame.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6561 pub fn ZL_ReflectionCtx_getNumStoredOutputs_lastChunk(rctx: *const ZL_ReflectionCtx) -> usize;
6562}
6563extern "C" {
6564 #[doc = " @returns The stored stream at @p index\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success.\n @pre @p index is valid."]
6565 pub fn ZL_ReflectionCtx_getStoredOutput_lastChunk(
6566 rctx: *const ZL_ReflectionCtx,
6567 index: usize,
6568 ) -> *const ZL_DataInfo;
6569}
6570extern "C" {
6571 #[doc = " @returns the number of transforms that are run during the decoding process.\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success."]
6572 pub fn ZL_ReflectionCtx_getNumCodecs_lastChunk(rctx: *const ZL_ReflectionCtx) -> usize;
6573}
6574extern "C" {
6575 #[doc = " @returns The transform at @p index\n @pre ZL_ReflectionCtx_setCompressedFrame() returned success.\n @pre @p index is valid."]
6576 pub fn ZL_ReflectionCtx_getCodec_lastChunk(
6577 rctx: *const ZL_ReflectionCtx,
6578 index: usize,
6579 ) -> *const ZL_CodecInfo;
6580}
6581extern "C" {
6582 #[doc = " @returns The type of the stream."]
6583 pub fn ZL_DataInfo_getType(si: *const ZL_DataInfo) -> ZL_Type;
6584}
6585extern "C" {
6586 #[doc = " @returns The number of elements in the stream."]
6587 pub fn ZL_DataInfo_getNumElts(si: *const ZL_DataInfo) -> usize;
6588}
6589extern "C" {
6590 #[doc = " @returns The element width of the stream."]
6591 pub fn ZL_DataInfo_getEltWidth(si: *const ZL_DataInfo) -> usize;
6592}
6593extern "C" {
6594 #[doc = " @returns The content size of the stream.\n For non-string streams equal to nbElts * eltWidth.\n For string streams equal to the sum of the lengths."]
6595 pub fn ZL_DataInfo_getContentSize(si: *const ZL_DataInfo) -> usize;
6596}
6597extern "C" {
6598 #[doc = " @returns The index for which ZL_ReflectionCtx_getStream_lastChunk() returns\n this stream."]
6599 pub fn ZL_DataInfo_getIndex(si: *const ZL_DataInfo) -> usize;
6600}
6601extern "C" {
6602 #[doc = " @returns The data pointer for the stream."]
6603 pub fn ZL_DataInfo_getDataPtr(si: *const ZL_DataInfo) -> *const ::std::os::raw::c_void;
6604}
6605extern "C" {
6606 #[doc = " @returns The length pointer for the stream if the type is\n ZL_Type_string.\n @pre The type is ZL_Type_string."]
6607 pub fn ZL_DataInfo_getLengthsPtr(si: *const ZL_DataInfo) -> *const u32;
6608}
6609extern "C" {
6610 #[doc = " @returns The transform that produced this stream or NULL\n if the stream is stored in the frame."]
6611 pub fn ZL_DataInfo_getProducerCodec(si: *const ZL_DataInfo) -> *const ZL_CodecInfo;
6612}
6613extern "C" {
6614 #[doc = " @returns The transform that consumes this stream or NULL\n if the stream is an input stream to the frame."]
6615 pub fn ZL_DataInfo_getConsumerCodec(si: *const ZL_DataInfo) -> *const ZL_CodecInfo;
6616}
6617extern "C" {
6618 #[doc = " @returns The name of the transform"]
6619 pub fn ZL_CodecInfo_getName(ti: *const ZL_CodecInfo) -> *const ::std::os::raw::c_char;
6620}
6621extern "C" {
6622 #[doc = " @returns The transform ID"]
6623 pub fn ZL_CodecInfo_getCodecID(ti: *const ZL_CodecInfo) -> ZL_IDType;
6624}
6625extern "C" {
6626 #[doc = " @returns true iff the transform is a standard transform."]
6627 pub fn ZL_CodecInfo_isStandardCodec(ti: *const ZL_CodecInfo) -> bool;
6628}
6629extern "C" {
6630 #[doc = " @returns true iff the transform is a custom transform."]
6631 pub fn ZL_CodecInfo_isCustomCodec(ti: *const ZL_CodecInfo) -> bool;
6632}
6633extern "C" {
6634 #[doc = " @returns The index for which ZL_ReflectionCtx_getCodec_lastChunk() returns\n this transform."]
6635 pub fn ZL_CodecInfo_getIndex(ti: *const ZL_CodecInfo) -> usize;
6636}
6637extern "C" {
6638 #[doc = " @returns The header pointer for the transform."]
6639 pub fn ZL_CodecInfo_getHeaderPtr(ti: *const ZL_CodecInfo) -> *const ::std::os::raw::c_void;
6640}
6641extern "C" {
6642 #[doc = " @returns The header size of the transform."]
6643 pub fn ZL_CodecInfo_getHeaderSize(ti: *const ZL_CodecInfo) -> usize;
6644}
6645extern "C" {
6646 #[doc = " @returns The number of input streams to the transform.\n Input streams are streams that are consumed by the encoder and produced by\n the decoder."]
6647 pub fn ZL_CodecInfo_getNumInputs(ti: *const ZL_CodecInfo) -> usize;
6648}
6649extern "C" {
6650 #[doc = " @returns The input stream of the transform at index @p index\n @pre index is valid"]
6651 pub fn ZL_CodecInfo_getInput(ti: *const ZL_CodecInfo, index: usize) -> *const ZL_DataInfo;
6652}
6653extern "C" {
6654 #[doc = " @returns The number of output streams to the transform.\n Output streams are streams that are produced by the encoder and consumed by\n the decoder."]
6655 pub fn ZL_CodecInfo_getNumOutputs(ti: *const ZL_CodecInfo) -> usize;
6656}
6657extern "C" {
6658 #[doc = " @returns The output stream of the transform at index @p index\n @pre index is valid"]
6659 pub fn ZL_CodecInfo_getOutput(ti: *const ZL_CodecInfo, index: usize) -> *const ZL_DataInfo;
6660}
6661extern "C" {
6662 #[doc = " @returns The number of output streams of the transform that are\n variable outputs. Necessarily no greater than\n ZL_CodecInfo_getOutput()."]
6663 pub fn ZL_CodecInfo_getNumVariableOutputs(ti: *const ZL_CodecInfo) -> usize;
6664}