From: Marcus Brinkmann Date: Mon, 22 Apr 2002 21:58:26 +0000 (+0000) Subject: doc/ X-Git-Tag: gpgme-1.2.0@1385~1017 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5ead75cbf9da1eaaeb6ea820ec8896590d03bc24;p=gpgme.git doc/ 2002-04-22 Marcus Brinkmann * gpgme.texi (Passphrase Callback): Fix small typo. Document the new function gpgme_get_passphrase_cb. (Progress Meter Callback): Document the new function gpgme_get_progress_cb. gpgme/ 2002-04-22 Marcus Brinkmann * gpgme.c (gpgme_get_passphrase_cb): New function. (gpgme_get_progress_cb): New function. * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and gpgme_get_progress_cb. --- diff --git a/trunk/NEWS b/trunk/NEWS index a5a8840..e811e5e 100644 --- a/trunk/NEWS +++ b/trunk/NEWS @@ -1,3 +1,13 @@ + * The current passphrase callback and progress meter callback can be + retrieved with the new functions gpgme_get_passphrase_cb and + gpgme_get_progress_cb respectively. + + * Interface changes relative to the 0.3.5 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +gpgme_get_passphrase_cb NEW +gpgme_get_progress_cb NEW +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Noteworthy changes in version 0.3.5 (2002-04-01) ------------------------------------------------ diff --git a/trunk/doc/ChangeLog b/trunk/doc/ChangeLog index 954014a..b1257f5 100644 --- a/trunk/doc/ChangeLog +++ b/trunk/doc/ChangeLog @@ -1,3 +1,10 @@ +2002-04-22 Marcus Brinkmann + + * gpgme.texi (Passphrase Callback): Fix small typo. Document the + new function gpgme_get_passphrase_cb. + (Progress Meter Callback): Document the new function + gpgme_get_progress_cb. + 2002-04-16 Marcus Brinkmann * gpgme.texi (Creating a Signature): Fix function name. Reported diff --git a/trunk/doc/gpgme.texi b/trunk/doc/gpgme.texi index 63568f5..63bfde7 100644 --- a/trunk/doc/gpgme.texi +++ b/trunk/doc/gpgme.texi @@ -1153,7 +1153,7 @@ current mode otherwise. Note that 0 is not a valid mode value. The @code{GpgmePassphraseCb} type is the type of functions usable as passphrase callback function. -The string @var{desc} contains a test usable to be displayed to the +The string @var{desc} contains a text usable to be displayed to the user of the application. The function should return a passphrase for the context when invoked with @var{desc} not being @code{NULL}. @@ -1182,6 +1182,14 @@ calling @code{gpgme_set_passphrase_cb} with @var{passfunc} being @code{NULL}. @end deftypefun +@deftypefun void gpgme_get_passphrase_cb (@w{GpgmeCtx @var{ctx}}, @w{GpgmePassphraseCb *@var{passfunc}}, @w{void **@var{hook_value}}) +The function @code{gpgme_get_passphrase_cb} returns the function that +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. +@end deftypefun + @node Progress Meter Callback @subsection Progress Meter Callback @@ -1215,6 +1223,14 @@ calling @code{gpgme_set_progress_cb} with @var{progfunc} being @code{NULL}. @end deftypefun +@deftypefun void gpgme_get_progress_cb (@w{GpgmeCtx @var{ctx}}, @w{GpgmeProgressCb *@var{progfunc}}, @w{void **@var{hook_value}}) +The function @code{gpgme_get_progress_cb} returns the function that is +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. +@end deftypefun + @node Key Management @section Key Management diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index e77e3a0..2719c57 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,10 @@ +2002-04-22 Marcus Brinkmann + + * gpgme.c (gpgme_get_passphrase_cb): New function. + (gpgme_get_progress_cb): New function. + * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and + gpgme_get_progress_cb. + 2002-03-28 Werner Koch * gpgme.h (GpgmeAttr): Add values for issuer and chaining. diff --git a/trunk/gpgme/gpgme.c b/trunk/gpgme/gpgme.c index 1de0dc7..396ae48 100644 --- a/trunk/gpgme/gpgme.c +++ b/trunk/gpgme/gpgme.c @@ -397,6 +397,32 @@ 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 + * + * 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) +{ + if (ctx) + { + *cb = ctx->passphrase_cb; + *cb_value = ctx->passphrase_cb_value; + } + else + { + *cb = NULL; + *cb_value = NULL; + } +} + + /** * gpgme_set_progress_cb: * @ctx: the context @@ -423,3 +449,27 @@ gpgme_set_progress_cb (GpgmeCtx ctx, GpgmeProgressCb cb, void *cb_value) ctx->progress_cb_value = cb_value; } } + + +/** + * gpgme_get_progress_cb: + * @ctx: the context + * @cb: The current callback function + * @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) +{ + if (ctx) + { + *cb = ctx->progress_cb; + *cb_value = ctx->progress_cb_value; + } + else + { + *cb = NULL; + *cb_value = NULL; + } +} diff --git a/trunk/gpgme/gpgme.h b/trunk/gpgme/gpgme.h index 49df920..6561564 100644 --- a/trunk/gpgme/gpgme.h +++ b/trunk/gpgme/gpgme.h @@ -249,10 +249,20 @@ int gpgme_get_keylist_mode (GpgmeCtx ctx); void gpgme_set_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb cb, void *hook_value); +/* Get the current passphrase callback function in *CB and the current + hook value in *HOOK_VALUE. */ +void gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *cb, + void **hook_value); + /* Set the progress callback function in CTX to CB. HOOK_VALUE is passed as first argument to the progress callback function. */ void gpgme_set_progress_cb (GpgmeCtx c, GpgmeProgressCb cb, void *hook_value); +/* Get the current progress callback function in *CB and the current + hook value in *HOOK_VALUE. */ +void gpgme_get_progress_cb (GpgmeCtx ctx, GpgmeProgressCb *cb, + void **hook_value); + /* Delete all signers from CTX. */ void gpgme_signers_clear (GpgmeCtx ctx);