@@ -21,7 +21,10 @@ pub type voidpf = *mut c_void;
21
21
pub enum gzFile_s { }
22
22
pub enum internal_state { }
23
23
24
- #[ cfg( all( feature = "libc" , not( all( target_family = "wasm" , target_os = "unknown" ) ) ) ) ]
24
+ #[ cfg( all(
25
+ feature = "libc" ,
26
+ not( all( target_family = "wasm" , target_os = "unknown" ) )
27
+ ) ) ]
25
28
pub type z_off_t = libc:: off_t ;
26
29
27
30
#[ cfg( all( feature = "libc" , all( target_family = "wasm" , target_os = "unknown" ) ) ) ]
@@ -73,95 +76,115 @@ extern "C" {
73
76
pub fn deflateBound ( strm : z_streamp , sourceLen : uLong ) -> uLong ;
74
77
pub fn deflateCopy ( dest : z_streamp , source : z_streamp ) -> c_int ;
75
78
pub fn deflateEnd ( strm : z_streamp ) -> c_int ;
76
- pub fn deflateInit_ ( strm : z_streamp , level : c_int ,
77
- version : * const c_char ,
78
- stream_size : c_int ) -> c_int ;
79
- pub fn deflateInit2_ ( strm : z_streamp ,
80
- level : c_int ,
81
- method : c_int ,
82
- windowBits : c_int ,
83
- memLevel : c_int ,
84
- strategy : c_int ,
85
- version : * const c_char ,
86
- stream_size : c_int ) -> c_int ;
87
- pub fn deflateParams ( strm : z_streamp ,
88
- level : c_int ,
89
- strategy : c_int ) -> c_int ;
79
+ pub fn deflateInit_ (
80
+ strm : z_streamp ,
81
+ level : c_int ,
82
+ version : * const c_char ,
83
+ stream_size : c_int ,
84
+ ) -> c_int ;
85
+ pub fn deflateInit2_ (
86
+ strm : z_streamp ,
87
+ level : c_int ,
88
+ method : c_int ,
89
+ windowBits : c_int ,
90
+ memLevel : c_int ,
91
+ strategy : c_int ,
92
+ version : * const c_char ,
93
+ stream_size : c_int ,
94
+ ) -> c_int ;
95
+ pub fn deflateParams ( strm : z_streamp , level : c_int , strategy : c_int ) -> c_int ;
90
96
pub fn deflatePrime ( strm : z_streamp , bits : c_int , value : c_int ) -> c_int ;
91
97
pub fn deflateReset ( strm : z_streamp ) -> c_int ;
92
- pub fn deflateSetDictionary ( strm : z_streamp ,
93
- dictionary : * const Bytef ,
94
- dictLength : uInt ) -> c_int ;
98
+ pub fn deflateSetDictionary (
99
+ strm : z_streamp ,
100
+ dictionary : * const Bytef ,
101
+ dictLength : uInt ,
102
+ ) -> c_int ;
95
103
pub fn deflateSetHeader ( strm : z_streamp , head : gz_headerp ) -> c_int ;
96
- pub fn deflateTune ( strm : z_streamp ,
97
- good_length : c_int ,
98
- max_lazy : c_int ,
99
- nice_length : c_int ,
100
- max_chain : c_int ) -> c_int ;
104
+ pub fn deflateTune (
105
+ strm : z_streamp ,
106
+ good_length : c_int ,
107
+ max_lazy : c_int ,
108
+ nice_length : c_int ,
109
+ max_chain : c_int ,
110
+ ) -> c_int ;
101
111
pub fn inflate ( strm : z_streamp , flush : c_int ) -> c_int ;
102
- pub fn inflateBack ( strm : z_streamp ,
103
- _in : in_func ,
104
- in_desc : * mut c_void ,
105
- out : out_func ,
106
- out_desc : * mut c_void ) -> c_int ;
112
+ pub fn inflateBack (
113
+ strm : z_streamp ,
114
+ _in : in_func ,
115
+ in_desc : * mut c_void ,
116
+ out : out_func ,
117
+ out_desc : * mut c_void ,
118
+ ) -> c_int ;
107
119
pub fn inflateBackEnd ( strm : z_streamp ) -> c_int ;
108
- pub fn inflateBackInit_ ( strm : z_streamp ,
109
- windowBits : c_int ,
110
- window : * mut c_uchar ,
111
- version : * const c_char ,
112
- stream_size : c_int ) -> c_int ;
120
+ pub fn inflateBackInit_ (
121
+ strm : z_streamp ,
122
+ windowBits : c_int ,
123
+ window : * mut c_uchar ,
124
+ version : * const c_char ,
125
+ stream_size : c_int ,
126
+ ) -> c_int ;
113
127
pub fn inflateCopy ( dest : z_streamp , source : z_streamp ) -> c_int ;
114
128
pub fn inflateEnd ( strm : z_streamp ) -> c_int ;
115
129
pub fn inflateGetHeader ( strm : z_streamp , head : gz_headerp ) -> c_int ;
116
- pub fn inflateInit_ ( strm : z_streamp ,
117
- version : * const c_char ,
118
- stream_size : c_int ) -> c_int ;
119
- pub fn inflateInit2_ ( strm : z_streamp ,
120
- windowBits : c_int ,
121
- version : * const c_char ,
122
- stream_size : c_int ) -> c_int ;
130
+ pub fn inflateInit_ ( strm : z_streamp , version : * const c_char , stream_size : c_int ) -> c_int ;
131
+ pub fn inflateInit2_ (
132
+ strm : z_streamp ,
133
+ windowBits : c_int ,
134
+ version : * const c_char ,
135
+ stream_size : c_int ,
136
+ ) -> c_int ;
123
137
pub fn inflateMark ( strm : z_streamp ) -> c_long ;
124
138
pub fn inflatePrime ( strm : z_streamp , bits : c_int , value : c_int ) -> c_int ;
125
139
pub fn inflateReset ( strm : z_streamp ) -> c_int ;
126
140
pub fn inflateReset2 ( strm : z_streamp , windowBits : c_int ) -> c_int ;
127
- pub fn inflateSetDictionary ( strm : z_streamp ,
128
- dictionary : * const Bytef ,
129
- dictLength : uInt ) -> c_int ;
141
+ pub fn inflateSetDictionary (
142
+ strm : z_streamp ,
143
+ dictionary : * const Bytef ,
144
+ dictLength : uInt ,
145
+ ) -> c_int ;
130
146
pub fn inflateSync ( strm : z_streamp ) -> c_int ;
131
147
pub fn zlibCompileFlags ( ) -> uLong ;
132
148
pub fn zlibVersion ( ) -> * const c_char ;
133
149
134
-
135
- // The above set of functions currently target 1.2.3.4 (what's present on Ubuntu
136
- // 12.04, but there's some other APIs that were added later. Should figure out
137
- // how to expose them...
138
- //
139
- // Added in 1.2.5.1
140
- //
141
- // pub fn deflatePending(strm: z_streamp,
142
- // pending: *mut c_uint,
143
- // bits: *mut c_int) -> c_int;
144
- //
145
- // Addedin 1.2.7.1
146
- // pub fn inflateGetDictionary(strm: z_streamp,
147
- // dictionary: *mut Bytef,
148
- // dictLength: *mut uInt) -> c_int;
149
- //
150
- // Added in 1.2.3.5
151
- // pub fn gzbuffer(file: gzFile, size: c_uint) -> c_int;
152
- // pub fn gzclose_r(file: gzFile) -> c_int;
153
- // pub fn gzclose_w(file: gzFile) -> c_int;
154
- // pub fn gzoffset(file: gzFile) -> z_off_t;
150
+ // The above set of functions currently target 1.2.3.4 (what's present on Ubuntu
151
+ // 12.04, but there's some other APIs that were added later. Should figure out
152
+ // how to expose them...
153
+ //
154
+ // Added in 1.2.5.1
155
+ //
156
+ // pub fn deflatePending(strm: z_streamp,
157
+ // pending: *mut c_uint,
158
+ // bits: *mut c_int) -> c_int;
159
+ //
160
+ // Addedin 1.2.7.1
161
+ // pub fn inflateGetDictionary(strm: z_streamp,
162
+ // dictionary: *mut Bytef,
163
+ // dictLength: *mut uInt) -> c_int;
164
+ //
165
+ // Added in 1.2.3.5
166
+ // pub fn gzbuffer(file: gzFile, size: c_uint) -> c_int;
167
+ // pub fn gzclose_r(file: gzFile) -> c_int;
168
+ // pub fn gzclose_w(file: gzFile) -> c_int;
169
+ // pub fn gzoffset(file: gzFile) -> z_off_t;
155
170
}
156
171
157
172
#[ cfg( feature = "libc" ) ]
158
173
extern "C" {
159
174
pub fn adler32_combine ( adler1 : uLong , adler2 : uLong , len2 : z_off_t ) -> uLong ;
160
- pub fn compress ( dest : * mut Bytef , destLen : * mut uLongf ,
161
- source : * const Bytef , sourceLen : uLong ) -> c_int ;
162
- pub fn compress2 ( dest : * mut Bytef , destLen : * mut uLongf ,
163
- source : * const Bytef , sourceLen : uLong ,
164
- level : c_int ) -> c_int ;
175
+ pub fn compress (
176
+ dest : * mut Bytef ,
177
+ destLen : * mut uLongf ,
178
+ source : * const Bytef ,
179
+ sourceLen : uLong ,
180
+ ) -> c_int ;
181
+ pub fn compress2 (
182
+ dest : * mut Bytef ,
183
+ destLen : * mut uLongf ,
184
+ source : * const Bytef ,
185
+ sourceLen : uLong ,
186
+ level : c_int ,
187
+ ) -> c_int ;
165
188
pub fn compressBound ( sourceLen : uLong ) -> uLong ;
166
189
pub fn crc32_combine ( crc1 : uLong , crc2 : uLong , len2 : z_off_t ) -> uLong ;
167
190
pub fn gzdirect ( file : gzFile ) -> c_int ;
@@ -183,10 +206,12 @@ extern "C" {
183
206
pub fn gztell ( file : gzFile ) -> z_off_t ;
184
207
pub fn gzungetc ( c : c_int , file : gzFile ) -> c_int ;
185
208
pub fn gzwrite ( file : gzFile , buf : voidpc , len : c_uint ) -> c_int ;
186
- pub fn uncompress ( dest : * mut Bytef ,
187
- destLen : * mut uLongf ,
188
- source : * const Bytef ,
189
- sourceLen : uLong ) -> c_int ;
209
+ pub fn uncompress (
210
+ dest : * mut Bytef ,
211
+ destLen : * mut uLongf ,
212
+ source : * const Bytef ,
213
+ sourceLen : uLong ,
214
+ ) -> c_int ;
190
215
}
191
216
192
217
pub const Z_NO_FLUSH : c_int = 0 ;
0 commit comments