aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpgme.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2009-11-10 14:49:35 +0000
committerMarcus Brinkmann <[email protected]>2009-11-10 14:49:35 +0000
commitcda07b9ab4f09ac87bc1aebbbe113f125eedeb02 (patch)
tree53b0a5bc6d03bbea4b0fce70ea3454777907ad4c /src/gpgme.c
parent2009-11-10 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-cda07b9ab4f09ac87bc1aebbbe113f125eedeb02.tar.gz
gpgme-cda07b9ab4f09ac87bc1aebbbe113f125eedeb02.zip
2009-11-10 Marcus Brinkmann <[email protected]>
* 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.
Diffstat (limited to 'src/gpgme.c')
-rw-r--r--src/gpgme.c21
1 files changed, 15 insertions, 6 deletions
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;
}