[svn] gpgme - r1427 - trunk/src
svn author marcus
cvs at cvs.gnupg.org
Tue Nov 10 15:54:39 CET 2009
Author: marcus
Date: 2009-11-10 15:54:39 +0100 (Tue, 10 Nov 2009)
New Revision: 1427
Modified:
trunk/src/ChangeLog
trunk/src/gpgme-tool.c
trunk/src/gpgme.c
Log:
2009-11-10 Marcus Brinkmann <marcus at g10code.de>
* gpgme.c (gpgme_new): Set default sub protocol.
* gpgme-tool.c: Implement get sub protocol.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-11-10 14:49:35 UTC (rev 1426)
+++ trunk/src/ChangeLog 2009-11-10 14:54:39 UTC (rev 1427)
@@ -1,5 +1,8 @@
2009-11-10 Marcus Brinkmann <marcus at 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.
Modified: trunk/src/gpgme-tool.c
===================================================================
--- trunk/src/gpgme-tool.c 2009-11-10 14:49:35 UTC (rev 1426)
+++ trunk/src/gpgme-tool.c 2009-11-10 14:54:39 UTC (rev 1427)
@@ -799,6 +799,18 @@
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)
{
return gpgme_set_sub_protocol (gt->ctx, proto);
@@ -806,9 +818,9 @@
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);
@@ -1268,8 +1280,8 @@
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);
}
Modified: trunk/src/gpgme.c
===================================================================
--- trunk/src/gpgme.c 2009-11-10 14:49:35 UTC (rev 1426)
+++ trunk/src/gpgme.c 2009-11-10 14:54:39 UTC (rev 1427)
@@ -77,6 +77,7 @@
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);
More information about the Gnupg-commits
mailing list