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

Function gzflush

freebsd/contrib/zlib/gzwrite.c:556–585  ·  view source on GitHub ↗

-- see zlib.h -- */

(file, flush)

Source from the content-addressed store, hash-verified

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