• Home
  • Raw
  • Download

Lines Matching refs:zst

67     z_stream zst;  member
74 zlib_error(z_stream zst, int err, char *msg) in zlib_error() argument
82 zmsg = zst.msg; in zlib_error()
134 arrange_input_buffer(z_stream *zst, Py_ssize_t *remains) in arrange_input_buffer() argument
137 zst->avail_in = UINT_MAX; in arrange_input_buffer()
139 zst->avail_in = *remains; in arrange_input_buffer()
141 *remains -= zst->avail_in; in arrange_input_buffer()
145 arrange_output_buffer_with_maximum(z_stream *zst, PyObject **buffer, in arrange_output_buffer_with_maximum() argument
157 occupied = zst->next_out - (Byte *)PyBytes_AS_STRING(*buffer); in arrange_output_buffer_with_maximum()
176 zst->avail_out = UINT_MAX; in arrange_output_buffer_with_maximum()
178 zst->avail_out = length - occupied; in arrange_output_buffer_with_maximum()
180 zst->next_out = (Byte *)PyBytes_AS_STRING(*buffer) + occupied; in arrange_output_buffer_with_maximum()
186 arrange_output_buffer(z_stream *zst, PyObject **buffer, Py_ssize_t length) in arrange_output_buffer() argument
190 ret = arrange_output_buffer_with_maximum(zst, buffer, length, in arrange_output_buffer()
211 z_stream zst; in PyZlib_compress() local
217 zst.zalloc = (alloc_func)NULL; in PyZlib_compress()
218 zst.zfree = (free_func)Z_NULL; in PyZlib_compress()
219 zst.next_in = ibuf; in PyZlib_compress()
220 err = deflateInit(&zst, level); in PyZlib_compress()
233 deflateEnd(&zst); in PyZlib_compress()
234 zlib_error(zst, err, "while compressing data"); in PyZlib_compress()
239 arrange_input_buffer(&zst, &ibuflen); in PyZlib_compress()
243 obuflen = arrange_output_buffer(&zst, &RetVal, obuflen); in PyZlib_compress()
245 deflateEnd(&zst); in PyZlib_compress()
250 err = deflate(&zst, flush); in PyZlib_compress()
254 deflateEnd(&zst); in PyZlib_compress()
255 zlib_error(zst, err, "while compressing data"); in PyZlib_compress()
259 } while (zst.avail_out == 0); in PyZlib_compress()
260 assert(zst.avail_in == 0); in PyZlib_compress()
265 err = deflateEnd(&zst); in PyZlib_compress()
267 if (_PyBytes_Resize(&RetVal, zst.next_out - in PyZlib_compress()
273 zlib_error(zst, err, "while finishing compression"); in PyZlib_compress()
294 z_stream zst; in PyZlib_decompress() local
304 zst.zalloc = (alloc_func)NULL; in PyZlib_decompress()
305 zst.zfree = (free_func)Z_NULL; in PyZlib_decompress()
306 zst.avail_in = 0; in PyZlib_decompress()
307 zst.next_in = ibuf; in PyZlib_decompress()
308 err = inflateInit2(&zst, wsize); in PyZlib_decompress()
318 inflateEnd(&zst); in PyZlib_decompress()
319 zlib_error(zst, err, "while preparing to decompress data"); in PyZlib_decompress()
324 arrange_input_buffer(&zst, &ibuflen); in PyZlib_decompress()
328 r_strlen = arrange_output_buffer(&zst, &RetVal, r_strlen); in PyZlib_decompress()
330 inflateEnd(&zst); in PyZlib_decompress()
335 err = inflate(&zst, flush); in PyZlib_decompress()
344 inflateEnd(&zst); in PyZlib_decompress()
349 inflateEnd(&zst); in PyZlib_decompress()
350 zlib_error(zst, err, "while decompressing data"); in PyZlib_decompress()
354 } while (zst.avail_out == 0); in PyZlib_decompress()
360 inflateEnd(&zst); in PyZlib_decompress()
361 zlib_error(zst, err, "while decompressing data"); in PyZlib_decompress()
365 err = inflateEnd(&zst); in PyZlib_decompress()
367 zlib_error(zst, err, "while finishing data decompression"); in PyZlib_decompress()
371 _PyString_Resize(&RetVal, zst.next_out - in PyZlib_decompress()
394 self->zst.zalloc = (alloc_func)NULL; in PyZlib_compressobj()
395 self->zst.zfree = (free_func)Z_NULL; in PyZlib_compressobj()
396 self->zst.next_in = NULL; in PyZlib_compressobj()
397 self->zst.avail_in = 0; in PyZlib_compressobj()
398 err = deflateInit2(&self->zst, level, method, wbits, memLevel, strategy); in PyZlib_compressobj()
413 zlib_error(self->zst, err, "while creating compression object"); in PyZlib_compressobj()
430 self->zst.zalloc = (alloc_func)NULL; in PyZlib_decompressobj()
431 self->zst.zfree = (free_func)Z_NULL; in PyZlib_decompressobj()
432 self->zst.next_in = NULL; in PyZlib_decompressobj()
433 self->zst.avail_in = 0; in PyZlib_decompressobj()
434 err = inflateInit2(&self->zst, wbits); in PyZlib_decompressobj()
449 zlib_error(self->zst, err, "while creating decompression object"); in PyZlib_decompressobj()
459 deflateEnd(&self->zst); in Comp_dealloc()
469 inflateEnd(&self->zst); in Decomp_dealloc()
490 if (!PyArg_ParseTuple(args, "s#:compress", &self->zst.next_in, &ibuflen)) in PyZlib_objcompress()
496 arrange_input_buffer(&self->zst, &ibuflen); in PyZlib_objcompress()
499 obuflen = arrange_output_buffer(&self->zst, &RetVal, obuflen); in PyZlib_objcompress()
504 err = deflate(&self->zst, Z_NO_FLUSH); in PyZlib_objcompress()
508 zlib_error(self->zst, err, "while compressing data"); in PyZlib_objcompress()
512 } while (self->zst.avail_out == 0); in PyZlib_objcompress()
513 assert(self->zst.avail_in == 0); in PyZlib_objcompress()
517 _PyString_Resize(&RetVal, self->zst.next_out - in PyZlib_objcompress()
537 if (self->zst.avail_in > 0) { in save_unconsumed_input()
541 left_size = input + inplen - self->zst.next_in; in save_unconsumed_input()
553 self->zst.next_in, left_size); in save_unconsumed_input()
555 self->zst.avail_in = 0; in save_unconsumed_input()
559 if (self->zst.avail_in > 0 || PyString_GET_SIZE(self->unconsumed_tail)) { in save_unconsumed_input()
563 Py_ssize_t left_size = input + inplen - self->zst.next_in; in save_unconsumed_input()
565 (char *)self->zst.next_in, left_size); in save_unconsumed_input()
606 self->zst.next_in = input; in PyZlib_objdecompress()
616 arrange_input_buffer(&self->zst, &ibuflen); in PyZlib_objdecompress()
619 obuflen = arrange_output_buffer_with_maximum(&self->zst, &RetVal, in PyZlib_objdecompress()
632 err = inflate(&self->zst, Z_SYNC_FLUSH); in PyZlib_objdecompress()
644 } while (self->zst.avail_out == 0); in PyZlib_objdecompress()
660 zlib_error(self->zst, err, "while decompressing"); in PyZlib_objdecompress()
664 _PyString_Resize(&RetVal, self->zst.next_out - in PyZlib_objdecompress()
703 self->zst.avail_in = 0; in PyZlib_flush()
706 length = arrange_output_buffer(&self->zst, &RetVal, length); in PyZlib_flush()
713 err = deflate(&self->zst, flushmode); in PyZlib_flush()
717 zlib_error(self->zst, err, "while flushing"); in PyZlib_flush()
721 } while (self->zst.avail_out == 0); in PyZlib_flush()
722 assert(self->zst.avail_in == 0); in PyZlib_flush()
728 err = deflateEnd(&self->zst); in PyZlib_flush()
730 zlib_error(self->zst, err, "from deflateEnd()"); in PyZlib_flush()
742 zlib_error(self->zst, err, "while flushing"); in PyZlib_flush()
747 _PyString_Resize(&RetVal, self->zst.next_out - in PyZlib_flush()
772 err = deflateCopy(&retval->zst, &self->zst); in PyZlib_copy()
784 zlib_error(self->zst, err, "while copying compression object"); in PyZlib_copy()
821 err = inflateCopy(&retval->zst, &self->zst); in PyZlib_uncopy()
833 zlib_error(self->zst, err, "while copying decompression object"); in PyZlib_uncopy()
879 self->zst.next_in = (Byte *)PyString_AS_STRING(self->unconsumed_tail); in PyZlib_unflush()
883 arrange_input_buffer(&self->zst, &ibuflen); in PyZlib_unflush()
887 length = arrange_output_buffer(&self->zst, &RetVal, length); in PyZlib_unflush()
892 err = inflate(&self->zst, flush); in PyZlib_unflush()
904 } while (self->zst.avail_out == 0); in PyZlib_unflush()
918 err = inflateEnd(&self->zst); in PyZlib_unflush()
921 zlib_error(self->zst, err, "from inflateEnd()"); in PyZlib_unflush()
926 _PyString_Resize(&RetVal, self->zst.next_out - in PyZlib_unflush()