[svn] gpgme - r1421 - trunk/src
svn author marcus
cvs at cvs.gnupg.org
Fri Nov 6 01:44:44 CET 2009
Author: marcus
Date: 2009-11-06 01:44:44 +0100 (Fri, 06 Nov 2009)
New Revision: 1421
Modified:
trunk/src/ChangeLog
trunk/src/gpgme-tool.c
Log:
2009-11-06 Marcus Brinkmann <marcus at g10code.de>
* gpgme-tool.c (struct gpgme_tool): New members write_data and
write_data_hook.
(gt_write_data): New function.
(gt_result): Output vfs_mount result.
(server_write_data): New function.
(gpgme_server): Initialize write_data members.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-11-06 00:12:59 UTC (rev 1420)
+++ trunk/src/ChangeLog 2009-11-06 00:44:44 UTC (rev 1421)
@@ -1,3 +1,12 @@
+2009-11-06 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpgme-tool.c (struct gpgme_tool): New members write_data and
+ write_data_hook.
+ (gt_write_data): New function.
+ (gt_result): Output vfs_mount result.
+ (server_write_data): New function.
+ (gpgme_server): Initialize write_data members.
+
2009-11-05 Marcus Brinkmann <marcus at g10code.de>
* engine-g13.c (struct engine_g13): Remove members RESULT_CB and
Modified: trunk/src/gpgme-tool.c
===================================================================
--- trunk/src/gpgme-tool.c 2009-11-06 00:12:59 UTC (rev 1420)
+++ trunk/src/gpgme-tool.c 2009-11-06 00:44:44 UTC (rev 1421)
@@ -35,6 +35,8 @@
#include <argp.h>
#endif
+#include <assuan.h>
+
#include "gpgme.h"
@@ -509,6 +511,8 @@
gpg_error_t (*write_status) (void *hook, const char *status, const char *msg);
void *write_status_hook;
+ gpg_error_t (*write_data) (void *hook, const void *buf, size_t len);
+ void *write_data_hook;
};
typedef struct gpgme_tool *gpgme_tool_t;
@@ -739,6 +743,13 @@
gpg_error_t
+gt_write_data (gpgme_tool_t gt, void *buf, size_t len)
+{
+ return gt->write_data (gt->write_data_hook, buf, len);
+}
+
+
+gpg_error_t
gt_get_engine_info (gpgme_tool_t gt, gpgme_protocol_t proto)
{
gpgme_engine_info_t info;
@@ -1085,6 +1096,18 @@
}
}
}
+ if (flags & GT_RESULT_VFS_MOUNT)
+ {
+ gpgme_vfs_mount_result_t res = gpgme_op_vfs_mount_result (gt->ctx);
+ if (res)
+ {
+ gt_write_data (gt, "vfs_mount\n", 10);
+ gt_write_data (gt, "mount_dir:", 10);
+ gt_write_data (gt, res->mount_dir, strlen (res->mount_dir));
+ gt_write_data (gt, "\n", 1);
+ }
+ }
+
return 0;
}
@@ -1113,6 +1136,14 @@
}
+gpg_error_t
+server_write_data (void *hook, const void *buf, size_t len)
+{
+ struct server *server = hook;
+ return assuan_send_data (server->assuan_ctx, buf, len);
+}
+
+
static gpgme_data_encoding_t
server_data_encoding (const char *line)
{
@@ -1999,6 +2030,8 @@
server.gt = gt;
gt->write_status = server_write_status;
gt->write_status_hook = &server;
+ gt->write_data = server_write_data;
+ gt->write_data_hook = &server;
/* We use a pipe based server so that we can work from scripts.
assuan_init_pipe_server will automagically detect when we are
More information about the Gnupg-commits
mailing list