MCPcopy Create free account
hub / github.com/F-Stack/f-stack / inflateReset2

Function inflateReset2

freebsd/contrib/zlib/inflate.c:157–193  ·  view source on GitHub ↗
(strm, windowBits)

Source from the content-addressed store, hash-verified

155}
156
157int ZEXPORT inflateReset2(strm, windowBits)
158z_streamp strm;
159int windowBits;
160{
161 int wrap;
162 struct inflate_state FAR *state;
163
164 /* get the state */
165 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
166 state = (struct inflate_state FAR *)strm->state;
167
168 /* extract wrap request from windowBits parameter */
169 if (windowBits < 0) {
170 wrap = 0;
171 windowBits = -windowBits;
172 }
173 else {
174 wrap = (windowBits >> 4) + 5;
175#ifdef GUNZIP
176 if (windowBits < 48)
177 windowBits &= 15;
178#endif
179 }
180
181 /* set number of window bits, free window if different */
182 if (windowBits && (windowBits < 8 || windowBits > 15))
183 return Z_STREAM_ERROR;
184 if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
185 ZFREE(strm, state->window);
186 state->window = Z_NULL;
187 }
188
189 /* update state and reset the rest of it */
190 state->wrap = wrap;
191 state->wbits = (unsigned)windowBits;
192 return inflateReset(strm);
193}
194
195int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
196z_streamp strm;

Callers 3

zstd_zlibwrapper.cFile · 0.85
inflateInit2_Function · 0.85
infFunction · 0.85

Calls 2

inflateStateCheckFunction · 0.85
inflateResetFunction · 0.85

Tested by 1

infFunction · 0.68