Updated example.
This commit is contained in:
parent
b0a5687a16
commit
d0fe86179c
@ -1,3 +1,8 @@
|
|||||||
|
2008-06-25 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpgme.texi (Listing Keys): Updated example to the current API.
|
||||||
|
Noted by Nico Schottelius.
|
||||||
|
|
||||||
2008-06-05 Werner Koch <wk@g10code.com>
|
2008-06-05 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* uiserver.texi (Miscellaneous UI Server Commands): Describe
|
* uiserver.texi (Miscellaneous UI Server Commands): Describe
|
||||||
|
@ -2772,6 +2772,7 @@ and e-mail address of the main user ID:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
gpgme_ctx_t ctx;
|
gpgme_ctx_t ctx;
|
||||||
|
gpgme_key_t key;
|
||||||
gpgme_error_t err = gpgme_new (&ctx);
|
gpgme_error_t err = gpgme_new (&ctx);
|
||||||
|
|
||||||
if (!err)
|
if (!err)
|
||||||
@ -2782,15 +2783,19 @@ if (!err)
|
|||||||
err = gpgme_op_keylist_next (ctx, &key);
|
err = gpgme_op_keylist_next (ctx, &key);
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
printf ("%s: %s <%s>\n", key->keyid, key->name, key->email);
|
printf ("%s:", key->subkeys->keyid);
|
||||||
|
if (key->uids && key->uids->name)
|
||||||
|
printf (" %s", key->uids->name);
|
||||||
|
if (key->uids && key->uids->email)
|
||||||
|
printf (" <%s>", key->uids->email);
|
||||||
|
putchar ('\n');
|
||||||
gpgme_key_release (key);
|
gpgme_key_release (key);
|
||||||
@}
|
@}
|
||||||
gpgme_release (ctx);
|
gpgme_release (ctx);
|
||||||
@}
|
@}
|
||||||
if (gpg_err_code (err) != GPG_ERR_EOF)
|
if (gpg_err_code (err) != GPG_ERR_EOF)
|
||||||
@{
|
@{
|
||||||
fprintf (stderr, "%s: can not list keys: %s\n",
|
fprintf (stderr, "can not list keys: %s\n", gpgme_strerror (err));
|
||||||
argv[0], gpgme_strerror (err));
|
|
||||||
exit (1);
|
exit (1);
|
||||||
@}
|
@}
|
||||||
@end example
|
@end example
|
||||||
|
Loading…
Reference in New Issue
Block a user