From 09635ef2e606ac5c4da7a5f640ebb19e922aed89 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 22 Apr 2002 22:06:09 +0000 Subject: [PATCH] doc/ 2002-04-23 Marcus Brinkmann * gpgme.texi (Passphrase Callback): Document that either return argument can be NULL. (Progress Meter Callback): Likewise. gpgme/ 2002-04-23 Marcus Brinkmann * gpgme.c (gpgme_get_progress_cb): Allow either return parameter to be NULL. (gpgme_get_passphrase_cb): Likewise. --- doc/ChangeLog | 6 ++++++ doc/gpgme.texi | 6 ++++++ gpgme/ChangeLog | 6 ++++++ gpgme/gpgme.c | 36 ++++++++++++++++++++++-------------- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b1257f5..279e983 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2002-04-23 Marcus Brinkmann + + * gpgme.texi (Passphrase Callback): Document that either return + argument can be NULL. + (Progress Meter Callback): Likewise. + 2002-04-22 Marcus Brinkmann * gpgme.texi (Passphrase Callback): Fix small typo. Document the diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 63bfde7..cb46668 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -1188,6 +1188,9 @@ is used when a passphrase needs to be provided by the user in @var{*passfunc}, and the first argument for this function in @var{*hook_value}. If no passphrase callback is set, or @var{ctx} is not a valid pointer, @code{NULL} is returned in both variables. + +@var{passfunc} or @var{hook_value} can be @code{NULL}. In this case, +the corresponding value will not be returned. @end deftypefun @@ -1229,6 +1232,9 @@ used to inform the user about the progress made in @var{*progfunc}, and the first argument for this function in @var{*hook_value}. If no progress callback is set, or @var{ctx} is not a valid pointer, @code{NULL} is returned in both variables. + +@var{progfunc} or @var{hook_value} can be @code{NULL}. In this case, +the corresponding value will not be returned. @end deftypefun diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 2719c57..fd6ae89 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,9 @@ +2002-04-23 Marcus Brinkmann + + * gpgme.c (gpgme_get_progress_cb): Allow either return parameter + to be NULL. + (gpgme_get_passphrase_cb): Likewise. + 2002-04-22 Marcus Brinkmann * gpgme.c (gpgme_get_passphrase_cb): New function. diff --git a/gpgme/gpgme.c b/gpgme/gpgme.c index 396ae48..e91e2fb 100644 --- a/gpgme/gpgme.c +++ b/gpgme/gpgme.c @@ -401,24 +401,28 @@ gpgme_set_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb cb, void *cb_value) /** * gpgme_get_passphrase_cb: * @ctx: the context - * @cb: The current callback function - * @cb_value: The current value passed to the callback function + * @r_cb: The current callback function + * @r_cb_value: The current value passed to the callback function * * This function returns the callback function to be used to pass a passphrase * to the crypto engine. **/ void -gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *cb, void **cb_value) +gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *r_cb, void **r_cb_value) { if (ctx) { - *cb = ctx->passphrase_cb; - *cb_value = ctx->passphrase_cb_value; + if (r_cb) + *r_cb = ctx->passphrase_cb; + if (r_cb_value) + *r_cb_value = ctx->passphrase_cb_value; } else { - *cb = NULL; - *cb_value = NULL; + if (r_cb) + *r_cb = NULL; + if (r_cb_value) + *r_cb_value = NULL; } } @@ -454,22 +458,26 @@ gpgme_set_progress_cb (GpgmeCtx ctx, GpgmeProgressCb cb, void *cb_value) /** * gpgme_get_progress_cb: * @ctx: the context - * @cb: The current callback function - * @cb_value: The current value passed to the callback function + * @r_cb: The current callback function + * @r_cb_value: The current value passed to the callback function * * This function returns the callback function to be used as a progress indicator. **/ void -gpgme_get_progress_cb (GpgmeCtx ctx, GpgmeProgressCb *cb, void **cb_value) +gpgme_get_progress_cb (GpgmeCtx ctx, GpgmeProgressCb *r_cb, void **r_cb_value) { if (ctx) { - *cb = ctx->progress_cb; - *cb_value = ctx->progress_cb_value; + if (r_cb) + *r_cb = ctx->progress_cb; + if (r_cb_value) + *r_cb_value = ctx->progress_cb_value; } else { - *cb = NULL; - *cb_value = NULL; + if (r_cb) + *r_cb = NULL; + if (r_cb_value) + *r_cb_value = NULL; } } -- 2.26.2