Lines Matching refs:lzs
42 lzma_stream lzs; member
50 lzma_stream lzs; member
503 c->lzs.next_in = data; in compress()
504 c->lzs.avail_in = len; in compress()
505 c->lzs.next_out = (uint8_t *)PyBytes_AS_STRING(result); in compress()
506 c->lzs.avail_out = PyBytes_GET_SIZE(result); in compress()
511 lzret = lzma_code(&c->lzs, action); in compress()
512 data_size = (char *)c->lzs.next_out - PyBytes_AS_STRING(result); in compress()
513 if (lzret == LZMA_BUF_ERROR && len == 0 && c->lzs.avail_out > 0) in compress()
518 if ((action == LZMA_RUN && c->lzs.avail_in == 0) || in compress()
521 } else if (c->lzs.avail_out == 0) { in compress()
524 c->lzs.next_out = (uint8_t *)PyBytes_AS_STRING(result) + data_size; in compress()
525 c->lzs.avail_out = PyBytes_GET_SIZE(result) - data_size; in compress()
603 Compressor_init_xz(lzma_stream *lzs, int check, uint32_t preset, in Compressor_init_xz() argument
609 lzret = lzma_easy_encoder(lzs, preset, check); in Compressor_init_xz()
615 lzret = lzma_stream_encoder(lzs, filters, check); in Compressor_init_xz()
625 Compressor_init_alone(lzma_stream *lzs, uint32_t preset, PyObject *filterspecs) in Compressor_init_alone() argument
636 lzret = lzma_alone_encoder(lzs, &options); in Compressor_init_alone()
644 lzret = lzma_alone_encoder(lzs, filters[0].options); in Compressor_init_alone()
660 Compressor_init_raw(lzma_stream *lzs, PyObject *filterspecs) in Compressor_init_raw() argument
672 lzret = lzma_raw_encoder(lzs, filters); in Compressor_init_raw()
747 self->lzs.allocator = &self->alloc; in Compressor_init()
760 if (Compressor_init_xz(&self->lzs, check, preset, filterspecs) != 0) in Compressor_init()
765 if (Compressor_init_alone(&self->lzs, preset, filterspecs) != 0) in Compressor_init()
770 if (Compressor_init_raw(&self->lzs, filterspecs) != 0) in Compressor_init()
788 lzma_end(&self->lzs); in Compressor_dealloc()
882 lzma_stream *lzs = &d->lzs; in decompress_buf() local
884 if (lzs->avail_in == 0) in decompress_buf()
894 lzs->next_out = (uint8_t *)PyBytes_AS_STRING(result); in decompress_buf()
895 lzs->avail_out = PyBytes_GET_SIZE(result); in decompress_buf()
901 lzret = lzma_code(lzs, LZMA_RUN); in decompress_buf()
902 data_size = (char *)lzs->next_out - PyBytes_AS_STRING(result); in decompress_buf()
907 d->check = lzma_get_check(&d->lzs); in decompress_buf()
911 } else if (lzs->avail_in == 0) { in decompress_buf()
913 } else if (lzs->avail_out == 0) { in decompress_buf()
918 lzs->next_out = (uint8_t *)PyBytes_AS_STRING(result) + data_size; in decompress_buf()
919 lzs->avail_out = PyBytes_GET_SIZE(result) - data_size; in decompress_buf()
938 lzma_stream *lzs = &d->lzs; in decompress() local
941 if (lzs->next_in != NULL) { in decompress()
946 - (lzs->next_in + lzs->avail_in); in decompress()
951 avail_total = d->input_buffer_size - lzs->avail_in; in decompress()
954 size_t offset = lzs->next_in - d->input_buffer; in decompress()
968 lzs->next_in = d->input_buffer + offset; in decompress()
971 memmove(d->input_buffer, lzs->next_in, in decompress()
972 lzs->avail_in); in decompress()
973 lzs->next_in = d->input_buffer; in decompress()
975 memcpy((void*)(lzs->next_in + lzs->avail_in), data, len); in decompress()
976 lzs->avail_in += len; in decompress()
980 lzs->next_in = data; in decompress()
981 lzs->avail_in = len; in decompress()
987 lzs->next_in = NULL; in decompress()
993 if (lzs->avail_in > 0) { in decompress()
995 PyBytes_FromStringAndSize((char *)lzs->next_in, lzs->avail_in)); in decompress()
1000 else if (lzs->avail_in == 0) { in decompress()
1001 lzs->next_in = NULL; in decompress()
1015 d->input_buffer_size < lzs->avail_in) { in decompress()
1022 d->input_buffer = PyMem_Malloc(lzs->avail_in); in decompress()
1027 d->input_buffer_size = lzs->avail_in; in decompress()
1031 memcpy(d->input_buffer, lzs->next_in, lzs->avail_in); in decompress()
1032 lzs->next_in = d->input_buffer; in decompress()
1090 Decompressor_init_raw(lzma_stream *lzs, PyObject *filterspecs) in Decompressor_init_raw() argument
1097 lzret = lzma_raw_decoder(lzs, filters); in Decompressor_init_raw()
1163 self->lzs.allocator = &self->alloc; in _lzma_LZMADecompressor___init___impl()
1164 self->lzs.next_in = NULL; in _lzma_LZMADecompressor___init___impl()
1186 lzret = lzma_auto_decoder(&self->lzs, memlimit_, decoder_flags); in _lzma_LZMADecompressor___init___impl()
1192 lzret = lzma_stream_decoder(&self->lzs, memlimit_, decoder_flags); in _lzma_LZMADecompressor___init___impl()
1199 lzret = lzma_alone_decoder(&self->lzs, memlimit_); in _lzma_LZMADecompressor___init___impl()
1206 if (Decompressor_init_raw(&self->lzs, filters) == -1) in _lzma_LZMADecompressor___init___impl()
1229 lzma_end(&self->lzs); in Decompressor_dealloc()