From cda07b9ab4f09ac87bc1aebbbe113f125eedeb02 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 10 Nov 2009 14:49:35 +0000 Subject: 2009-11-10 Marcus Brinkmann * gpgme.h.in (gpgme_get_sub_protocol): Add prototype. * gpgme.def, libgpgme.vers: Add gpgme_get_sub_protocol. * context.h (struct gpgme_context): New member sub_protocol. * gpgme.c (gpgme_set_sub_protocol): Set CTX->sub_protocol. (gpgme_get_sub_protocol): New function. * op-support.c (_gpgme_op_reset): Set sub protocol. --- src/gpgme.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/gpgme.c') diff --git a/src/gpgme.c b/src/gpgme.c index b6c79a0d..7c523851 100644 --- a/src/gpgme.c +++ b/src/gpgme.c @@ -305,13 +305,22 @@ gpgme_get_protocol (gpgme_ctx_t ctx) gpgme_error_t gpgme_set_sub_protocol (gpgme_ctx_t ctx, gpgme_protocol_t protocol) { - gpgme_error_t err; - TRACE_BEG2 (DEBUG_CTX, "gpgme_set_sub_protocol", ctx, "protocol=%i (%s)", - protocol, gpgme_get_protocol_name (protocol) - ? gpgme_get_protocol_name (protocol) : "invalid"); + TRACE2 (DEBUG_CTX, "gpgme_set_sub_protocol", ctx, "protocol=%i (%s)", + protocol, gpgme_get_protocol_name (protocol) + ? gpgme_get_protocol_name (protocol) : "invalid"); + ctx->sub_protocol = protocol; + return 0; +} - err = _gpgme_engine_set_protocol (ctx->engine, protocol); - return TRACE_ERR (err); + +gpgme_error_t +gpgme_get_sub_protocol (gpgme_ctx_t ctx) +{ + TRACE2 (DEBUG_CTX, "gpgme_get_sub_protocol", ctx, + "ctx->sub_protocol=%i (%s)", ctx->sub_protocol, + gpgme_get_protocol_name (ctx->sub_protocol) + ? gpgme_get_protocol_name (ctx->sub_protocol) : "invalid"); + return ctx->sub_protocol; } -- cgit v1.2.3