MCPcopy Create free account
hub / github.com/F-Stack/f-stack / gzclose

Function gzclose

freebsd/contrib/zlib/test/minigzip.c:297–322  ·  view source on GitHub ↗
(gz)

Source from the content-addressed store, hash-verified

295int gzclose OF((gzFile));
296
297int gzclose(gz)
298 gzFile gz;
299{
300 z_stream *strm;
301 unsigned char out[BUFLEN];
302
303 if (gz == NULL)
304 return Z_STREAM_ERROR;
305 strm = &(gz->strm);
306 if (gz->write) {
307 strm->next_in = Z_NULL;
308 strm->avail_in = 0;
309 do {
310 strm->next_out = out;
311 strm->avail_out = BUFLEN;
312 (void)deflate(strm, Z_FINISH);
313 fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
314 } while (strm->avail_out == 0);
315 deflateEnd(strm);
316 }
317 else
318 inflateEnd(strm);
319 fclose(gz->file);
320 free(gz);
321 return Z_OK;
322}
323
324const char *gzerror OF((gzFile, int *));
325

Callers 4

gz_compressFunction · 0.70
gz_compress_mmapFunction · 0.70
gz_uncompressFunction · 0.70
test_gzioFunction · 0.70

Calls 3

deflateFunction · 0.85
deflateEndFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected