* 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.
2009-11-10 Marcus Brinkmann <marcus@g10code.de>
+ * 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.
+
* Makefile.am (uiserver_components): New variable.
(main_sources): Add it.
* ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument,
/* The running engine process. */
engine_t engine;
+ /* Engine's sub protocol. */
+ gpgme_protocol_t sub_protocol;
+
/* True if armor mode should be used. */
unsigned int use_armor : 1;
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;
}
gpgme_key_from_uid @149
gpgme_set_sub_protocol @150
+ gpgme_get_sub_protocol @151
; END
prococol (for example, an UISERVER can support OpenPGP and CMS).
This is reset to the default with gpgme_set_protocol. */
gpgme_error_t gpgme_set_sub_protocol (gpgme_ctx_t ctx,
- gpgme_protocol_t proto);
+ gpgme_protocol_t proto);
+/* Get the sub protocol. */
+gpgme_protocol_t gpgme_get_sub_protocol (gpgme_ctx_t ctx);
/* Get the string describing protocol PROTO, or NULL if invalid. */
const char *gpgme_get_protocol_name (gpgme_protocol_t proto);
gpgme_key_from_uid;
gpgme_set_sub_protocol;
+ gpgme_get_sub_protocol;
};
}
}
+ err = _gpgme_engine_set_protocol (ctx->engine, ctx->sub_protocol);
+ if (err)
+ return err;
+
if (type == 1 || (type == 2 && !ctx->io_cbs.add))
{
/* Use private event loop. */