1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
/* automatically generated by rust-bindgen 0.69.4 */


#![no_std]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]


pub type brotli_alloc_func = ::core::option::Option<
    unsafe extern "C" fn(opaque: *mut libc::c_void, size: usize) -> *mut libc::c_void,
>;
pub type brotli_free_func = ::core::option::Option<
    unsafe extern "C" fn(opaque: *mut libc::c_void, address: *mut libc::c_void),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct BrotliSharedDictionaryStruct {
    _unused: [u8; 0],
}
pub type BrotliSharedDictionary = BrotliSharedDictionaryStruct;
pub const BrotliSharedDictionaryType_BROTLI_SHARED_DICTIONARY_RAW: BrotliSharedDictionaryType = 0;
pub const BrotliSharedDictionaryType_BROTLI_SHARED_DICTIONARY_SERIALIZED:
    BrotliSharedDictionaryType = 1;
pub type BrotliSharedDictionaryType = libc::c_int;
extern "C" {
    pub fn BrotliSharedDictionaryCreateInstance(
        alloc_func: brotli_alloc_func,
        free_func: brotli_free_func,
        opaque: *mut libc::c_void,
    ) -> *mut BrotliSharedDictionary;
}
extern "C" {
    pub fn BrotliSharedDictionaryDestroyInstance(dict: *mut BrotliSharedDictionary);
}
extern "C" {
    pub fn BrotliSharedDictionaryAttach(
        dict: *mut BrotliSharedDictionary,
        type_: BrotliSharedDictionaryType,
        data_size: usize,
        data: *const u8,
    ) -> libc::c_int;
}
pub const BrotliEncoderMode_BROTLI_MODE_GENERIC: BrotliEncoderMode = 0;
pub const BrotliEncoderMode_BROTLI_MODE_TEXT: BrotliEncoderMode = 1;
pub const BrotliEncoderMode_BROTLI_MODE_FONT: BrotliEncoderMode = 2;
pub type BrotliEncoderMode = libc::c_int;
pub const BrotliEncoderOperation_BROTLI_OPERATION_PROCESS: BrotliEncoderOperation = 0;
pub const BrotliEncoderOperation_BROTLI_OPERATION_FLUSH: BrotliEncoderOperation = 1;
pub const BrotliEncoderOperation_BROTLI_OPERATION_FINISH: BrotliEncoderOperation = 2;
pub const BrotliEncoderOperation_BROTLI_OPERATION_EMIT_METADATA: BrotliEncoderOperation = 3;
pub type BrotliEncoderOperation = libc::c_int;
pub const BrotliEncoderParameter_BROTLI_PARAM_MODE: BrotliEncoderParameter = 0;
pub const BrotliEncoderParameter_BROTLI_PARAM_QUALITY: BrotliEncoderParameter = 1;
pub const BrotliEncoderParameter_BROTLI_PARAM_LGWIN: BrotliEncoderParameter = 2;
pub const BrotliEncoderParameter_BROTLI_PARAM_LGBLOCK: BrotliEncoderParameter = 3;
pub const BrotliEncoderParameter_BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:
    BrotliEncoderParameter = 4;
