Lines Matching refs:state

115     struct brotli_state *state = OPENSSL_zalloc(sizeof(*state));  in brotli_stateful_init()  local
117 if (state == NULL) in brotli_stateful_init()
120 state->encoder = BrotliEncoderCreateInstance(brotli_alloc, brotli_free, NULL); in brotli_stateful_init()
121 if (state->encoder == NULL) in brotli_stateful_init()
124 state->decoder = BrotliDecoderCreateInstance(brotli_alloc, brotli_free, NULL); in brotli_stateful_init()
125 if (state->decoder == NULL) in brotli_stateful_init()
128 ctx->data = state; in brotli_stateful_init()
131 BrotliDecoderDestroyInstance(state->decoder); in brotli_stateful_init()
132 BrotliEncoderDestroyInstance(state->encoder); in brotli_stateful_init()
133 OPENSSL_free(state); in brotli_stateful_init()
139 struct brotli_state *state = ctx->data; in brotli_stateful_finish() local
141 if (state != NULL) { in brotli_stateful_finish()
142 BrotliDecoderDestroyInstance(state->decoder); in brotli_stateful_finish()
143 BrotliEncoderDestroyInstance(state->encoder); in brotli_stateful_finish()
144 OPENSSL_free(state); in brotli_stateful_finish()
154 struct brotli_state *state = ctx->data; in brotli_stateful_compress_block() local
158 if (state == NULL || olen > OSSL_SSIZE_MAX) in brotli_stateful_compress_block()
171 done = BrotliEncoderCompressStream(state->encoder, BROTLI_OPERATION_FLUSH, in brotli_stateful_compress_block()
176 || BrotliEncoderHasMoreOutput(state->encoder)) in brotli_stateful_compress_block()
189 struct brotli_state *state = ctx->data; in brotli_stateful_expand_block() local
193 if (state == NULL || olen > OSSL_SSIZE_MAX) in brotli_stateful_expand_block()
199 result = BrotliDecoderDecompressStream(state->decoder, &in_avail, in brotli_stateful_expand_block()
204 || BrotliDecoderHasMoreOutput(state->decoder)) in brotli_stateful_expand_block()
387 BrotliDecoderState *state; member
396 BrotliEncoderState *state; member
458 ctx->decode.state = BrotliDecoderCreateInstance(brotli_alloc, brotli_free, NULL); in bio_brotli_new()
459 if (ctx->decode.state == NULL) in bio_brotli_new()
462 ctx->encode.state = BrotliEncoderCreateInstance(brotli_alloc, brotli_free, NULL); in bio_brotli_new()
463 if (ctx->encode.state == NULL) in bio_brotli_new()
473 BrotliDecoderDestroyInstance(ctx->decode.state); in bio_brotli_new()
474 BrotliEncoderDestroyInstance(ctx->encode.state); in bio_brotli_new()
488 BrotliDecoderDestroyInstance(ctx->decode.state); in bio_brotli_free()
490 BrotliEncoderDestroyInstance(ctx->encode.state); in bio_brotli_free()
535 while (ctx->decode.avail_in > 0 || BrotliDecoderHasMoreOutput(ctx->decode.state)) { in bio_brotli_read()
536 …bret = BrotliDecoderDecompressStream(ctx->decode.state, &ctx->decode.avail_in, (const uint8_t**)&c… in bio_brotli_read()
540 … ERR_add_error_data(1, BrotliDecoderErrorString(BrotliDecoderGetErrorCode(ctx->decode.state))); in bio_brotli_read()
544 if (BrotliDecoderIsFinished(ctx->decode.state) || ctx->decode.avail_out == 0) in bio_brotli_read()
549 if (BrotliDecoderIsFinished(ctx->decode.state)) in bio_brotli_read()
626 if (ctx->encode.avail_in == 0 && !BrotliEncoderHasMoreOutput(ctx->encode.state)) in bio_brotli_write()
636 …brret = BrotliEncoderCompressStream(ctx->encode.state, BROTLI_OPERATION_FLUSH, &ctx->encode.avail_… in bio_brotli_write()
685 …brret = BrotliEncoderCompressStream(ctx->encode.state, BROTLI_OPERATION_FINISH, &ctx->encode.avail… in bio_brotli_flush()
692 if (!BrotliEncoderHasMoreOutput(ctx->encode.state) && ctx->encode.avail_in == 0) in bio_brotli_flush()
770 if (BrotliEncoderHasMoreOutput(ctx->encode.state)) in bio_brotli_ctrl()
777 if (!BrotliDecoderIsFinished(ctx->decode.state)) in bio_brotli_ctrl()