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

Function gzflush

freebsd/contrib/zstd/zlibWrapper/gzwrite.c:559–588  ·  view source on GitHub ↗

-- see zlib.h -- */

(file, flush)

Source from the content-addressed store, hash-verified

557
558/* -- see zlib.h -- */
559int ZEXPORT gzflush(file, flush)
560 gzFile file;
561 int flush;
562{
563 gz_statep state;
564
565 /* get internal structure */
566 if (file == NULL)
567 return Z_STREAM_ERROR;
568 state.file = file;
569
570 /* check that we're writing and that there's no error */
571 if (state.state->mode != GZ_WRITE || state.state->err != Z_OK)
572 return Z_STREAM_ERROR;
573
574 /* check flush parameter */
575 if (flush < 0 || flush > Z_FINISH)
576 return Z_STREAM_ERROR;
577
578 /* check for seek request */
579 if (state.state->seek) {
580 state.state->seek = 0;
581 if (gz_zero(state, state.state->skip) == -1)
582 return state.state->err;
583 }
584
585 /* compress remaining data with requested flush */
586 (void)gz_comp(state, flush);
587 return state.state->err;
588}
589
590/* -- see zlib.h -- */
591int ZEXPORT gzsetparams(file, level, strategy)

Callers

nothing calls this directly

Calls 2

gz_zeroFunction · 0.70
gz_compFunction · 0.70

Tested by

no test coverage detected