Lines Matching refs:zst
208 z_stream zst;
218 zlib_error(zlibstate *state, z_stream zst, int err, const char *msg)
221 /* In case of a version mismatch, zst.msg won't be initialized.
222 Check for this case first, before looking at zst.msg. */
226 zmsg = zst.msg;
299 arrange_input_buffer(z_stream *zst, Py_ssize_t *remains)
301 zst->avail_in = (uInt)Py_MIN((size_t)*remains, UINT_MAX);
302 *remains -= zst->avail_in;
325 z_stream zst;
333 if (OutputBuffer_InitAndGrow(&buffer, -1, &zst.next_out, &zst.avail_out) < 0) {
337 zst.opaque = NULL;
338 zst.zalloc = PyZlib_Malloc;
339 zst.zfree = PyZlib_Free;
340 zst.next_in = ibuf;
341 int err = deflateInit2(&zst, level, DEFLATED, wbits, DEF_MEM_LEVEL,
355 deflateEnd(&zst);
356 zlib_error(state, zst, err, "while compressing data");
361 arrange_input_buffer(&zst, &ibuflen);
365 if (zst.avail_out == 0) {
366 if (OutputBuffer_Grow(&buffer, &zst.next_out, &zst.avail_out) < 0) {
367 deflateEnd(&zst);
373 err = deflate(&zst, flush);
377 deflateEnd(&zst);
378 zlib_error(state, zst, err, "while compressing data");
382 } while (zst.avail_out == 0);
383 assert(zst.avail_in == 0);
388 err = deflateEnd(&zst);
390 RetVal = OutputBuffer_Finish(&buffer, zst.avail_out);
397 zlib_error(state, zst, err, "while finishing compression");
426 z_stream zst;
440 &zst.next_out, &zst.avail_out) < 0) {
447 zst.opaque = NULL;
448 zst.zalloc = PyZlib_Malloc;
449 zst.zfree = PyZlib_Free;
450 zst.avail_in = 0;
451 zst.next_in = ibuf;
452 err = inflateInit2(&zst, wbits);
462 inflateEnd(&zst);
463 zlib_error(state, zst, err, "while preparing to decompress data");
468 arrange_input_buffer(&zst, &ibuflen);
472 if (zst.avail_out == 0) {
474 &zst.next_out, &zst.avail_out) < 0) {
475 inflateEnd(&zst);
481 err = inflate(&zst, flush);
490 inflateEnd(&zst);
495 inflateEnd(&zst);
496 zlib_error(state, zst, err, "while decompressing data");
500 } while (zst.avail_out == 0);
506 inflateEnd(&zst);
507 zlib_error(state, zst, err, "while decompressing data");
511 err = inflateEnd(&zst);
513 zlib_error(state, zst, err, "while finishing decompression");
517 RetVal = OutputBuffer_WindowFinish(&buffer, &window, zst.avail_out);
570 self->zst.opaque = NULL;
571 self->zst.zalloc = PyZlib_Malloc;
572 self->zst.zfree = PyZlib_Free;
573 self->zst.next_in = NULL;
574 self->zst.avail_in = 0;
575 int err = deflateInit2(&self->zst, level, method, wbits, memLevel, strategy);
582 err = deflateSetDictionary(&self->zst,
603 zlib_error(state, self->zst, err, "while creating compression object");
627 err = inflateSetDictionary(&self->zst,
631 zlib_error(state, self->zst, err, "while setting zdict");
664 self->zst.opaque = NULL;
665 self->zst.zalloc = PyZlib_Malloc;
666 self->zst.zfree = PyZlib_Free;
667 self->zst.next_in = NULL;
668 self->zst.avail_in = 0;
673 int err = inflateInit2(&self->zst, wbits);
702 zlib_error(state, self->zst, err, "while creating decompression object");
724 deflateEnd(&self->zst);
732 inflateEnd(&self->zst);
763 self->zst.next_in = data->buf;
766 if (OutputBuffer_InitAndGrow(&buffer, -1, &self->zst.next_out, &self->zst.avail_out) < 0) {
771 arrange_input_buffer(&self->zst, &ibuflen);
774 if (self->zst.avail_out == 0) {
775 if (OutputBuffer_Grow(&buffer, &self->zst.next_out, &self->zst.avail_out) < 0) {
781 err = deflate(&self->zst, Z_NO_FLUSH);
785 zlib_error(state, self->zst, err, "while compressing data");
789 } while (self->zst.avail_out == 0);
790 assert(self->zst.avail_in == 0);
794 RetVal = OutputBuffer_Finish(&buffer, self->zst.avail_out);
815 if (self->zst.avail_in > 0) {
819 left_size = (Byte *)data->buf + data->len - self->zst.next_in;
831 self->zst.next_in, left_size);
833 self->zst.avail_in = 0;
837 if (self->zst.avail_in > 0 || PyBytes_GET_SIZE(self->unconsumed_tail)) {
841 Py_ssize_t left_size = (Byte *)data->buf + data->len - self->zst.next_in;
843 (char *)self->zst.next_in, left_size);
895 self->zst.next_in = data->buf;
898 if (OutputBuffer_InitAndGrow(&buffer, max_length, &self->zst.next_out, &self->zst.avail_out) < 0) {
903 arrange_input_buffer(&self->zst, &ibuflen);
906 if (self->zst.avail_out == 0) {
907 if (OutputBuffer_GetDataSize(&buffer, self->zst.avail_out) == max_length) {
910 if (OutputBuffer_Grow(&buffer, &self->zst.next_out, &self->zst.avail_out) < 0) {
916 err = inflate(&self->zst, Z_SYNC_FLUSH);
935 } while (self->zst.avail_out == 0 || err == Z_NEED_DICT);
952 zlib_error(state, self->zst, err, "while decompressing data");
956 RetVal = OutputBuffer_Finish(&buffer, self->zst.avail_out);
1000 self->zst.avail_in = 0;
1002 if (OutputBuffer_InitAndGrow(&buffer, -1, &self->zst.next_out, &self->zst.avail_out) < 0) {
1007 if (self->zst.avail_out == 0) {
1008 if (OutputBuffer_Grow(&buffer, &self->zst.next_out, &self->zst.avail_out) < 0) {
1014 err = deflate(&self->zst, mode);
1018 zlib_error(state, self->zst, err, "while flushing");
1021 } while (self->zst.avail_out == 0);
1022 assert(self->zst.avail_in == 0);
1028 err = deflateEnd(&self->zst);
1030 zlib_error(state, self->zst, err, "while finishing compression");
1041 zlib_error(state, self->zst, err, "while flushing");
1045 RetVal = OutputBuffer_Finish(&buffer, self->zst.avail_out);
1081 int err = deflateCopy(&retval->zst, &self->zst);
1093 zlib_error(state, self->zst, err, "while copying compression object");
1168 int err = inflateCopy(&retval->zst, &self->zst);
1180 zlib_error(state, self->zst, err, "while copying decompression object");
1279 self->zst.next_in = data.buf;
1283 &self->zst.next_out, &self->zst.avail_out) < 0) {
1288 arrange_input_buffer(&self->zst, &ibuflen);
1292 if (self->zst.avail_out == 0) {
1294 &self->zst.next_out, &self->zst.avail_out) < 0) {
1300 err = inflate(&self->zst, flush);
1319 } while (self->zst.avail_out == 0 || err == Z_NEED_DICT);
1332 err = inflateEnd(&self->zst);
1334 zlib_error(state, self->zst, err, "while finishing decompression");
1339 RetVal = OutputBuffer_WindowFinish(&buffer, &window, self->zst.avail_out);