MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / inflateReset2

Function inflateReset2

extlibs/minizip/src/inflate.c:160–200  ·  view source on GitHub ↗
(strm, windowBits)

Source from the content-addressed store, hash-verified

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

Callers 1

inflateInit2_Function · 0.85

Calls 2

inflateStateCheckFunction · 0.85
inflateResetFunction · 0.85

Tested by

no test coverage detected