From: Marcus Brinkmann Date: Sat, 13 Sep 2003 21:45:13 +0000 (+0000) Subject: doc/ X-Git-Tag: gpgme-0-4-3~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c4ea1235d56f7ab89ff84fef894d9c0d378d8b72;p=gpgme.git doc/ 2003-09-13 Marcus Brinkmann * gpgme.texi (Error Strings): Add gpgme_strerror_r. gpgme/ 2003-09-13 Marcus Brinkmann * gpgme.h (gpgme_strerror_r): New prototype. * error.c (gpgme_strerror_r): New function. --- diff --git a/ChangeLog b/ChangeLog index 6e98280..bd56d18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2003-09-13 Marcus Brinkmann + * configure.ac: Require libgpg-error 0.5. + * acinclude.m4: Remove libtool cruft, add jm_GLIBC21. * configure.ac: Add check for getenv_r, and call jm_GLIBC21. Define HAVE_THREAD_SAFE_GETENV if appropriate. diff --git a/NEWS b/NEWS index fca10c6..92e049e 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,9 @@ Noteworthy changes in version 0.4.3 (unreleased) variables of course also include the configuration for the thread package itself. Alternatively, use libtool. + * gpgme_strerror_r as a thread safe variant of gpgme_strerror was + added. + * gpgme-config doesn't support setting the prefix or exec prefix anymore. I don't think it ever worked correctly, and it seems to be pointless. @@ -35,8 +38,9 @@ Noteworthy changes in version 0.4.3 (unreleased) than an unsigned long (the old class field is preserved for backwards compatibility). - * Interface changes relative to the 0.4.3 release: + * Interface changes relative to the 0.4.2 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +gpgme_strerror_t NEW gpgme_get_key CHANGED: Fails correctly if key ID not unique. gpgme_key_t EXTENDED: New field can_authenticate. gpgme_subkey_t EXTENDED: New field can_authenticate. diff --git a/TODO b/TODO index 28d5e23..ff60120 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ Hey Emacs, this is -*- outline -*- mode! * Before release: ** set_locale for thread safe and env independent locale selection. -** Add gpgme_strerror_r() when gpg_strerror_r() exists. * ABI's to break: ** I/O and User Data could be made extensible. But this can be done diff --git a/configure.ac b/configure.ac index c5d2fe6..bb30f8b 100644 --- a/configure.ac +++ b/configure.ac @@ -173,7 +173,7 @@ if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then fi # Checking for libgpg-error. -AM_PATH_GPG_ERROR(0.3,, AC_MSG_ERROR([libgpg-error was not found])) +AM_PATH_GPG_ERROR(0.5,, AC_MSG_ERROR([libgpg-error was not found])) AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME, [The default error source for GPGME.]) diff --git a/doc/ChangeLog b/doc/ChangeLog index 16586ed..dd2c2f0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2003-09-13 Marcus Brinkmann + + * gpgme.texi (Error Strings): Add gpgme_strerror_r. + 2003-09-13 Marcus Brinkmann * gpgme.texi (Multi Threading): Update documentation. diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 30837f9..1e00d75 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -1232,6 +1232,18 @@ The function @code{gpgme_strerror} returns a pointer to a statically allocated string containing a description of the error code contained in the error value @var{err}. This string can be used to output a diagnostic message to the user. + +This function is not thread safe. Use @code{gpgme_strerror_r} in +multi-threaded programs. +@end deftypefun + + +@deftypefun {char *} gpgme_strerror_r (@w{gpgme_error_t @var{err}}) +The function @code{gpgme_strerror_r} returns a pointer to a +dynamically allocated string containing a description of the error +code contained in the error value @var{err}. This string can be used +to output a diagnostic message to the user. When it is not needed +anymore, the user must deallocate it with @code{free}. @end deftypefun diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index bc90ace..0e33c91 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,8 @@ 2003-09-13 Marcus Brinkmann + * gpgme.h (gpgme_strerror_r): New prototype. + * error.c (gpgme_strerror_r): New function. + * get-env.c: New file. * util.h (_gpgme_getenv): Add prototype. * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c. diff --git a/gpgme/error.c b/gpgme/error.c index f3c38b1..aac2c28 100644 --- a/gpgme/error.c +++ b/gpgme/error.c @@ -32,6 +32,17 @@ gpgme_strerror (gpgme_error_t err) } +/* Return a pointer to a string containing a description of the error + code in the error value ERR. The buffer for the string is + allocated with malloc(), and has to be released by the user. On + error, NULL is returned. */ +char * +gpgme_strerror_r (gpgme_error_t err) +{ + return gpg_strerror_r (err); +} + + /* Return a pointer to a string containing a description of the error source in the error value ERR. */ const char * diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h index 2970810..849521f 100644 --- a/gpgme/gpgme.h +++ b/gpgme/gpgme.h @@ -120,9 +120,15 @@ gpgme_err_source (gpgme_error_t err) /* Return a pointer to a string containing a description of the error - code in the error value ERR. */ + code in the error value ERR. This function is not thread safe. */ const char *gpgme_strerror (gpgme_error_t err); +/* Return a pointer to a string containing a description of the error + code in the error value ERR. The buffer for the string is + allocated with malloc(), and has to be released by the user. On + error, NULL is returned. */ +char *gpgme_strerror_r (gpgme_error_t err); + /* Return a pointer to a string containing a description of the error source in the error value ERR. */