(strm, windowBits)
| 158 | } |
| 159 | |
| 160 | int ZEXPORT inflateReset2(strm, windowBits) |
| 161 | z_streamp strm; |
| 162 | |
| 163 | int 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 | |
| 202 | int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) |
| 203 | z_streamp strm; |
no test coverage detected