2009-11-10 Marcus Brinkmann <marcus@g10code.de>
+ * gpgme.c (gpgme_new): Set default sub protocol.
+ * gpgme-tool.c: Implement get sub protocol.
+
* 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.
}
+gpg_error_t
+gt_get_protocol (gpgme_tool_t gt)
+{
+ gpgme_protocol_t proto = gpgme_get_protocol (gt->ctx);
+
+ gt_write_status (gt, STATUS_PROTOCOL, gpgme_get_protocol_name (proto),
+ NULL);
+
+ return 0;
+}
+
+
gpg_error_t
gt_set_sub_protocol (gpgme_tool_t gt, gpgme_protocol_t proto)
{
gpg_error_t
-gt_get_protocol (gpgme_tool_t gt)
+gt_get_sub_protocol (gpgme_tool_t gt)
{
- gpgme_protocol_t proto = gpgme_get_protocol (gt->ctx);
+ gpgme_protocol_t proto = gpgme_get_sub_protocol (gt->ctx);
gt_write_status (gt, STATUS_PROTOCOL, gpgme_get_protocol_name (proto),
NULL);
struct server *server = assuan_get_pointer (ctx);
if (line && *line)
return gt_set_sub_protocol (server->gt, gt_protocol_from_name (line));
- /* FIXME. */
- return 0;
+ else
+ return gt_get_sub_protocol (server->gt);
}
ctx->keylist_mode = GPGME_KEYLIST_MODE_LOCAL;
ctx->include_certs = GPGME_INCLUDE_CERTS_DEFAULT;
ctx->protocol = GPGME_PROTOCOL_OpenPGP;
+ ctx->sub_protocol = GPGME_PROTOCOL_DEFAULT;
_gpgme_fd_table_init (&ctx->fdt);
LOCK (def_lc_lock);