MCPcopy Create free account
hub / github.com/MariaDB/server / gzflush

Function gzflush

zlib/gzwrite.c:603–627  ·  view source on GitHub ↗

-- see zlib.h -- */

Source from the content-addressed store, hash-verified

601
602/* -- see zlib.h -- */
603int ZEXPORT gzflush(gzFile file, int flush) {
604 gz_statep state;
605
606 /* get internal structure */
607 if (file == NULL)
608 return Z_STREAM_ERROR;
609 state = (gz_statep)file;
610
611 /* check that we're writing and that there's no (serious) error */
612 if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
613 return Z_STREAM_ERROR;
614 gz_error(state, Z_OK, NULL);
615
616 /* check flush parameter */
617 if (flush < 0 || flush > Z_FINISH)
618 return Z_STREAM_ERROR;
619
620 /* check for seek request */
621 if (state->skip && gz_zero(state) == -1)
622 return state->err;
623
624 /* compress remaining data with requested flush */
625 (void)gz_comp(state, flush);
626 return state->err;
627}
628
629/* -- see zlib.h -- */
630int ZEXPORT gzsetparams(gzFile file, int level, int strategy) {

Callers 1

WriteBufferMethod · 0.85

Calls 3

gz_errorFunction · 0.85
gz_zeroFunction · 0.85
gz_compFunction · 0.85

Tested by

no test coverage detected