aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-10-08 19:14:52 +0000
committerWerner Koch <[email protected]>2016-10-08 19:17:48 +0000
commit0ea2ff67900c243fff9f689658dcb23d1c0961cd (patch)
treedbac0b0c700bec5ce5bb31c070047af3f00d4abe /doc
parentAdd missing includes. (diff)
downloadgpgme-0ea2ff67900c243fff9f689658dcb23d1c0961cd.tar.gz
gpgme-0ea2ff67900c243fff9f689658dcb23d1c0961cd.zip
core: New helper function gpgme_addrspec_from_uid.
* src/gpgme.h.in: Add gpgme_addrspec_from_uid. * src/gpgme.def, src/libgpgme.vers: Ditto. * src/mbox-util.c (gpgme_addrspec_from_uid): New. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'doc')
-rw-r--r--doc/gpgme.texi17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 6d6d692e..cc598887 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -5109,6 +5109,23 @@ pointer, and @code{GPG_ERR_NO_DATA} if @var{cipher} does not contain
any data to decrypt.
@end deftypefun
+When processing mails it is sometimes useful to extract the actual
+mail address (the ``addr-spec'') from a string. GPGME provides this
+helper function which uses the same semantics as the internal
+functions in GPGME and GnuPG:
+
+@deftypefun @w{char *} gpgme_addrspec_from_uid (@w{const char *@var{uid}})
+
+Return the mail address (called ``addr-spec'' in RFC-5322) from the
+string @var{uid} which is assumed to be a user id (called ``address''
+in RFC-5322). All plain ASCII characters (i.e. those with bit 7
+cleared) in the result are converted to lowercase. Caller must free
+the result using @code{gpgme_free}. Returns @code{NULL} if no valid
+address was found (in which case @code{ERRNO} is set to @code{EINVAL})
+or for other errors.
+
+@end deftypefun
+
@node Sign
@subsection Sign