if (err) return err;
if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;  s->stream.avail_in = 0;   for (;;) { len = Z_BUFSIZE - s->stream.avail_out;  if (len != 0) { if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) { s->z_err = Z_ERRNO; return Z_ERRNO; } s->stream.next_out = s->outbuf; s->stream.avail_out = Z_BUFSIZE; } if (done) break; s->z_err = deflate(&(s->stream), flush);   done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);  if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break; }
int ZEXPORT gzflush (file, flush)     gzFile file;     int flush;{    gz_stream *s = (gz_stream*)file;    int err = do_flush (file, flush);    if (err) return err;    fflush(s->file);    return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;}