2005-08-26 Marcus Brinkmann <marcus@g10code.de>
* edit.c (command_handler): Do not depend on PROCESSED being available.
This commit is contained in:
parent
9f952a5a0b
commit
ae92f92826
@ -1,5 +1,8 @@
|
|||||||
2005-08-26 Marcus Brinkmann <marcus@g10code.de>
|
2005-08-26 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* edit.c (command_handler): Do not depend on PROCESSED being
|
||||||
|
available.
|
||||||
|
|
||||||
* engine.h (engine_command_handler_t): Add new argument processed.
|
* engine.h (engine_command_handler_t): Add new argument processed.
|
||||||
* ops.h (_gpgme_passphrase_command_handler_internal): Rename
|
* ops.h (_gpgme_passphrase_command_handler_internal): Rename
|
||||||
prototype to ...
|
prototype to ...
|
||||||
|
10
gpgme/edit.c
10
gpgme/edit.c
@ -63,20 +63,21 @@ edit_status_handler (void *priv, gpgme_status_code_t status, char *args)
|
|||||||
|
|
||||||
static gpgme_error_t
|
static gpgme_error_t
|
||||||
command_handler (void *priv, gpgme_status_code_t status, const char *args,
|
command_handler (void *priv, gpgme_status_code_t status, const char *args,
|
||||||
int fd, int *processed)
|
int fd, int *processed_r)
|
||||||
{
|
{
|
||||||
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
|
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
|
||||||
gpgme_error_t err;
|
gpgme_error_t err;
|
||||||
|
int processed = 0;
|
||||||
|
|
||||||
if (ctx->passphrase_cb)
|
if (ctx->passphrase_cb)
|
||||||
{
|
{
|
||||||
err = _gpgme_passphrase_command_handler (ctx, status, args,
|
err = _gpgme_passphrase_command_handler (ctx, status, args,
|
||||||
fd, processed);
|
fd, &processed);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*processed)
|
if (!processed)
|
||||||
{
|
{
|
||||||
void *hook;
|
void *hook;
|
||||||
op_data_t opd;
|
op_data_t opd;
|
||||||
@ -89,11 +90,12 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args,
|
|||||||
/* FIXME: We expect the user to handle _all_ status codes.
|
/* FIXME: We expect the user to handle _all_ status codes.
|
||||||
Later, we may fix the callback interface to allow the user
|
Later, we may fix the callback interface to allow the user
|
||||||
indicate if it processed the status code or not. */
|
indicate if it processed the status code or not. */
|
||||||
*processed = 1;
|
*processed_r = 1;
|
||||||
|
|
||||||
return (*opd->fnc) (opd->fnc_value, status, args, fd);
|
return (*opd->fnc) (opd->fnc_value, status, args, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*processed_r = processed;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user