This function decompresses the input file using the Inflate algorithm and writes the decompressed data to the output file.
165 strm.zalloc = Z_NULL;
167 strm.opaque = Z_NULL;
169 char* _bufferIn = (
char*)malloc(_DEFAULT_BLOCK_SIZE);
170 char* _bufferOut = (
char*)malloc(_DEFAULT_BLOCK_SIZE);
172 int ret = inflateInit(&strm);
176 uint32_t _crc32 = crc32(0L, Z_NULL, 0);
179 size_t total_read = 0ull;
183 size_t bytes_to_read = _read_size - total_read < _DEFAULT_BLOCK_SIZE ? _read_size - total_read : _DEFAULT_BLOCK_SIZE;
184 strm.avail_in = _freadb(_bufferIn, 1, bytes_to_read, _infile);
185 total_read += strm.avail_in;
188 strm.next_in = _bufferIn;
192 strm.avail_out = _DEFAULT_BLOCK_SIZE;
193 strm.next_out = _bufferOut;
194 ret = inflate(&strm, Z_NO_FLUSH);
195 assert(ret != Z_STREAM_ERROR);
204 have = _DEFAULT_BLOCK_SIZE - strm.avail_out;
206 _crc32 = crc32(_crc32, _bufferOut, have);
208 if (_fwriteb(_bufferOut, 1, have, _outfile) != have || ferror(_outfile))
214 }
while (strm.avail_out == 0);
216 }
while (ret != Z_STREAM_END);
221 (void)inflateEnd(&strm);
@ GPAK_ERROR_INFLATE_FAILED
@ GPAK_ERROR_INFLATE_INIT
@ GPAK_STAGE_DECOMPRESSION