pub const BrotliEncoderParameter_BROTLI_PARAM_SIZE_HINT: BrotliEncoderParameter = 5;
pub const BrotliEncoderParameter_BROTLI_PARAM_LARGE_WINDOW: BrotliEncoderParameter = 6;
pub const BrotliEncoderParameter_BROTLI_PARAM_NPOSTFIX: BrotliEncoderParameter = 7;
pub const BrotliEncoderParameter_BROTLI_PARAM_NDIRECT: BrotliEncoderParameter = 8;
pub const BrotliEncoderParameter_BROTLI_PARAM_STREAM_OFFSET: BrotliEncoderParameter = 9;
pub type BrotliEncoderParameter = libc::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct BrotliEncoderStateStruct {
    _unused: [u8; 0],
}
pub type BrotliEncoderState = BrotliEncoderStateStruct;
extern "C" {
    pub fn BrotliEncoderSetParameter(
        state: *mut BrotliEncoderState,
        param: BrotliEncoderParameter,
        value: u32,
    ) -> libc::c_int;
}
extern "C" {
    pub fn BrotliEncoderCreateInstance(
        alloc_func: brotli_alloc_func,
        free_func: brotli_free_func,
        opaque: *mut libc::c_void,
    ) -> *mut BrotliEncoderState;
}
extern "C" {
    pub fn BrotliEncoderDestroyInstance(state: *mut BrotliEncoderState);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct BrotliEncoderPreparedDictionaryStruct {
    _unused: [u8; 0],
}
pub type BrotliEncoderPreparedDictionary = BrotliEncoderPreparedDictionaryStruct;
extern "C" {
    pub fn BrotliEncoderPrepareDictionary(
        type_: BrotliSharedDictionaryType,
        data_size: usize,
        data: *const u8,
        quality: libc::c_int,
        alloc_func: brotli_alloc_func,
        free_func: brotli_free_func,
        opaque: *mut libc::c_void,
    ) -> *mut BrotliEncoderPreparedDictionary;
}
extern "C" {
    pub fn BrotliEncoderDestroyPreparedDictionary(dictionary: *mut BrotliEncoderPreparedDictionary);
}
extern "C" {
    pub fn BrotliEncoderAttachPreparedDictionary(
        state: *mut BrotliEncoderState,
        dictionary: *const BrotliEncoderPreparedDictionary,
    ) -> libc::c_int;
}
extern "C" {
    pub fn BrotliEncoderMaxCompressedSize(input_size: usize) -> usize;
}
extern "C" {
    pub fn BrotliEncoderCompress(
        quality: libc::c_int,
        lgwin: libc::c_int,
        mode: BrotliEncoderMode,
        input_size: usize,
        input_buffer: *const u8,
        encoded_size: *mut usize,
        encoded_buffer: *mut u8,
    ) -> libc::c_int;
}
extern "C" {
    pub fn BrotliEncoderCompressStream(
        state: *mut BrotliEncoderState,
        op: BrotliEncoderOperation,
        available_in: *mut usize,
        next_in: *mut *const u8,
        available_out: *mut usize,
        next_out: *mut *mut u8,
        total_out: *mut usize,
    ) -> libc::c_int;
}
extern "C" {
    pub fn BrotliEncoderIsFinished(state: *mut BrotliEncoderState) -> libc::c_int;
}
extern "C" {
    pub fn BrotliEncoderHasMoreOutput(state: *mut BrotliEncoderState) -> libc::c_int;
}
extern "C" {
    pub fn BrotliEncoderTakeOutput(state: *mut BrotliEncoderState, size: *mut usize) -> *const u8;
}
extern "C" {
    pub fn BrotliEncoderEstimatePeakMemoryUsage(
        quality: libc::c_int,
        lgwin: libc::c_int,
        input_size: usize,
    ) -> usize;
}
extern "C" {
    pub fn BrotliEncoderGetPreparedDictionarySize(
        dictionary: *const BrotliEncoderPreparedDictionary,
    ) -> usize;
}
extern "C" {
    pub fn BrotliEncoderVersion() -> u32;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct BrotliDecoderStateStruct {
    _unused: [u8; 0],
}
pub type BrotliDecoderState = BrotliDecoderStateStruct;
pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_ERROR: BrotliDecoderResult = 0;
pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_SUCCESS: BrotliDecoderResult = 1;
pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: BrotliDecoderResult = 2;
pub const BrotliDecoderResult_BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: BrotliDecoderResult = 3;
pub type BrotliDecoderResult = libc::c_int;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_NO_ERROR: BrotliDecoderErrorCode = 0;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_SUCCESS: BrotliDecoderErrorCode = 1;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_NEEDS_MORE_INPUT: BrotliDecoderErrorCode = 2;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_NEEDS_MORE_OUTPUT: BrotliDecoderErrorCode = 3;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:
    BrotliDecoderErrorCode = -1;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_RESERVED: BrotliDecoderErrorCode = -2;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:
    BrotliDecoderErrorCode = -3;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:
    BrotliDecoderErrorCode = -4;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:
    BrotliDecoderErrorCode = -5;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: BrotliDecoderErrorCode = -6;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: BrotliDecoderErrorCode =
    -7;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:
    BrotliDecoderErrorCode = -8;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:
    BrotliDecoderErrorCode = -9;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:
    BrotliDecoderErrorCode = -10;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: BrotliDecoderErrorCode =
    -11;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: BrotliDecoderErrorCode =
    -12;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: BrotliDecoderErrorCode =
    -13;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_PADDING_1: BrotliDecoderErrorCode =
    -14;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_PADDING_2: BrotliDecoderErrorCode =
    -15;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_FORMAT_DISTANCE: BrotliDecoderErrorCode = -16;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_COMPOUND_DICTIONARY: BrotliDecoderErrorCode =
    -18;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: BrotliDecoderErrorCode =
    -19;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: BrotliDecoderErrorCode =
    -20;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: BrotliDecoderErrorCode =
    -21;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: BrotliDecoderErrorCode =
    -22;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: BrotliDecoderErrorCode =
    -25;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: BrotliDecoderErrorCode =
    -26;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: BrotliDecoderErrorCode =
    -27;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:
    BrotliDecoderErrorCode = -30;
pub const BrotliDecoderErrorCode_BROTLI_DECODER_ERROR_UNREACHABLE: BrotliDecoderErrorCode = -31;
pub type BrotliDecoderErrorCode = libc::c_int;
pub const BrotliDecoderParameter_BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:
    BrotliDecoderParameter = 0;
pub const BrotliDecoderParameter_BROTLI_DECODER_PARAM_LARGE_WINDOW: BrotliDecoderParameter = 1;
pub type BrotliDecoderParameter = libc::c_int;
extern "C" {
    pub fn BrotliDecoderSetParameter(
        state: *mut BrotliDecoderState,
        param: BrotliDecoderParameter,
        value: u32,
    ) -> libc::c_int;
}
extern "C" {
    pub fn BrotliDecoderAttachDictionary(
        state: *mut BrotliDecoderState,
        type_: BrotliSharedDictionaryType,
        data_size: usize,
        data: *const u8,
    ) -> libc::c_int;
}
extern "C" {
    pub fn BrotliDecoderCreateInstance(
        alloc_func: brotli_alloc_func,
        free_func: brotli_free_func,
        opaque: *mut libc::c_void,
    ) -> *mut BrotliDecoderState;
}
extern "C" {
    pub fn BrotliDecoderDestroyInstance(state: *mut BrotliDecoderState);
}
extern "C" {
    pub fn BrotliDecoderDecompress(
        encoded_size: usize,
        encoded_buffer: *const u8,
        decoded_size: *mut usize,
        decoded_buffer: *mut u8,
    ) -> BrotliDecoderResult;
}
extern "C" {
    pub fn BrotliDecoderDecompressStream(
        state: *mut BrotliDecoderState,
        available_in: *mut usize,
        next_in: *mut *const u8,
        available_out: *mut usize,
        next_out: *mut *mut u8,
        total_out: *mut usize,
    ) -> BrotliDecoderResult;
}
extern "C" {
    pub fn BrotliDecoderHasMoreOutput(state: *const BrotliDecoderState) -> libc::c_int;
}
extern "C" {
    pub fn BrotliDecoderTakeOutput(state: *mut BrotliDecoderState, size: *mut usize) -> *const u8;
}
extern "C" {
    pub fn BrotliDecoderIsUsed(state: *const BrotliDecoderState) -> libc::c_int;
}
extern "C" {
    pub fn BrotliDecoderIsFinished(state: *const BrotliDecoderState) -> libc::c_int;
}
extern "C" {
    pub fn BrotliDecoderGetErrorCode(state: *const BrotliDecoderState) -> BrotliDecoderErrorCode;
}
extern "C" {
    pub fn BrotliDecoderErrorString(c: BrotliDecoderErrorCode) -> *const libc::c_char;
}
extern "C" {
    pub fn BrotliDecoderVersion() -> u32;
}
pub type brotli_decoder_metadata_start_func =
    ::core::option::Option<unsafe extern "C" fn(opaque: *mut libc::c_void, size: usize)>;
pub type brotli_decoder_metadata_chunk_func = ::core::option::Option<
    unsafe extern "C" fn(opaque: *mut libc::c_void, data: *const u8, size: usize),
>;
extern "C" {
    pub fn BrotliDecoderSetMetadataCallbacks(
        state: *mut BrotliDecoderState,
        start_func: brotli_decoder_metadata_start_func,
        chunk_func: brotli_decoder_metadata_chunk_func,
        opaque: *mut libc::c_void,
    );
}