+2009-11-06 Marcus Brinkmann <marcus@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@g10code.de>
* engine-g13.c (struct engine_g13): Remove members RESULT_CB and
#include <argp.h>
#endif
+#include <assuan.h>
+
#include "gpgme.h"
\f
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;
}
+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)
{
}
}
}
+ 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;
}
}
+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)
{
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