Lines Matching refs:data
1 /* zlibmodule.c -- gzip-compatible data compression */
118 /* ensure no gaps in the data.
236 zmsg = "invalid input data";
308 data: Py_buffer
309 Binary data to be compressed.
316 Returns a bytes object containing compressed data.
320 zlib_compress_impl(PyObject *module, Py_buffer *data, int level, int wbits)
330 Byte *ibuf = data->buf;
331 Py_ssize_t ibuflen = data->len;
349 "Out of memory while compressing data");
356 zlib_error(state, zst, err, "while compressing data");
378 zlib_error(state, zst, err, "while compressing data");
406 data: Py_buffer
407 Compressed data.
414 Returns a bytes object containing the uncompressed data.
418 zlib_decompress_impl(PyObject *module, Py_buffer *data, int wbits,
444 ibuf = data->buf;
445 ibuflen = data->len;
459 "Out of memory while decompressing data");
463 zlib_error(state, zst, err, "while preparing to decompress data");
492 "Out of memory while decompressing data");
496 zlib_error(state, zst, err, "while decompressing data");
507 zlib_error(state, zst, err, "while decompressing data");
550 containing subsequences that are likely to occur in the input data.
644 dictionary as used by the compressor that produced the input data.
740 data: Py_buffer
741 Binary data to be compressed.
744 Returns a bytes object containing compressed data.
746 After calling this function, some of the input data may still
753 Py_buffer *data)
763 self->zst.next_in = data->buf;
764 Py_ssize_t ibuflen = data->len;
785 zlib_error(state, self->zst, err, "while compressing data");
807 /* Helper for objdecompress() and flush(). Saves any unconsumed input data in
810 save_unconsumed_input(compobject *self, Py_buffer *data, int err)
813 /* The end of the compressed data has been reached. Store the leftover
814 input data in self->unused_data. */
819 left_size = (Byte *)data->buf + data->len - self->zst.next_in;
840 2. All input data was consumed. Clear unconsumed_tail. */
841 Py_ssize_t left_size = (Byte *)data->buf + data->len - self->zst.next_in;
856 data: Py_buffer
857 The binary data to decompress.
860 The maximum allowable length of the decompressed data.
861 Unconsumed input data will be stored in
864 Return a bytes object containing the decompressed version of the data.
866 After calling this function, some of the input data may still be stored in
873 Py_buffer *data, Py_ssize_t max_length)
895 self->zst.next_in = data->buf;
896 ibuflen = data->len;
940 if (save_unconsumed_input(self, data, err) < 0)
952 zlib_error(state, self->zst, err, "while decompressing data");
976 used after calling the flush() method. Otherwise, more data
980 Return a bytes object containing any remaining compressed data.
1025 various data structures. Note we should only get Z_STREAM_END when
1245 Return a bytes object containing any remaining decompressed data.
1254 Py_buffer data;
1274 if (PyObject_GetBuffer(self->unconsumed_tail, &data, PyBUF_SIMPLE) == -1) {
1279 self->zst.next_in = data.buf;
1280 ibuflen = data.len;
1324 if (save_unconsumed_input(self, &data, err) < 0) {
1348 PyBuffer_Release(&data);
1386 data: Py_buffer
1391 Compute an Adler-32 checksum of data.
1397 zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value)
1402 if (data->len > 1024*5) {
1403 unsigned char *buf = data->buf;
1404 Py_ssize_t len = data->len;
1417 value = adler32(value, data->buf, (unsigned int)data->len);
1425 data: Py_buffer
1430 Compute a CRC-32 checksum of data.
1436 zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value)
1441 if (data->len > 1024*5) {
1442 unsigned char *buf = data->buf;
1443 Py_ssize_t len = data->len;
1456 value = crc32(value, data->buf, (unsigned int)data->len);
1505 "compress(data[, level]) -- Compress data, with compression level 0-9 or -1.\n"