33 gzip->
strm.avail_out = size;
34 gzip->
strm.next_out =
static_cast<Bytef *
>(buffer);
36 while (gzip->
strm.avail_out > 0) {
37 if (gzip->
strm.avail_in == 0) {
43 gzip->
strm.avail_in = readsize;
52 int ret = inflate(&gzip->
strm, Z_NO_FLUSH);
54 if (!
ELEM(
ret, Z_OK, Z_BUF_ERROR)) {
68 if (inflateEnd(&gzip->
strm) != Z_OK) {
69 printf(
"close gzip stream error\n");
82 if (inflateInit2(&gzip->
strm, 16 + MAX_WBITS) != Z_OK) {
Wrapper for reading from various sources (e.g. raw files, compressed files, memory....
Read Blender memory allocation and freeing.
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
FileReader * BLI_filereader_new_gzip(FileReader *base) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static void gzip_close(FileReader *reader)
static int64_t gzip_read(FileReader *reader, void *buffer, size_t size)