Lines Matching refs:ctx
22 OSSL_ENCODER_CTX *ctx;
45 int OSSL_ENCODER_to_bio(OSSL_ENCODER_CTX *ctx, BIO *out)
50 data.ctx = ctx;
52 data.current_encoder_inst_index = OSSL_ENCODER_CTX_get_num_encoders(ctx);
78 int OSSL_ENCODER_to_fp(OSSL_ENCODER_CTX *ctx, FILE *fp)
84 ret = OSSL_ENCODER_to_bio(ctx, b);
91 int OSSL_ENCODER_to_data(OSSL_ENCODER_CTX *ctx, unsigned char **pdata,
106 && OSSL_ENCODER_to_bio(ctx, out)
142 int OSSL_ENCODER_CTX_set_selection(OSSL_ENCODER_CTX *ctx, int selection)
144 if (!ossl_assert(ctx != NULL)) {
154 ctx->selection = selection;
158 int OSSL_ENCODER_CTX_set_output_type(OSSL_ENCODER_CTX *ctx,
161 if (!ossl_assert(ctx != NULL) || !ossl_assert(output_type != NULL)) {
166 ctx->output_type = output_type;
170 int OSSL_ENCODER_CTX_set_output_structure(OSSL_ENCODER_CTX *ctx,
173 if (!ossl_assert(ctx != NULL) || !ossl_assert(output_structure != NULL)) {
178 ctx->output_structure = output_structure;
254 static int ossl_encoder_ctx_add_encoder_inst(OSSL_ENCODER_CTX *ctx,
259 if (ctx->encoder_insts == NULL
260 && (ctx->encoder_insts =
266 ok = (sk_OSSL_ENCODER_INSTANCE_push(ctx->encoder_insts, ei) > 0);
270 "(ctx %p) Added encoder instance %p (encoder %p):\n"
272 (void *)ctx, (void *)ei, (void *)ei->encoder,
280 int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder)
287 if (!ossl_assert(ctx != NULL) || !ossl_assert(encoder != NULL)) {
302 if (!ossl_encoder_ctx_add_encoder_inst(ctx, encoder_inst))
313 int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx,
319 int OSSL_ENCODER_CTX_get_num_encoders(OSSL_ENCODER_CTX *ctx)
321 if (ctx == NULL || ctx->encoder_insts == NULL)
323 return sk_OSSL_ENCODER_INSTANCE_num(ctx->encoder_insts);
326 int OSSL_ENCODER_CTX_set_construct(OSSL_ENCODER_CTX *ctx,
329 if (!ossl_assert(ctx != NULL)) {
333 ctx->construct = construct;
337 int OSSL_ENCODER_CTX_set_construct_data(OSSL_ENCODER_CTX *ctx,
340 if (!ossl_assert(ctx != NULL)) {
344 ctx->construct_data = construct_data;
348 int OSSL_ENCODER_CTX_set_cleanup(OSSL_ENCODER_CTX *ctx,
351 if (!ossl_assert(ctx != NULL)) {
355 ctx->cleanup = cleanup;
408 data->ctx->output_structure == NULL ? -1 : 0;
423 sk_OSSL_ENCODER_INSTANCE_value(data->ctx->encoder_insts, i);
433 new_data.ctx = data->ctx;
441 "[%d] (ctx %p) Considering encoder instance %p (encoder %p)\n",
442 data->level, (void *)data->ctx,
454 if (data->ctx->output_type != NULL
456 data->ctx->output_type) != 0) {
461 current_output_type, data->ctx->output_type);
482 if (data->ctx->output_structure != NULL
484 if (OPENSSL_strcasecmp(data->ctx->output_structure,
488 "[%d] Skipping because current encoder output structure (%s) != ctx output structure (%s)\n",
491 data->ctx->output_structure);
539 "[%d] (ctx %p) No suitable encoder found\n",
540 data->level, (void *)data->ctx);
568 data->ctx->construct(current_encoder_inst,
569 data->ctx->construct_data);
636 data->ctx->selection,
638 &data->ctx->pwdata);
641 "[%d] (ctx %p) Running encoder instance %p => %d\n",
642 data->level, (void *)data->ctx,
672 data->ctx->cleanup(data->ctx->construct_data);