aboutsummaryrefslogtreecommitdiffstats
path: root/gpgme/edit.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2003-10-02 15:03:02 +0000
committerMarcus Brinkmann <[email protected]>2003-10-02 15:03:02 +0000
commit91f217b4b2f769c9d231e7c6ad7c214b3d9e688c (patch)
tree9395e9c4a3e082ab8d13f4da23180b9c7aea4eff /gpgme/edit.c
parent2003-09-30 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-91f217b4b2f769c9d231e7c6ad7c214b3d9e688c.tar.gz
gpgme-91f217b4b2f769c9d231e7c6ad7c214b3d9e688c.zip
2003-10-02 Marcus Brinkmann <[email protected]>
* engine-backend.h (struct engine_ops): Add argument TYPE. * engine.c (_gpgme_engine_op_edit): Likewise. * engine.h: Likewise. * rungpg.c (gpg_edit): Likewise. Use it. * edit.c (edit_start): Likewise. Pass it on. (gpgme_op_edit_start, gpgme_op_edit): Likewise. (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
Diffstat (limited to 'gpgme/edit.c')
-rw-r--r--gpgme/edit.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/gpgme/edit.c b/gpgme/edit.c
index 5ea68b81..8c538f3a 100644
--- a/gpgme/edit.c
+++ b/gpgme/edit.c
@@ -93,7 +93,7 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args,
static gpgme_error_t
-edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
+edit_start (gpgme_ctx_t ctx, int synchronous, int type, gpgme_key_t key,
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{
gpgme_error_t err;
@@ -122,7 +122,7 @@ edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
_gpgme_engine_set_status_handler (ctx->engine, edit_status_handler, ctx);
- return _gpgme_engine_op_edit (ctx->engine, key, out, ctx);
+ return _gpgme_engine_op_edit (ctx->engine, type, key, out, ctx);
}
@@ -130,7 +130,7 @@ gpgme_error_t
gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{
- return edit_start (ctx, 0, key, fnc, fnc_value, out);
+ return edit_start (ctx, 0, 0, key, fnc, fnc_value, out);
}
@@ -140,7 +140,29 @@ gpgme_error_t
gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{
- gpgme_error_t err = edit_start (ctx, 1, key, fnc, fnc_value, out);
+ gpgme_error_t err = edit_start (ctx, 1, 0, key, fnc, fnc_value, out);
+ if (!err)
+ err = _gpgme_wait_one (ctx);
+ return err;
+}
+
+
+gpgme_error_t
+gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
+ gpgme_edit_cb_t fnc, void *fnc_value,
+ gpgme_data_t out)
+{
+ return edit_start (ctx, 0, 1, key, fnc, fnc_value, out);
+}
+
+
+/* Edit the card for the key KEY. Send status and command requests to
+ FNC and output of edit commands to OUT. */
+gpgme_error_t
+gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key,
+ gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
+{
+ gpgme_error_t err = edit_start (ctx, 1, 1, key, fnc, fnc_value, out);
if (!err)
err = _gpgme_wait_one (ctx);
return err;