MCPcopy Create free account
hub / github.com/MariaDB/server / inflateReset2

Function inflateReset2

zlib/inflate.c:136–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
137 int wrap;
138 struct inflate_state FAR *state;
139
140 /* get the state */
141 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
142 state = (struct inflate_state FAR *)strm->state;
143
144 /* extract wrap request from windowBits parameter */
145 if (windowBits < 0) {
146 if (windowBits < -15)
147 return Z_STREAM_ERROR;
148 wrap = 0;
149 windowBits = -windowBits;
150 }
151 else {
152 wrap = (windowBits >> 4) + 5;
153#ifdef GUNZIP
154 if (windowBits < 48)
155 windowBits &= 15;
156#endif
157 }
158
159 /* set number of window bits, free window if different */
160 if (windowBits && (windowBits < 8 || windowBits > 15))
161 return Z_STREAM_ERROR;
162 if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
163 ZFREE(strm, state->window);
164 state->window = Z_NULL;
165 }
166
167 /* update state and reset the rest of it */
168 state->wrap = wrap;
169 state->wbits = (unsigned)windowBits;
170 return inflateReset(strm);
171}
172
173int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
174 const char *version, int stream_size) {

Callers 1

inflateInit2_Function · 0.85

Calls 2

inflateStateCheckFunction · 0.85
inflateResetFunction · 0.85

Tested by

no test coverage detected