MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / gzclose

Function gzclose

zlib/gzio.c:958–977  ·  view source on GitHub ↗

=========================================================================== Flushes all pending output if necessary, closes the compressed file and deallocates all the (de)compression state. */

(file)

Source from the content-addressed store, hash-verified

956 and deallocates all the (de)compression state.
957*/
958int ZEXPORT gzclose (file)
959 gzFile file;
960{
961 gz_stream *s = (gz_stream*)file;
962
963 if (s == NULL) return Z_STREAM_ERROR;
964
965 if (s->mode == 'w') {
966#ifdef NO_GZCOMPRESS
967 return Z_STREAM_ERROR;
968#else
969 if (do_flush (file, Z_FINISH) != Z_OK)
970 return destroy((gz_stream*)file);
971
972 putLong (s->file, s->crc);
973 putLong (s->file, (uLong)(s->in & 0xffffffff));
974#endif
975 }
976 return destroy((gz_stream*)file);
977}
978
979#ifdef STDC
980# define zstrerror(errnum) strerror(errnum)

Callers

nothing calls this directly

Calls 3

do_flushFunction · 0.85
putLongFunction · 0.85
destroyFunction · 0.70

Tested by

no test coverage detected