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

Function inflateInit2_

freebsd/contrib/zlib/inflate.c:195–237  ·  view source on GitHub ↗
(strm, windowBits, version, stream_size)

Source from the content-addressed store, hash-verified

193}
194
195int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
196z_streamp strm;
197int windowBits;
198const char *version;
199int 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
239int ZEXPORT inflateInit_(strm, version, stream_size)
240z_streamp strm;

Callers 2

zstd_zlibwrapper.cFile · 0.85
inflateInit_Function · 0.85

Calls 1

inflateReset2Function · 0.85

Tested by

no test coverage detected