[svn] gpgme - r1320 - trunk/doc

svn author wk cvs at cvs.gnupg.org
Wed Jun 25 03:44:53 CEST 2008


Author: wk
Date: 2008-06-25 03:44:50 +0200 (Wed, 25 Jun 2008)
New Revision: 1320

Modified:
   trunk/doc/ChangeLog
   trunk/doc/gpgme.texi
Log:
Updated example.


Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog	2008-06-20 10:40:52 UTC (rev 1319)
+++ trunk/doc/ChangeLog	2008-06-25 01:44:50 UTC (rev 1320)
@@ -1,3 +1,8 @@
+2008-06-25  Werner Koch  <wk at g10code.com>
+
+	* gpgme.texi (Listing Keys): Updated example to the current API.
+	Noted by Nico Schottelius.
+
 2008-06-05  Werner Koch  <wk at g10code.com>
 
 	* uiserver.texi (Miscellaneous UI Server Commands): Describe

Modified: trunk/doc/gpgme.texi
===================================================================
--- trunk/doc/gpgme.texi	2008-06-20 10:40:52 UTC (rev 1319)
+++ trunk/doc/gpgme.texi	2008-06-25 01:44:50 UTC (rev 1320)
@@ -2772,6 +2772,7 @@
 
 @example
 gpgme_ctx_t ctx;
+gpgme_key_t key;
 gpgme_error_t err = gpgme_new (&ctx);
 
 if (!err)
@@ -2782,15 +2783,19 @@
         err = gpgme_op_keylist_next (ctx, &key);
         if (err)
           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_release (ctx);
   @}
 if (gpg_err_code (err) != GPG_ERR_EOF)
   @{
-    fprintf (stderr, "%s: can not list keys: %s\n",
-             argv[0], gpgme_strerror (err));
+    fprintf (stderr, "can not list keys: %s\n", gpgme_strerror (err));
     exit (1);
   @}
 @end example




More information about the Gnupg-commits mailing list