Lines Matching refs:state

121     struct zlib_state *state = OPENSSL_zalloc(sizeof(*state));  in zlib_stateful_init()  local
123 if (state == NULL) in zlib_stateful_init()
126 state->istream.zalloc = zlib_zalloc; in zlib_stateful_init()
127 state->istream.zfree = zlib_zfree; in zlib_stateful_init()
128 state->istream.opaque = Z_NULL; in zlib_stateful_init()
129 state->istream.next_in = Z_NULL; in zlib_stateful_init()
130 state->istream.next_out = Z_NULL; in zlib_stateful_init()
131 err = inflateInit_(&state->istream, ZLIB_VERSION, sizeof(z_stream)); in zlib_stateful_init()
135 state->ostream.zalloc = zlib_zalloc; in zlib_stateful_init()
136 state->ostream.zfree = zlib_zfree; in zlib_stateful_init()
137 state->ostream.opaque = Z_NULL; in zlib_stateful_init()
138 state->ostream.next_in = Z_NULL; in zlib_stateful_init()
139 state->ostream.next_out = Z_NULL; in zlib_stateful_init()
140 err = deflateInit_(&state->ostream, Z_DEFAULT_COMPRESSION, in zlib_stateful_init()
145 ctx->data = state; in zlib_stateful_init()
148 OPENSSL_free(state); in zlib_stateful_init()
154 struct zlib_state *state = ctx->data; in zlib_stateful_finish() local
155 inflateEnd(&state->istream); in zlib_stateful_finish()
156 deflateEnd(&state->ostream); in zlib_stateful_finish()
157 OPENSSL_free(state); in zlib_stateful_finish()
165 struct zlib_state *state = ctx->data; in zlib_stateful_compress_block() local
167 if (state == NULL) in zlib_stateful_compress_block()
170 state->ostream.next_in = in; in zlib_stateful_compress_block()
171 state->ostream.avail_in = ilen; in zlib_stateful_compress_block()
172 state->ostream.next_out = out; in zlib_stateful_compress_block()
173 state->ostream.avail_out = olen; in zlib_stateful_compress_block()
175 err = deflate(&state->ostream, Z_SYNC_FLUSH); in zlib_stateful_compress_block()
178 if (state->ostream.avail_out > olen) in zlib_stateful_compress_block()
180 return (ossl_ssize_t)(olen - state->ostream.avail_out); in zlib_stateful_compress_block()
188 struct zlib_state *state = ctx->data; in zlib_stateful_expand_block() local
190 if (state == NULL) in zlib_stateful_expand_block()
193 state->istream.next_in = in; in zlib_stateful_expand_block()
194 state->istream.avail_in = ilen; in zlib_stateful_expand_block()
195 state->istream.next_out = out; in zlib_stateful_expand_block()
196 state->istream.avail_out = olen; in zlib_stateful_expand_block()
198 err = inflate(&state->istream, Z_SYNC_FLUSH); in zlib_stateful_expand_block()
201 if (state->istream.avail_out > olen) in zlib_stateful_expand_block()
203 return (ossl_ssize_t)(olen - state->istream.avail_out); in zlib_stateful_expand_block()