MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / gzflush

Function gzflush

ZLib/gzwrite.c:465–494  ·  view source on GitHub ↗

-- see zlib.h -- */

(file, flush)

Source from the content-addressed store, hash-verified

463
464/* -- see zlib.h -- */
465int ZEXPORT gzflush(file, flush)
466 gzFile file;
467 int flush;
468{
469 gz_statep state;
470
471 /* get internal structure */
472 if (file == NULL)
473 return -1;
474 state = (gz_statep)file;
475
476 /* check that we're writing and that there's no error */
477 if (state->mode != GZ_WRITE || state->err != Z_OK)
478 return Z_STREAM_ERROR;
479
480 /* check flush parameter */
481 if (flush < 0 || flush > Z_FINISH)
482 return Z_STREAM_ERROR;
483
484 /* check for seek request */
485 if (state->seek) {
486 state->seek = 0;
487 if (gz_zero(state, state->skip) == -1)
488 return -1;
489 }
490
491 /* compress remaining data with requested flush */
492 gz_comp(state, flush);
493 return state->err;
494}
495
496/* -- see zlib.h -- */
497int ZEXPORT gzsetparams(file, level, strategy)

Callers

nothing calls this directly

Calls 2

gz_zeroFunction · 0.85
gz_compFunction · 0.85

Tested by

no test coverage detected