diff --git a/doc/ChangeLog b/doc/ChangeLog index b1257f5e..279e9831 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 63bfde7a..cb466681 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 2719c57b..fd6ae896 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 396ae484..e91e2fb1 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; } }