brotlic_sys/
lib.rs

1#![allow(nonstandard_style)]
2#![allow(rustdoc::broken_intra_doc_links)]
3
4use std::ffi::c_void;
5use std::marker;
6use std::os::raw::{c_char, c_int};
7
8pub const BROTLI_TRUE: BROTLI_BOOL = 1;
9pub const BROTLI_FALSE: BROTLI_BOOL = 0;
10
11pub const BROTLI_MIN_QUALITY: u8 = 0;
12pub const BROTLI_DEFAULT_QUALITY: u8 = 11;
13pub const BROTLI_MAX_QUALITY: u8 = 11;
14
15pub const BROTLI_MIN_WINDOW_BITS: u8 = 10;
16pub const BROTLI_DEFAULT_WINDOW: u8 = 22;
17pub const BROTLI_MAX_WINDOW_BITS: u8 = 24;
18pub const BROTLI_LARGE_MAX_WINDOW_BITS: u8 = 30;
19
20pub const BROTLI_MIN_INPUT_BLOCK_BITS: u8 = 16;
21pub const BROTLI_MAX_INPUT_BLOCK_BITS: u8 = 24;
22
23pub type BROTLI_BOOL = c_int;
24
25#[doc = " Allocating function pointer type."]
26#[doc = ""]
27#[doc = " @param opaque custom memory manager handle provided by client"]
28#[doc = " @param size requested memory region size; can not be @c 0"]
29#[doc = " @returns @c 0 in the case of failure"]
30#[doc = " @returns a valid pointer to a memory region of at least @p size bytes"]
31#[doc = "          long otherwise"]
32pub type brotli_alloc_func = Option<extern "C" fn(opaque: *mut c_void, size: usize) -> *mut c_void>;
33
34#[doc = " Deallocating function pointer type."]
35#[doc = ""]
36#[doc = " This function @b SHOULD do nothing if @p address is @c 0."]
37#[doc = ""]
38#[doc = " @param opaque custom memory manager handle provided by client"]
39#[doc = " @param address memory region pointer returned by ::brotli_alloc_func, or @c 0"]
40pub type brotli_free_func = Option<extern "C" fn(opaque: *mut c_void, address: *mut c_void)>;
41
42#[doc = " Default compression mode."]
43#[doc = ""]
44#[doc = " In this mode compressor does not know anything in advance about the"]
45#[doc = " properties of the input."]
46pub const BrotliEncoderMode_BROTLI_MODE_GENERIC: BrotliEncoderMode = 0;
47#[doc = " Compression mode for UTF-8 formatted text input."]
48pub const BrotliEncoderMode_BROTLI_MODE_TEXT: BrotliEncoderMode = 1;
49#[doc = " Compression mode used in WOFF 2.0."]
50pub const BrotliEncoderMode_BROTLI_MODE_FONT: BrotliEncoderMode = 2;
51#[doc = " Options for ::BROTLI_PARAM_MODE parameter."]
52pub type BrotliEncoderMode = c_int;
53
54#[doc = " Process input."]
55#[doc = ""]
56#[doc = " Encoder may postpone producing output, until it has processed enough input."]
57pub const BrotliEncoderOperation_BROTLI_OPERATION_PROCESS: BrotliEncoderOperation = 0;
58#[doc = " Produce output for all processed input."]
59#[doc = ""]
60#[doc = " Actual flush is performed when input stream is depleted and there is enough"]
61#[doc = " space in output stream. This means that client should repeat"]
62#[doc = " ::BROTLI_OPERATION_FLUSH operation until @p available_in becomes @c 0, and"]
63#[doc = " ::BrotliEncoderHasMoreOutput returns ::BROTLI_FALSE. If output is acquired"]
64#[doc = " via ::BrotliEncoderTakeOutput, then operation should be repeated after"]
65#[doc = " output buffer is drained."]
66#[doc = ""]
67#[doc = " @warning Until flush is complete, client @b SHOULD @b NOT swap,"]
68#[doc = "          reduce or extend input stream."]
69#[doc = ""]
70#[doc = " When flush is complete, output data will be sufficient for decoder to"]
71#[doc = " reproduce all the given input."]
72pub const BrotliEncoderOperation_BROTLI_OPERATION_FLUSH: BrotliEncoderOperation = 1;
73#[doc = " Finalize the stream."]
74#[doc = ""]
75#[doc = " Actual finalization is performed when input stream is depleted and there is"]
76#[doc = " enough space in output stream. This means that client should repeat"]
77#[doc = " ::BROTLI_OPERATION_FINISH operation until @p available_in becomes @c 0, and"]
78#[doc = " ::BrotliEncoderHasMoreOutput returns ::BROTLI_FALSE. If output is acquired"]
79#[doc = " via ::BrotliEncoderTakeOutput, then operation should be repeated after"]
80#[doc = " output buffer is drained."]
81#[doc = ""]
82#[doc = " @warning Until finalization is complete, client @b SHOULD @b NOT swap,"]
83#[doc = "          reduce or extend input stream."]
84#[doc = ""]
85#[doc = " Helper function ::BrotliEncoderIsFinished checks if stream is finalized and"]
86#[doc = " output fully dumped."]
87#[doc = ""]
88#[doc = " Adding more input data to finalized stream is impossible."]
89pub const BrotliEncoderOperation_BROTLI_OPERATION_FINISH: BrotliEncoderOperation = 2;
90#[doc = " Emit metadata block to stream."]
91#[doc = ""]
92#[doc = " Metadata is opaque to Brotli: neither encoder, nor decoder processes this"]
93#[doc = " data or relies on it. It may be used to pass some extra information from"]
94#[doc = " encoder client to decoder client without interfering with main data stream."]
95#[doc = ""]
96#[doc = " @note Encoder may emit empty metadata blocks internally, to pad encoded"]
97#[doc = "       stream to byte boundary."]
98#[doc = ""]
99#[doc = " @warning Until emitting metadata is complete client @b SHOULD @b NOT swap,"]
100#[doc = "          reduce or extend input stream."]
101#[doc = ""]
102#[doc = " @warning The whole content of input buffer is considered to be the content"]
103#[doc = "          of metadata block. Do @b NOT @e append metadata to input stream,"]
104#[doc = "          before it is depleted with other operations."]
105#[doc = ""]
106#[doc = " Stream is soft-flushed before metadata block is emitted. Metadata block"]
107#[doc = " @b MUST be no longer than than 16MiB."]
108pub const BrotliEncoderOperation_BROTLI_OPERATION_EMIT_METADATA: BrotliEncoderOperation = 3;
109#[doc = " Operations that can be performed by streaming encoder."]
110pub type BrotliEncoderOperation = c_int;
111
112#[doc = " Tune encoder for specific input."]
113#[doc = ""]
114#[doc = " ::BrotliEncoderMode enumerates all available values."]
115pub const BrotliEncoderParameter_BROTLI_PARAM_MODE: BrotliEncoderParameter = 0;
116#[doc = " The main compression speed-density lever."]
117#[doc = ""]
118#[doc = " The higher the quality, the slower the compression. Range is"]
119#[doc = " from ::BROTLI_MIN_QUALITY to ::BROTLI_MAX_QUALITY."]
120pub const BrotliEncoderParameter_BROTLI_PARAM_QUALITY: BrotliEncoderParameter = 1;
121#[doc = " Recommended sliding LZ77 window size."]
122#[doc = ""]
123#[doc = " Encoder may reduce this value, e.g. if input is much smaller than"]
124#[doc = " window size."]
125#[doc = ""]
126#[doc = " Window size is `(1 << value) - 16`."]
127#[doc = ""]
128#[doc = " Range is from ::BROTLI_MIN_WINDOW_BITS to ::BROTLI_MAX_WINDOW_BITS."]
129pub const BrotliEncoderParameter_BROTLI_PARAM_LGWIN: BrotliEncoderParameter = 2;
130#[doc = " Recommended input block size."]
131#[doc = ""]
132#[doc = " Encoder may reduce this value, e.g. if input is much smaller than input"]
133#[doc = " block size."]
134#[doc = ""]
135#[doc = " Range is from ::BROTLI_MIN_INPUT_BLOCK_BITS to"]
136#[doc = " ::BROTLI_MAX_INPUT_BLOCK_BITS."]
137#[doc = ""]
138#[doc = " @note Bigger input block size allows better compression, but consumes more"]
139#[doc = "       memory. \\n The rough formula of memory used for temporary input"]
140#[doc = "       storage is `3 << lgBlock`."]
141pub const BrotliEncoderParameter_BROTLI_PARAM_LGBLOCK: BrotliEncoderParameter = 3;
142#[doc = " Flag that affects usage of \"literal context modeling\" format feature."]
143#[doc = ""]
144#[doc = " This flag is a \"decoding-speed vs compression ratio\" trade-off."]
145pub const BrotliEncoderParameter_BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:
146    BrotliEncoderParameter = 4;
147#[doc = " Estimated total input size for all ::BrotliEncoderCompressStream calls."]
148#[doc = ""]
149#[doc = " The default value is 0, which means that the total input size is unknown."]
150pub const BrotliEncoderParameter_BROTLI_PARAM_SIZE_HINT: BrotliEncoderParameter = 5;
151#[doc = " Flag that determines if \"Large Window Brotli\" is used."]
152pub const BrotliEncoderParameter_BROTLI_PARAM_LARGE_WINDOW: BrotliEncoderParameter = 6;
153#[doc = " Recommended number of postfix bits (NPOSTFIX)."]
154#[doc = ""]
155#[doc = " Encoder may change this value."]
156#[doc = ""]
157#[doc = " Range is from 0 to ::BROTLI_MAX_NPOSTFIX."]
158pub const BrotliEncoderParameter_BROTLI_PARAM_NPOSTFIX: BrotliEncoderParameter = 7;
159#[doc = " Recommended number of direct distance codes (NDIRECT)."]
160#[doc = ""]
161#[doc = " Encoder may change this value."]
162#[doc = ""]
163#[doc = " Range is from 0 to (15 << NPOSTFIX) in steps of (1 << NPOSTFIX)."]
164pub const BrotliEncoderParameter_BROTLI_PARAM_NDIRECT: BrotliEncoderParameter = 8;
165#[doc = " Number of bytes of input stream already processed by a different instance."]
166#[doc = ""]
167#[doc = " @note It is important to configure all the encoder instances with same"]
168#[doc = "       parameters (except this one) in order to allow all the encoded parts"]
169#[doc = "       obey the same restrictions implied by header."]
170#[doc = ""]
171#[doc = " If offset is not 0, then stream header is omitted."]
172#[doc = " In any case output start is byte aligned, so for proper streams stitching"]
173#[doc = " \"predecessor\" stream must be flushed."]
174#[doc = ""]
175#[doc = " Range is not artificially limited, but all the values greater or equal to"]
176#[doc = " maximal window size have the same effect. Values greater than 2**30 are not"]
177#[doc = " allowed."]
178pub const BrotliEncoderParameter_BROTLI_PARAM_STREAM_OFFSET: BrotliEncoderParameter = 9;
179#[doc = " Options to be used with ::BrotliEncoderSetParameter."]
180pub type BrotliEncoderParameter = c_int;
181
182#[doc = " Raw LZ77 prefix dictionary."]
183pub const BrotliSharedDictionaryType_BROTLI_SHARED_DICTIONARY_RAW: BrotliSharedDictionaryType = 0;
184#[doc = " Serialized shared dictionary."]
185pub const BrotliSharedDictionaryType_BROTLI_SHARED_DICTIONARY_SERIALIZED:
186    BrotliSharedDictionaryType = 1;
187#[doc = " Input data type for ::BrotliSharedDictionaryAttach."]
188pub type BrotliSharedDictionaryType = c_int;
189
190#[doc = " Decoding error, e.g. corrupted input or memory allocation problem."]
191pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_ERROR: BrotliDecoderResult = 0;
192#[doc = " Decoding successfully completed."]
193pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_SUCCESS: BrotliDecoderResult = 1;
194#[doc = " Partially done; should be called again with more input."]
195pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: BrotliDecoderResult = 2;
196#[doc = " Partially done; should be called again with more output."]
197pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: BrotliDecoderResult = 3;
198#[doc = " Result type for ::BrotliDecoderDecompress and"]
199#[doc = " ::BrotliDecoderDecompressStream functions."]
200pub type BrotliDecoderResult = c_int;
201
202pub const BrotliDecoderErrorCode_BROTLI_DECODER_NO_ERROR: BrotliDecoderErrorCode = 0;
203pub const BrotliDecoderErrorCode_BROTLI_DECODER_SUCCESS: BrotliDecoderErrorCode = 1;
204pub const BrotliDecoderErrorCode_BROTLI_DECODER_NEEDS_MORE_INPUT: BrotliDecoderErrorCode = 2;
205pub const BrotliDecoderErrorCode_BROTLI_DECODER_NEEDS_MORE_OUTPUT: BrotliDecoderErrorCode = 3;
206pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:
207    BrotliDecoderErrorCode = -1;
208pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_RESERVED: BrotliDecoderErrorCode = -2;
209pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:
210    BrotliDecoderErrorCode = -3;
211pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:
212    BrotliDecoderErrorCode = -4;
213pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:
214    BrotliDecoderErrorCode = -5;
215pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: BrotliDecoderErrorCode = -6;
216pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: BrotliDecoderErrorCode =
217    -7;
218pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:
219    BrotliDecoderErrorCode = -8;
220pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:
221    BrotliDecoderErrorCode = -9;
222pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:
223    BrotliDecoderErrorCode = -10;
224pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: BrotliDecoderErrorCode =
225    -11;
226pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: BrotliDecoderErrorCode =
227    -12;
228pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: BrotliDecoderErrorCode =
229    -13;
230pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_PADDING_1: BrotliDecoderErrorCode =
231    -14;
232pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_PADDING_2: BrotliDecoderErrorCode =
233    -15;
234pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_DISTANCE: BrotliDecoderErrorCode = -16;
235pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_COMPOUND_DICTIONARY: BrotliDecoderErrorCode =
236    -18;
237pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: BrotliDecoderErrorCode =
238    -19;
239pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: BrotliDecoderErrorCode =
240    -20;
241pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: BrotliDecoderErrorCode =
242    -21;
243pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: BrotliDecoderErrorCode =
244    -22;
245pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: BrotliDecoderErrorCode =
246    -25;
247pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: BrotliDecoderErrorCode =
248    -26;
249pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: BrotliDecoderErrorCode =
250    -27;
251pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:
252    BrotliDecoderErrorCode = -30;
253pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_UNREACHABLE: BrotliDecoderErrorCode = -31;
254#[doc = " Error code for detailed logging / production debugging."]
255#[doc = ""]
256#[doc = " See ::BrotliDecoderGetErrorCode and ::BROTLI_LAST_ERROR_CODE."]
257pub type BrotliDecoderErrorCode = c_int;
258
259#[doc = " Disable \"canny\" ring buffer allocation strategy."]
260#[doc = ""]
261#[doc = " Ring buffer is allocated according to window size, despite the real size of"]
262#[doc = " the content."]
263pub const BrotliDecoderParameter_BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:
264    BrotliDecoderParameter = 0;
265#[doc = " Flag that determines if \"Large Window Brotli\" is used."]
266pub const BrotliDecoderParameter_BROTLI_DECODER_PARAM_LARGE_WINDOW: BrotliDecoderParameter = 1;
267#[doc = " Options to be used with ::BrotliDecoderSetParameter."]
268pub type BrotliDecoderParameter = c_int;
269
270#[doc = " Opaque structure that holds shared dictionary data."]
271#[doc = ""]
272#[doc = " Allocated and initialized with ::BrotliSharedDictionaryCreateInstance."]
273#[doc = " Cleaned up and deallocated with ::BrotliSharedDictionaryDestroyInstance."]
274#[repr(C)]
275pub struct BrotliSharedDictionary {
276    _unused: [u8; 0],
277    _marker: marker::PhantomData<(*mut u8, marker::PhantomPinned)>,
278}
279
280#[doc = " Opaque type for pointer to different possible internal structures containing"]
281#[doc = " dictionary prepared for the encoder"]
282#[repr(C)]
283pub struct BrotliEncoderPreparedDictionary {
284    _unused: [u8; 0],
285    _marker: marker::PhantomData<(*mut u8, marker::PhantomPinned)>,
286}
287
288#[doc = " Opaque structure that holds encoder state."]
289#[doc = ""]
290#[doc = " Allocated and initialized with ::BrotliEncoderCreateInstance."]
291#[doc = " Cleaned up and deallocated with ::BrotliEncoderDestroyInstance."]
292#[repr(C)]
293pub struct BrotliEncoderState {
294    _unused: [u8; 0],
295    _marker: marker::PhantomData<(*mut u8, marker::PhantomPinned)>,
296}
297
298#[doc = " Opaque structure that holds decoder state."]
299#[doc = ""]
300#[doc = " Allocated and initialized with ::BrotliDecoderCreateInstance."]
301#[doc = " Cleaned up and deallocated with ::BrotliDecoderDestroyInstance."]
302#[repr(C)]
303pub struct BrotliDecoderState {
304    _unused: [u8; 0],
305    _marker: marker::PhantomData<(*mut u8, marker::PhantomPinned)>,
306}
307
308extern "C" {
309    #[doc = " Prepares a shared dictionary from the given file format for the encoder."]
310    #[doc = ""]
311    #[doc = " @p alloc_func and @p free_func @b MUST be both zero or both non-zero. In the"]
312    #[doc = " case they are both zero, default memory allocators are used. @p opaque is"]
313    #[doc = " passed to @p alloc_func and @p free_func when they are called. @p free_func"]
314    #[doc = " has to return without doing anything when asked to free a NULL pointer."]
315    #[doc = ""]
316    #[doc = " @param type type of dictionary stored in data"]
317    #[doc = " @param data_size size of @p data buffer"]
318    #[doc = " @param data pointer to the dictionary data"]
319    #[doc = " @param quality the maximum Brotli quality to prepare the dictionary for,"]
320    #[doc = "        use BROTLI_MAX_QUALITY by default"]
321    #[doc = " @param alloc_func custom memory allocation function"]
322    #[doc = " @param free_func custom memory free function"]
323    #[doc = " @param opaque custom memory manager handle"]
324    pub fn BrotliEncoderPrepareDictionary(
325        type_: BrotliSharedDictionaryType,
326        data_size: usize,
327        data: *const u8,
328        quality: c_int,
329        alloc_func: brotli_alloc_func,
330        free_func: brotli_free_func,
331        opaque: *mut c_void,
332    ) -> *mut BrotliEncoderPreparedDictionary;
333
334    pub fn BrotliEncoderDestroyPreparedDictionary(dictionary: *mut BrotliEncoderPreparedDictionary);
335
336    #[doc = " Attaches a prepared dictionary of any type to the encoder. Can be used"]
337    #[doc = " multiple times to attach multiple dictionaries. The dictionary type was"]
338    #[doc = " determined by BrotliEncoderPrepareDictionary. Multiple raw prefix"]
339    #[doc = " dictionaries and/or max 1 serialized dictionary with custom words can be"]
340    #[doc = " attached."]
341    #[doc = ""]
342    #[doc = " @returns ::BROTLI_FALSE in case of error"]
343    #[doc = " @returns ::BROTLI_TRUE otherwise"]
344    pub fn BrotliEncoderAttachPreparedDictionary(
345        state: *mut BrotliEncoderState,
346        dictionary: *const BrotliEncoderPreparedDictionary,
347    ) -> BROTLI_BOOL;
348
349    #[doc = " Creates an instance of ::BrotliSharedDictionary."]
350    #[doc = ""]
351    #[doc = " Fresh instance has default word dictionary and transforms"]
352    #[doc = " and no LZ77 prefix dictionary."]
353    #[doc = ""]
354    #[doc = " @p alloc_func and @p free_func @b MUST be both zero or both non-zero. In the"]
355    #[doc = " case they are both zero, default memory allocators are used. @p opaque is"]
356    #[doc = " passed to @p alloc_func and @p free_func when they are called. @p free_func"]
357    #[doc = " has to return without doing anything when asked to free a NULL pointer."]
358    #[doc = ""]
359    #[doc = " @param alloc_func custom memory allocation function"]
360    #[doc = " @param free_func custom memory free function"]
361    #[doc = " @param opaque custom memory manager handle"]
362    #[doc = " @returns @c 0 if instance can not be allocated or initialized"]
363    #[doc = " @returns pointer to initialized ::BrotliSharedDictionary otherwise"]
364    pub fn BrotliSharedDictionaryCreateInstance(
365        alloc_func: brotli_alloc_func,
366        free_func: brotli_free_func,
367        opaque: *mut c_void,
368    ) -> *mut BrotliSharedDictionary;
369
370    #[doc = " Deinitializes and frees ::BrotliSharedDictionary instance."]
371    #[doc = ""]
372    #[doc = " @param dict shared dictionary instance to be cleaned up and deallocated"]
373    pub fn BrotliSharedDictionaryDestroyInstance(dict: *mut BrotliSharedDictionary);
374
375    #[doc = " Attaches dictionary to a given instance of ::BrotliSharedDictionary."]
376    #[doc = ""]
377    #[doc = " Dictionary to be attached is represented in a serialized format as a region"]
378    #[doc = " of memory."]
379    #[doc = ""]
380    #[doc = " Provided data it partially referenced by a resulting (compound) dictionary,"]
381    #[doc = " and should be kept untouched, while at least one compound dictionary uses it."]
382    #[doc = " This way memory overhead is kept minimal by the cost of additional resource"]
383    #[doc = " management."]
384    #[doc = ""]
385    #[doc = " @param dict dictionary to extend"]
386    #[doc = " @param type type of dictionary to attach"]
387    #[doc = " @param data_size size of @p data"]
388    #[doc = " @param data serialized dictionary of type @p type, with at least @p data_size"]
389    #[doc = "        addressable bytes"]
390    #[doc = " @returns ::BROTLI_TRUE if provided dictionary is successfully attached"]
391    #[doc = " @returns ::BROTLI_FALSE otherwise"]
392    pub fn BrotliSharedDictionaryAttach(
393        dict: *mut BrotliSharedDictionary,
394        type_: BrotliSharedDictionaryType,
395        data_size: usize,
396        data: *const u8,
397    ) -> BROTLI_BOOL;
398
399    #[doc = " Sets the specified parameter to the given encoder instance."]
400    #[doc = ""]
401    #[doc = " @param state encoder instance"]
402    #[doc = " @param param parameter to set"]
403    #[doc = " @param value new parameter value"]
404    #[doc = " @returns ::BROTLI_FALSE if parameter is unrecognized, or value is invalid"]
405    #[doc = " @returns ::BROTLI_FALSE if value of parameter can not be changed at current"]
406    #[doc = "          encoder state (e.g. when encoding is started, window size might be"]
407    #[doc = "          already encoded and therefore it is impossible to change it)"]
408    #[doc = " @returns ::BROTLI_TRUE if value is accepted"]
409    #[doc = " @warning invalid values might be accepted in case they would not break"]
410    #[doc = "          encoding process."]
411    pub fn BrotliEncoderSetParameter(
412        state: *mut BrotliEncoderState,
413        param: BrotliEncoderParameter,
414        value: u32,
415    ) -> BROTLI_BOOL;
416
417    #[doc = " Creates an instance of ::BrotliEncoderState and initializes it."]
418    #[doc = ""]
419    #[doc = " @p alloc_func and @p free_func @b MUST be both zero or both non-zero. In the"]
420    #[doc = " case they are both zero, default memory allocators are used. @p opaque is"]
421    #[doc = " passed to @p alloc_func and @p free_func when they are called. @p free_func"]
422    #[doc = " has to return without doing anything when asked to free a NULL pointer."]
423    #[doc = ""]
424    #[doc = " @param alloc_func custom memory allocation function"]
425    #[doc = " @param free_func custom memory free function"]
426    #[doc = " @param opaque custom memory manager handle"]
427    #[doc = " @returns @c 0 if instance can not be allocated or initialized"]
428    #[doc = " @returns pointer to initialized ::BrotliEncoderState otherwise"]
429    pub fn BrotliEncoderCreateInstance(
430        alloc_func: brotli_alloc_func,
431        free_func: brotli_free_func,
432        opaque: *mut c_void,
433    ) -> *mut BrotliEncoderState;
434
435    #[doc = " Deinitializes and frees ::BrotliEncoderState instance."]
436    #[doc = ""]
437    #[doc = " @param state decoder instance to be cleaned up and deallocated"]
438    pub fn BrotliEncoderDestroyInstance(state: *mut BrotliEncoderState);
439
440    #[doc = " Calculates the output size bound for the given @p input_size."]
441    #[doc = ""]
442    #[doc = " @warning Result is only valid if quality is at least @c 2 and, in"]
443    #[doc = "          case ::BrotliEncoderCompressStream was used, no flushes"]
444    #[doc = "          (::BROTLI_OPERATION_FLUSH) were performed."]
445    #[doc = ""]
446    #[doc = " @param input_size size of projected input"]
447    #[doc = " @returns @c 0 if result does not fit @c size_t"]
448    pub fn BrotliEncoderMaxCompressedSize(input_size: usize) -> usize;
449
450    #[doc = " Performs one-shot memory-to-memory compression."]
451    #[doc = ""]
452    #[doc = " Compresses the data in @p input_buffer into @p encoded_buffer, and sets"]
453    #[doc = " @p *encoded_size to the compressed length."]
454    #[doc = ""]
455    #[doc = " @note If ::BrotliEncoderMaxCompressedSize(@p input_size) returns non-zero"]
456    #[doc = "       value, then output is guaranteed to be no longer than that."]
457    #[doc = ""]
458    #[doc = " @note If @p lgwin is greater than ::BROTLI_MAX_WINDOW_BITS then resulting"]
459    #[doc = "       stream might be incompatible with RFC 7932; to decode such streams,"]
460    #[doc = "       decoder should be configured with"]
461    #[doc = "       ::BROTLI_DECODER_PARAM_LARGE_WINDOW = @c 1"]
462    #[doc = ""]
463    #[doc = " @param quality quality parameter value, e.g. ::BROTLI_DEFAULT_QUALITY"]
464    #[doc = " @param lgwin lgwin parameter value, e.g. ::BROTLI_DEFAULT_WINDOW"]
465    #[doc = " @param mode mode parameter value, e.g. ::BROTLI_DEFAULT_MODE"]
466    #[doc = " @param input_size size of @p input_buffer"]
467    #[doc = " @param input_buffer input data buffer with at least @p input_size"]
468    #[doc = "        addressable bytes"]
469    #[doc = " @param[in, out] encoded_size @b in: size of @p encoded_buffer; \\n"]
470    #[doc = "                 @b out: length of compressed data written to"]
471    #[doc = "                 @p encoded_buffer, or @c 0 if compression fails"]
472    #[doc = " @param encoded_buffer compressed data destination buffer"]
473    #[doc = " @returns ::BROTLI_FALSE in case of compression error"]
474    #[doc = " @returns ::BROTLI_FALSE if output buffer is too small"]
475    #[doc = " @returns ::BROTLI_TRUE otherwise"]
476    pub fn BrotliEncoderCompress(
477        quality: c_int,
478        lgwin: c_int,
479        mode: BrotliEncoderMode,
480        input_size: usize,
481        input_buffer: *const u8,
482        encoded_size: *mut usize,
483        encoded_buffer: *mut u8,
484    ) -> BROTLI_BOOL;
485
486    #[doc = " Compresses input stream to output stream."]
487    #[doc = ""]
488    #[doc = " The values @p *available_in and @p *available_out must specify the number of"]
489    #[doc = " bytes addressable at @p *next_in and @p *next_out respectively."]
490    #[doc = " When @p *available_out is @c 0, @p next_out is allowed to be @c NULL."]
491    #[doc = ""]
492    #[doc = " After each call, @p *available_in will be decremented by the amount of input"]
493    #[doc = " bytes consumed, and the @p *next_in pointer will be incremented by that"]
494    #[doc = " amount. Similarly, @p *available_out will be decremented by the amount of"]
495    #[doc = " output bytes written, and the @p *next_out pointer will be incremented by"]
496    #[doc = " that amount."]
497    #[doc = ""]
498    #[doc = " @p total_out, if it is not a null-pointer, will be set to the number"]
499    #[doc = " of bytes compressed since the last @p state initialization."]
500    #[doc = ""]
501    #[doc = ""]
502    #[doc = ""]
503    #[doc = " Internally workflow consists of 3 tasks:"]
504    #[doc = "  -# (optionally) copy input data to internal buffer"]
505    #[doc = "  -# actually compress data and (optionally) store it to internal buffer"]
506    #[doc = "  -# (optionally) copy compressed bytes from internal buffer to output stream"]
507    #[doc = ""]
508    #[doc = " Whenever all 3 tasks can't move forward anymore, or error occurs, this"]
509    #[doc = " method returns the control flow to caller."]
510    #[doc = ""]
511    #[doc = " @p op is used to perform flush, finish the stream, or inject metadata block."]
512    #[doc = " See ::BrotliEncoderOperation for more information."]
513    #[doc = ""]
514    #[doc = " Flushing the stream means forcing encoding of all input passed to encoder and"]
515    #[doc = " completing the current output block, so it could be fully decoded by stream"]
516    #[doc = " decoder. To perform flush set @p op to ::BROTLI_OPERATION_FLUSH."]
517    #[doc = " Under some circumstances (e.g. lack of output stream capacity) this operation"]
518    #[doc = " would require several calls to ::BrotliEncoderCompressStream. The method must"]
519    #[doc = " be called again until both input stream is depleted and encoder has no more"]
520    #[doc = " output (see ::BrotliEncoderHasMoreOutput) after the method is called."]
521    #[doc = ""]
522    #[doc = " Finishing the stream means encoding of all input passed to encoder and"]
523    #[doc = " adding specific \"final\" marks, so stream decoder could determine that stream"]
524    #[doc = " is complete. To perform finish set @p op to ::BROTLI_OPERATION_FINISH."]
525    #[doc = " Under some circumstances (e.g. lack of output stream capacity) this operation"]
526    #[doc = " would require several calls to ::BrotliEncoderCompressStream. The method must"]
527    #[doc = " be called again until both input stream is depleted and encoder has no more"]
528    #[doc = " output (see ::BrotliEncoderHasMoreOutput) after the method is called."]
529    #[doc = ""]
530    #[doc = " @warning When flushing and finishing, @p op should not change until operation"]
531    #[doc = "          is complete; input stream should not be swapped, reduced or"]
532    #[doc = "          extended as well."]
533    #[doc = ""]
534    #[doc = " @param state encoder instance"]
535    #[doc = " @param op requested operation"]
536    #[doc = " @param[in, out] available_in @b in: amount of available input; \\n"]
537    #[doc = "                 @b out: amount of unused input"]
538    #[doc = " @param[in, out] next_in pointer to the next input byte"]
539    #[doc = " @param[in, out] available_out @b in: length of output buffer; \\n"]
540    #[doc = "                 @b out: remaining size of output buffer"]
541    #[doc = " @param[in, out] next_out compressed output buffer cursor;"]
542    #[doc = "                 can be @c NULL if @p available_out is @c 0"]
543    #[doc = " @param[out] total_out number of bytes produced so far; can be @c NULL"]
544    #[doc = " @returns ::BROTLI_FALSE if there was an error"]
545    #[doc = " @returns ::BROTLI_TRUE otherwise"]
546    pub fn BrotliEncoderCompressStream(
547        state: *mut BrotliEncoderState,
548        op: BrotliEncoderOperation,
549        available_in: *mut usize,
550        next_in: *mut *const u8,
551        available_out: *mut usize,
552        next_out: *mut *mut u8,
553        total_out: *mut usize,
554    ) -> BROTLI_BOOL;
555
556    #[doc = " Checks if encoder instance reached the final state."]
557    #[doc = ""]
558    #[doc = " @param state encoder instance"]
559    #[doc = " @returns ::BROTLI_TRUE if encoder is in a state where it reached the end of"]
560    #[doc = "          the input and produced all of the output"]
561    #[doc = " @returns ::BROTLI_FALSE otherwise"]
562    pub fn BrotliEncoderIsFinished(state: *mut BrotliEncoderState) -> BROTLI_BOOL;
563
564    #[doc = " Checks if encoder has more output."]
565    #[doc = ""]
566    #[doc = " @param state encoder instance"]
567    #[doc = " @returns ::BROTLI_TRUE, if encoder has some unconsumed output"]
568    #[doc = " @returns ::BROTLI_FALSE otherwise"]
569    pub fn BrotliEncoderHasMoreOutput(state: *mut BrotliEncoderState) -> BROTLI_BOOL;
570
571    #[doc = " Acquires pointer to internal output buffer."]
572    #[doc = ""]
573    #[doc = " This method is used to make language bindings easier and more efficient:"]
574    #[doc = "  -# push data to ::BrotliEncoderCompressStream,"]
575    #[doc = "     until ::BrotliEncoderHasMoreOutput returns BROTL_TRUE"]
576    #[doc = "  -# use ::BrotliEncoderTakeOutput to peek bytes and copy to language-specific"]
577    #[doc = "     entity"]
578    #[doc = ""]
579    #[doc = " Also this could be useful if there is an output stream that is able to"]
580    #[doc = " consume all the provided data (e.g. when data is saved to file system)."]
581    #[doc = ""]
582    #[doc = " @attention After every call to ::BrotliEncoderTakeOutput @p *size bytes of"]
583    #[doc = "            output are considered consumed for all consecutive calls to the"]
584    #[doc = "            instance methods; returned pointer becomes invalidated as well."]
585    #[doc = ""]
586    #[doc = " @note Encoder output is not guaranteed to be contiguous. This means that"]
587    #[doc = "       after the size-unrestricted call to ::BrotliEncoderTakeOutput,"]
588    #[doc = "       immediate next call to ::BrotliEncoderTakeOutput may return more data."]
589    #[doc = ""]
590    #[doc = " @param state encoder instance"]
591    #[doc = " @param[in, out] size @b in: number of bytes caller is ready to take, @c 0 if"]
592    #[doc = "                 any amount could be handled; \\n"]
593    #[doc = "                 @b out: amount of data pointed by returned pointer and"]
594    #[doc = "                 considered consumed; \\n"]
595    #[doc = "                 out value is never greater than in value, unless it is @c 0"]
596    #[doc = " @returns pointer to output data"]
597    pub fn BrotliEncoderTakeOutput(state: *const BrotliEncoderState, size: *mut usize)
598    -> *const u8;
599
600    pub fn BrotliEncoderEstimatePeakMemoryUsage(
601        quality: c_int,
602        lgwin: c_int,
603        input_size: usize,
604    ) -> usize;
605
606    pub fn BrotliEncoderGetPreparedDictionarySize(
607        dictionary: *const BrotliEncoderPreparedDictionary,
608    ) -> usize;
609
610    #[doc = " Gets an encoder library version."]
611    #[doc = ""]
612    #[doc = " Look at BROTLI_VERSION for more information."]
613    pub fn BrotliEncoderVersion() -> u32;
614
615    #[doc = " Sets the specified parameter to the given decoder instance."]
616    #[doc = ""]
617    #[doc = " @param state decoder instance"]
618    #[doc = " @param param parameter to set"]
619    #[doc = " @param value new parameter value"]
620    #[doc = " @returns ::BROTLI_FALSE if parameter is unrecognized, or value is invalid"]
621    #[doc = " @returns ::BROTLI_TRUE if value is accepted"]
622    pub fn BrotliDecoderSetParameter(
623        state: *mut BrotliDecoderState,
624        param: BrotliDecoderParameter,
625        value: u32,
626    ) -> BROTLI_BOOL;
627
628    #[doc = " Adds LZ77 prefix dictionary, adds or replaces built-in static dictionary and"]
629    #[doc = " transforms."]
630    #[doc = ""]
631    #[doc = " Attached dictionary ownership is not transferred."]
632    #[doc = " Data provided to this method should be kept accessible until"]
633    #[doc = " decoding is finished and decoder instance is destroyed."]
634    #[doc = ""]
635    #[doc = " @note Dictionaries can NOT be attached after actual decoding is started."]
636    #[doc = ""]
637    #[doc = " @param state decoder instance"]
638    #[doc = " @param type dictionary data format"]
639    #[doc = " @param data_size length of memory region pointed by @p data"]
640    #[doc = " @param data dictionary data in format corresponding to @p type"]
641    #[doc = " @returns ::BROTLI_FALSE if dictionary is corrupted,"]
642    #[doc = "          or dictionary count limit is reached"]
643    #[doc = " @returns ::BROTLI_TRUE if dictionary is accepted / attached"]
644    pub fn BrotliDecoderAttachDictionary(
645        state: *mut BrotliDecoderState,
646        type_: BrotliSharedDictionaryType,
647        data_size: usize,
648        data: *const u8,
649    ) -> BROTLI_BOOL;
650
651    #[doc = " Creates an instance of ::BrotliDecoderState and initializes it."]
652    #[doc = ""]
653    #[doc = " The instance can be used once for decoding and should then be destroyed with"]
654    #[doc = " ::BrotliDecoderDestroyInstance, it cannot be reused for a new decoding"]
655    #[doc = " session."]
656    #[doc = ""]
657    #[doc = " @p alloc_func and @p free_func @b MUST be both zero or both non-zero. In the"]
658    #[doc = " case they are both zero, default memory allocators are used. @p opaque is"]
659    #[doc = " passed to @p alloc_func and @p free_func when they are called. @p free_func"]
660    #[doc = " has to return without doing anything when asked to free a NULL pointer."]
661    #[doc = ""]
662    #[doc = " @param alloc_func custom memory allocation function"]
663    #[doc = " @param free_func custom memory free function"]
664    #[doc = " @param opaque custom memory manager handle"]
665    #[doc = " @returns @c 0 if instance can not be allocated or initialized"]
666    #[doc = " @returns pointer to initialized ::BrotliDecoderState otherwise"]
667    pub fn BrotliDecoderCreateInstance(
668        alloc_func: brotli_alloc_func,
669        free_func: brotli_free_func,
670        opaque: *mut ::std::os::raw::c_void,
671    ) -> *mut BrotliDecoderState;
672
673    #[doc = " Deinitializes and frees ::BrotliDecoderState instance."]
674    #[doc = ""]
675    #[doc = " @param state decoder instance to be cleaned up and deallocated"]
676    pub fn BrotliDecoderDestroyInstance(state: *mut BrotliDecoderState);
677
678    #[doc = " Performs one-shot memory-to-memory decompression."]
679    #[doc = ""]
680    #[doc = " Decompresses the data in @p encoded_buffer into @p decoded_buffer, and sets"]
681    #[doc = " @p *decoded_size to the decompressed length."]
682    #[doc = ""]
683    #[doc = " @param encoded_size size of @p encoded_buffer"]
684    #[doc = " @param encoded_buffer compressed data buffer with at least @p encoded_size"]
685    #[doc = "        addressable bytes"]
686    #[doc = " @param[in, out] decoded_size @b in: size of @p decoded_buffer; \\n"]
687    #[doc = "                 @b out: length of decompressed data written to"]
688    #[doc = "                 @p decoded_buffer"]
689    #[doc = " @param decoded_buffer decompressed data destination buffer"]
690    #[doc = " @returns ::BROTLI_DECODER_RESULT_ERROR if input is corrupted, memory"]
691    #[doc = "          allocation failed, or @p decoded_buffer is not large enough;"]
692    #[doc = " @returns ::BROTLI_DECODER_RESULT_SUCCESS otherwise"]
693    pub fn BrotliDecoderDecompress(
694        encoded_size: usize,
695        encoded_buffer: *const u8,
696        decoded_size: *mut usize,
697        decoded_buffer: *mut u8,
698    ) -> BrotliDecoderResult;
699
700    #[doc = " Decompresses the input stream to the output stream."]
701    #[doc = ""]
702    #[doc = " The values @p *available_in and @p *available_out must specify the number of"]
703    #[doc = " bytes addressable at @p *next_in and @p *next_out respectively."]
704    #[doc = " When @p *available_out is @c 0, @p next_out is allowed to be @c NULL."]
705    #[doc = ""]
706    #[doc = " After each call, @p *available_in will be decremented by the amount of input"]
707    #[doc = " bytes consumed, and the @p *next_in pointer will be incremented by that"]
708    #[doc = " amount. Similarly, @p *available_out will be decremented by the amount of"]
709    #[doc = " output bytes written, and the @p *next_out pointer will be incremented by"]
710    #[doc = " that amount."]
711    #[doc = ""]
712    #[doc = " @p total_out, if it is not a null-pointer, will be set to the number"]
713    #[doc = " of bytes decompressed since the last @p state initialization."]
714    #[doc = ""]
715    #[doc = " @note Input is never overconsumed, so @p next_in and @p available_in could be"]
716    #[doc = " passed to the next consumer after decoding is complete."]
717    #[doc = ""]
718    #[doc = " @param state decoder instance"]
719    #[doc = " @param[in, out] available_in @b in: amount of available input; \\n"]
720    #[doc = "                 @b out: amount of unused input"]
721    #[doc = " @param[in, out] next_in pointer to the next compressed byte"]
722    #[doc = " @param[in, out] available_out @b in: length of output buffer; \\n"]
723    #[doc = "                 @b out: remaining size of output buffer"]
724    #[doc = " @param[in, out] next_out output buffer cursor;"]
725    #[doc = "                 can be @c NULL if @p available_out is @c 0"]
726    #[doc = " @param[out] total_out number of bytes decompressed so far; can be @c NULL"]
727    #[doc = " @returns ::BROTLI_DECODER_RESULT_ERROR if input is corrupted, memory"]
728    #[doc = "          allocation failed, arguments were invalid, etc.;"]
729    #[doc = "          use ::BrotliDecoderGetErrorCode to get detailed error code"]
730    #[doc = " @returns ::BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT decoding is blocked until"]
731    #[doc = "          more input data is provided"]
732    #[doc = " @returns ::BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT decoding is blocked until"]
733    #[doc = "          more output space is provided"]
734    #[doc = " @returns ::BROTLI_DECODER_RESULT_SUCCESS decoding is finished, no more"]
735    #[doc = "          input might be consumed and no more output will be produced"]
736    pub fn BrotliDecoderDecompressStream(
737        state: *mut BrotliDecoderState,
738        available_in: *mut usize,
739        next_in: *mut *const u8,
740        available_out: *mut usize,
741        next_out: *mut *mut u8,
742        total_out: *mut usize,
743    ) -> BrotliDecoderResult;
744
745    #[doc = " Checks if decoder has more output."]
746    #[doc = ""]
747    #[doc = " @param state decoder instance"]
748    #[doc = " @returns ::BROTLI_TRUE, if decoder has some unconsumed output"]
749    #[doc = " @returns ::BROTLI_FALSE otherwise"]
750    pub fn BrotliDecoderHasMoreOutput(state: *const BrotliDecoderState) -> BROTLI_BOOL;
751
752    #[doc = " Acquires pointer to internal output buffer."]
753    #[doc = ""]
754    #[doc = " This method is used to make language bindings easier and more efficient:"]
755    #[doc = "  -# push data to ::BrotliDecoderDecompressStream,"]
756    #[doc = "     until ::BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT is reported"]
757    #[doc = "  -# use ::BrotliDecoderTakeOutput to peek bytes and copy to language-specific"]
758    #[doc = "     entity"]
759    #[doc = ""]
760    #[doc = " Also this could be useful if there is an output stream that is able to"]
761    #[doc = " consume all the provided data (e.g. when data is saved to file system)."]
762    #[doc = ""]
763    #[doc = " @attention After every call to ::BrotliDecoderTakeOutput @p *size bytes of"]
764    #[doc = "            output are considered consumed for all consecutive calls to the"]
765    #[doc = "            instance methods; returned pointer becomes invalidated as well."]
766    #[doc = ""]
767    #[doc = " @note Decoder output is not guaranteed to be contiguous. This means that"]
768    #[doc = "       after the size-unrestricted call to ::BrotliDecoderTakeOutput,"]
769    #[doc = "       immediate next call to ::BrotliDecoderTakeOutput may return more data."]
770    #[doc = ""]
771    #[doc = " @param state decoder instance"]
772    #[doc = " @param[in, out] size @b in: number of bytes caller is ready to take, @c 0 if"]
773    #[doc = "                 any amount could be handled; \\n"]
774    #[doc = "                 @b out: amount of data pointed by returned pointer and"]
775    #[doc = "                 considered consumed; \\n"]
776    #[doc = "                 out value is never greater than in value, unless it is @c 0"]
777    #[doc = " @returns pointer to output data"]
778    pub fn BrotliDecoderTakeOutput(state: *mut BrotliDecoderState, size: *mut usize) -> *const u8;
779
780    #[doc = " Checks if instance has already consumed input."]
781    #[doc = ""]
782    #[doc = " Instance that returns ::BROTLI_FALSE is considered \"fresh\" and could be"]
783    #[doc = " reused."]
784    #[doc = ""]
785    #[doc = " @param state decoder instance"]
786    #[doc = " @returns ::BROTLI_TRUE if decoder has already used some input bytes"]
787    #[doc = " @returns ::BROTLI_FALSE otherwise"]
788    pub fn BrotliDecoderIsUsed(state: *const BrotliDecoderState) -> BROTLI_BOOL;
789
790    #[doc = " Checks if decoder instance reached the final state."]
791    #[doc = ""]
792    #[doc = " @param state decoder instance"]
793    #[doc = " @returns ::BROTLI_TRUE if decoder is in a state where it reached the end of"]
794    #[doc = "          the input and produced all of the output"]
795    #[doc = " @returns ::BROTLI_FALSE otherwise"]
796    pub fn BrotliDecoderIsFinished(state: *const BrotliDecoderState) -> BROTLI_BOOL;
797
798    #[doc = " Acquires a detailed error code."]
799    #[doc = ""]
800    #[doc = " Should be used only after ::BrotliDecoderDecompressStream returns"]
801    #[doc = " ::BROTLI_DECODER_RESULT_ERROR."]
802    #[doc = ""]
803    #[doc = " See also ::BrotliDecoderErrorString"]
804    #[doc = ""]
805    #[doc = " @param state decoder instance"]
806    #[doc = " @returns last saved error code"]
807    pub fn BrotliDecoderGetErrorCode(state: *const BrotliDecoderState) -> BrotliDecoderErrorCode;
808
809    #[doc = " Converts error code to a c-string."]
810    pub fn BrotliDecoderErrorString(c: BrotliDecoderErrorCode) -> *const c_char;
811
812    #[doc = " Gets a decoder library version."]
813    #[doc = ""]
814    #[doc = " Look at BROTLI_VERSION for more information."]
815    pub fn BrotliDecoderVersion() -> u32;
816}