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

Function inflateInit2_

extlibs/minizip/src/inflate.c:202–247  ·  view source on GitHub ↗
(strm, windowBits, version, stream_size)

Source from the content-addressed store, hash-verified

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

Callers 1

inflateInit_Function · 0.85

Calls 1

inflateReset2Function · 0.85

Tested by

no test coverage detected