Lines Matching refs:strm

158 local void mem_setup(z_stream *strm)  in mem_setup()  argument
170 strm->opaque = zone; in mem_setup()
171 strm->zalloc = mem_alloc; in mem_setup()
172 strm->zfree = mem_free; in mem_setup()
176 local void mem_limit(z_stream *strm, size_t limit) in mem_limit() argument
178 struct mem_zone *zone = strm->opaque; in mem_limit()
184 local void mem_used(z_stream *strm, char *prefix) in mem_used() argument
186 struct mem_zone *zone = strm->opaque; in mem_used()
192 local void mem_high(z_stream *strm, char *prefix) in mem_high() argument
194 struct mem_zone *zone = strm->opaque; in mem_high()
200 local void mem_done(z_stream *strm, char *prefix) in mem_done() argument
204 struct mem_zone *zone = strm->opaque; in mem_done()
207 mem_high(strm, prefix); in mem_done()
231 strm->opaque = Z_NULL; in mem_done()
232 strm->zalloc = Z_NULL; in mem_done()
233 strm->zfree = Z_NULL; in mem_done()
290 z_stream strm, copy; in inf() local
293 mem_setup(&strm); in inf()
294 strm.avail_in = 0; in inf()
295 strm.next_in = Z_NULL; in inf()
296 ret = inflateInit2(&strm, win); in inf()
298 mem_done(&strm, what); in inf()
309 ret = inflateGetHeader(&strm, &head); assert(ret == Z_OK); in inf()
314 strm.avail_in = step; in inf()
316 strm.next_in = in; in inf()
318 strm.avail_out = len; in inf()
319 strm.next_out = out; in inf()
320 ret = inflate(&strm, Z_NO_FLUSH); assert(err == 9 || ret == err); in inf()
324 ret = inflateSetDictionary(&strm, in, 1); in inf()
326 mem_limit(&strm, 1); in inf()
327 ret = inflateSetDictionary(&strm, out, 0); in inf()
329 mem_limit(&strm, 0); in inf()
330 ((struct inflate_state *)strm.state)->mode = DICT; in inf()
331 ret = inflateSetDictionary(&strm, out, 0); in inf()
333 ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_BUF_ERROR); in inf()
335 ret = inflateCopy(&copy, &strm); assert(ret == Z_OK); in inf()
338 have += strm.avail_in; in inf()
339 strm.avail_in = step > have ? have : step; in inf()
340 have -= strm.avail_in; in inf()
341 } while (strm.avail_in); in inf()
344 ret = inflateReset2(&strm, -8); assert(ret == Z_OK); in inf()
345 ret = inflateEnd(&strm); assert(ret == Z_OK); in inf()
346 mem_done(&strm, what); in inf()
353 z_stream strm; in cover_support() local
355 mem_setup(&strm); in cover_support()
356 strm.avail_in = 0; in cover_support()
357 strm.next_in = Z_NULL; in cover_support()
358 ret = inflateInit(&strm); assert(ret == Z_OK); in cover_support()
359 mem_used(&strm, "inflate init"); in cover_support()
360 ret = inflatePrime(&strm, 5, 31); assert(ret == Z_OK); in cover_support()
361 ret = inflatePrime(&strm, -1, 0); assert(ret == Z_OK); in cover_support()
362 ret = inflateSetDictionary(&strm, Z_NULL, 0); in cover_support()
364 ret = inflateEnd(&strm); assert(ret == Z_OK); in cover_support()
365 mem_done(&strm, "prime"); in cover_support()
373 mem_setup(&strm); in cover_support()
374 strm.avail_in = 0; in cover_support()
375 strm.next_in = Z_NULL; in cover_support()
376 ret = inflateInit_(&strm, ZLIB_VERSION - 1, (int)sizeof(z_stream)); in cover_support()
378 mem_done(&strm, "wrong version"); in cover_support()
380 strm.avail_in = 0; in cover_support()
381 strm.next_in = Z_NULL; in cover_support()
382 ret = inflateInit(&strm); assert(ret == Z_OK); in cover_support()
383 ret = inflateEnd(&strm); assert(ret == Z_OK); in cover_support()
391 z_stream strm, copy; in cover_wrap() local
413 mem_setup(&strm); in cover_wrap()
414 strm.avail_in = 0; in cover_wrap()
415 strm.next_in = Z_NULL; in cover_wrap()
416 ret = inflateInit2(&strm, -8); in cover_wrap()
417 strm.avail_in = 2; in cover_wrap()
418 strm.next_in = (void *)"\x63"; in cover_wrap()
419 strm.avail_out = 1; in cover_wrap()
420 strm.next_out = (void *)&ret; in cover_wrap()
421 mem_limit(&strm, 1); in cover_wrap()
422 ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_MEM_ERROR); in cover_wrap()
423 ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_MEM_ERROR); in cover_wrap()
424 mem_limit(&strm, 0); in cover_wrap()
426 ret = inflateSetDictionary(&strm, dict, 257); in cover_wrap()
428 mem_limit(&strm, (sizeof(struct inflate_state) << 1) + 256); in cover_wrap()
429 ret = inflatePrime(&strm, 16, 0); assert(ret == Z_OK); in cover_wrap()
430 strm.avail_in = 2; in cover_wrap()
431 strm.next_in = (void *)"\x80"; in cover_wrap()
432 ret = inflateSync(&strm); assert(ret == Z_DATA_ERROR); in cover_wrap()
433 ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_STREAM_ERROR); in cover_wrap()
434 strm.avail_in = 4; in cover_wrap()
435 strm.next_in = (void *)"\0\0\xff\xff"; in cover_wrap()
436 ret = inflateSync(&strm); assert(ret == Z_OK); in cover_wrap()
437 (void)inflateSyncPoint(&strm); in cover_wrap()
438 ret = inflateCopy(&copy, &strm); assert(ret == Z_MEM_ERROR); in cover_wrap()
439 mem_limit(&strm, 0); in cover_wrap()
440 ret = inflateUndermine(&strm, 1); assert(ret == Z_DATA_ERROR); in cover_wrap()
441 (void)inflateMark(&strm); in cover_wrap()
442 ret = inflateEnd(&strm); assert(ret == Z_OK); in cover_wrap()
443 mem_done(&strm, "miscellaneous, force memory errors"); in cover_wrap()
473 z_stream strm; in cover_back() local
484 mem_setup(&strm); in cover_back()
485 ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK); in cover_back()
486 strm.avail_in = 2; in cover_back()
487 strm.next_in = (void *)"\x03"; in cover_back()
488 ret = inflateBack(&strm, pull, Z_NULL, push, Z_NULL); in cover_back()
491 strm.avail_in = 3; in cover_back()
492 strm.next_in = (void *)"\x63\x00"; in cover_back()
493 ret = inflateBack(&strm, pull, Z_NULL, push, &strm); in cover_back()
496 ret = inflateBack(&strm, pull, &strm, push, Z_NULL); in cover_back()
498 ret = inflateBackEnd(&strm); assert(ret == Z_OK); in cover_back()
499 mem_done(&strm, "inflateBack bad state"); in cover_back()
501 ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK); in cover_back()
502 ret = inflateBackEnd(&strm); assert(ret == Z_OK); in cover_back()
513 z_stream strm; in try() local
531 mem_setup(&strm); in try()
532 strm.avail_in = 0; in try()
533 strm.next_in = Z_NULL; in try()
534 ret = inflateInit2(&strm, err < 0 ? 47 : -15); in try()
536 strm.avail_in = len; in try()
537 strm.next_in = in; in try()
539 strm.avail_out = size; in try()
540 strm.next_out = out; in try()
541 ret = inflate(&strm, Z_TREES); in try()
545 } while (strm.avail_in || strm.avail_out == 0); in try()
548 assert(strcmp(id, strm.msg) == 0); in try()
550 inflateEnd(&strm); in try()
551 mem_done(&strm, prefix); in try()
557 mem_setup(&strm); in try()
558 ret = inflateBackInit(&strm, 15, win); in try()
560 strm.avail_in = len; in try()
561 strm.next_in = in; in try()
562 ret = inflateBack(&strm, pull, Z_NULL, push, Z_NULL); in try()
566 assert(strcmp(id, strm.msg) == 0); in try()
568 inflateBackEnd(&strm); in try()
569 mem_done(&strm, prefix); in try()