(strm, windowBits, version, stream_size)
| 193 | } |
| 194 | |
| 195 | int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) |
| 196 | z_streamp strm; |
| 197 | int windowBits; |
| 198 | const char *version; |
| 199 | int stream_size; |
| 200 | { |
| 201 | int ret; |
| 202 | struct inflate_state FAR *state; |
| 203 | |
| 204 | if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || |
| 205 | stream_size != (int)(sizeof(z_stream))) |
| 206 | return Z_VERSION_ERROR; |
| 207 | if (strm == Z_NULL) return Z_STREAM_ERROR; |
| 208 | strm->msg = Z_NULL; /* in case we return an error */ |
| 209 | if (strm->zalloc == (alloc_func)0) { |
| 210 | #if defined(Z_SOLO) && !defined(_KERNEL) |
| 211 | return Z_STREAM_ERROR; |
| 212 | #else |
| 213 | strm->zalloc = zcalloc; |
| 214 | strm->opaque = (voidpf)0; |
| 215 | #endif |
| 216 | } |
| 217 | if (strm->zfree == (free_func)0) |
| 218 | #if defined(Z_SOLO) && !defined(_KERNEL) |
| 219 | return Z_STREAM_ERROR; |
| 220 | #else |
| 221 | strm->zfree = zcfree; |
| 222 | #endif |
| 223 | state = (struct inflate_state FAR *) |
| 224 | ZALLOC(strm, 1, sizeof(struct inflate_state)); |
| 225 | if (state == Z_NULL) return Z_MEM_ERROR; |
| 226 | Tracev((stderr, "inflate: allocated\n")); |
| 227 | strm->state = (struct internal_state FAR *)state; |
| 228 | state->strm = strm; |
| 229 | state->window = Z_NULL; |
| 230 | state->mode = HEAD; /* to pass state test in inflateReset2() */ |
| 231 | ret = inflateReset2(strm, windowBits); |
| 232 | if (ret != Z_OK) { |
| 233 | ZFREE(strm, state); |
| 234 | strm->state = Z_NULL; |
| 235 | } |
| 236 | return ret; |
| 237 | } |
| 238 | |
| 239 | int ZEXPORT inflateInit_(strm, version, stream_size) |
| 240 | z_streamp strm; |
no test coverage detected