/* This subroutine adds the data at next_in/avail_in to the output history without performing any output. The output buffer must be "caught up"; i.e. no pending output but this should always be the case. The state must be waiting on the start of a block (i.e. mode == TYPE or HEAD). On exit, the output will also be caught up, and the checksum will have been updated if need be.  */
int zlib_inflateIncomp(z_stream *z)
/* This subroutine adds the data at next_in/avail_in to the output history without performing any output. The output buffer must be "caught up"; i.e. no pending output but this should always be the case. The state must be waiting on the start of a block (i.e. mode == TYPE or HEAD). On exit, the output will also be caught up, and the checksum will have been updated if need be.  */
int zlib_inflateIncomp(z_stream *z)
{
    struct inflate_state *state = (struct inflate_state *)z->state;
    Byte *saved_no = z->next_out;
    uInt saved_ao = z->avail_out;
    if (state->mode != TYPE && state->mode != HEAD)
	return Z_DATA_ERROR;
    z->avail_out = 0;
    z->next_out = (unsigned char*)z->next_in + z->avail_in;
    zlib_updatewindow(z, z->avail_in);
    z->avail_out = saved_ao;
    z->next_out = saved_no;
    z->adler = state->check =
        UPDATE(state->check, z->next_in, z->avail_in);
    z->total_out += z->avail_in;
    z->total_in += z->avail_in;
    z->next_in += z->avail_in;
    state->total += z->avail_in;
    z->avail_in = 0;
    return Z_OK;
}