Add function gpgme_signers_count.

* src/signers.c (gpgme_signers_count): New.
* src/libgpgme.vers, src/gpgme.def: Add as external symbol.
* src/gpgme.h.in: Add prototype.
This commit is contained in:
Werner Koch 2013-06-18 10:27:46 +02:00
parent 5df596d6ec
commit f2eeccbdfa
6 changed files with 23 additions and 0 deletions

4
NEWS
View File

@ -1,6 +1,10 @@
Noteworthy changes in version 1.4.3 (unreleased) Noteworthy changes in version 1.4.3 (unreleased)
------------------------------------------------ ------------------------------------------------
* Interface changes relative to the 1.4.2 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_signers_count NEW.
Noteworthy changes in version 1.4.2 (2013-05-28) Noteworthy changes in version 1.4.2 (2013-05-28)
------------------------------------------------ ------------------------------------------------

View File

@ -4785,6 +4785,11 @@ list of signers in the context @var{ctx}.
Calling this function acquires an additional reference for the key. Calling this function acquires an additional reference for the key.
@end deftypefun @end deftypefun
@deftypefun @w{unsigned int} gpgme_signers_count (@w{const gpgme_ctx_t @var{ctx}})
The function @code{gpgme_signers_count} returns the number of signer keys in
the context @var{ctx}.
@end deftypefun
@deftypefun gpgme_key_t gpgme_signers_enum (@w{const gpgme_ctx_t @var{ctx}}, @w{int @var{seq}}) @deftypefun gpgme_key_t gpgme_signers_enum (@w{const gpgme_ctx_t @var{ctx}}, @w{int @var{seq}})
The function @code{gpgme_signers_enum} returns the @var{seq}th key in The function @code{gpgme_signers_enum} returns the @var{seq}th key in
the list of signers in the context @var{ctx}. An additional reference the list of signers in the context @var{ctx}. An additional reference

View File

@ -209,5 +209,7 @@ EXPORTS
gpgme_set_pinentry_mode @158 gpgme_set_pinentry_mode @158
gpgme_get_pinentry_mode @159 gpgme_get_pinentry_mode @159
gpgme_signers_count @160
; END ; END

View File

@ -934,6 +934,9 @@ void gpgme_signers_clear (gpgme_ctx_t ctx);
/* Add KEY to list of signers in CTX. */ /* Add KEY to list of signers in CTX. */
gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key); gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key);
/* Return the number of signers in CTX. */
unsigned int gpgme_signers_count (const gpgme_ctx_t ctx);
/* Return the SEQth signer's key in CTX. */ /* Return the SEQth signer's key in CTX. */
gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq); gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq);

View File

@ -143,6 +143,7 @@ GPGME_1.0 {
gpgme_set_textmode; gpgme_set_textmode;
gpgme_signers_add; gpgme_signers_add;
gpgme_signers_clear; gpgme_signers_clear;
gpgme_signers_count;
gpgme_signers_enum; gpgme_signers_enum;
gpgme_key_ref; gpgme_key_ref;

View File

@ -93,6 +93,14 @@ gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key)
} }
/* Return the number of signers in CTX. */
unsigned int
gpgme_signers_count (const gpgme_ctx_t ctx)
{
return ctx? ctx->signers_len : 0;
}
/* Return the SEQth signer's key in CTX with one reference. */ /* Return the SEQth signer's key in CTX with one reference. */
gpgme_key_t gpgme_key_t
gpgme_signers_enum (const gpgme_ctx_t ctx, int seq) gpgme_signers_enum (const gpgme_ctx_t ctx, int seq)