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

Function gzclose

freebsd/contrib/zstd/zlibWrapper/examples/minigzip.c:302–327  ·  view source on GitHub ↗
(gz)

Source from the content-addressed store, hash-verified

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

Callers 5

test_gzioFunction · 0.70
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 2

test_gzioFunction · 0.56
test_gzioFunction · 0.56