aboutsummaryrefslogtreecommitdiffstats
path: root/gpgme/edit.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2005-08-26 14:53:55 +0000
committerMarcus Brinkmann <[email protected]>2005-08-26 14:53:55 +0000
commit9f952a5a0b6876814d43495f077aa114eec352d7 (patch)
tree3b5131c781c616ae4468806bbcab189d446d403e /gpgme/edit.c
parent* configure.ac (SEPCONSTANTS): New to define DIRSEP_C et al. (diff)
downloadgpgme-9f952a5a0b6876814d43495f077aa114eec352d7.tar.gz
gpgme-9f952a5a0b6876814d43495f077aa114eec352d7.zip
2005-08-26 Marcus Brinkmann <[email protected]>
* engine.h (engine_command_handler_t): Add new argument processed. * ops.h (_gpgme_passphrase_command_handler_internal): Rename prototype to ... (_gpgme_passphrase_command_handler): ... this one. * passphrase.c (_gpgme_passphrase_command_handler_internal): Rename to ... (_gpgme_passphrase_command_handler): ... this one. * edit.c (command_handler): Add new argument processed. Remove local variable with the same name. Always return processed as true. * rungpg.c (command_handler): Send a newline character if the handler did not.
Diffstat (limited to 'gpgme/edit.c')
-rw-r--r--gpgme/edit.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gpgme/edit.c b/gpgme/edit.c
index 9ef450f0..6ff8fba4 100644
--- a/gpgme/edit.c
+++ b/gpgme/edit.c
@@ -63,21 +63,20 @@ edit_status_handler (void *priv, gpgme_status_code_t status, char *args)
static gpgme_error_t
command_handler (void *priv, gpgme_status_code_t status, const char *args,
- int fd)
+ int fd, int *processed)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
- int processed = 0;
if (ctx->passphrase_cb)
{
- err = _gpgme_passphrase_command_handler_internal (ctx, status, args,
- fd, &processed);
+ err = _gpgme_passphrase_command_handler (ctx, status, args,
+ fd, processed);
if (err)
return err;
}
- if (!processed)
+ if (!*processed)
{
void *hook;
op_data_t opd;
@@ -87,8 +86,14 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args,
if (err)
return err;
+ /* FIXME: We expect the user to handle _all_ status codes.
+ Later, we may fix the callback interface to allow the user
+ indicate if it processed the status code or not. */
+ *processed = 1;
+
return (*opd->fnc) (opd->fnc_value, status, args, fd);
}
+
return 0;
}