diff options
author | Marcus Brinkmann <[email protected]> | 2003-09-30 19:36:20 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2003-09-30 19:36:20 +0000 |
commit | 2f91a2586519c0c01b521f4c10d20d8deb9bff93 (patch) | |
tree | 5174ced2c0da31349e73602fb6d290e0df0f1216 | |
parent | 2003-09-30 Marcus Brinkmann <[email protected]> (diff) | |
download | gpgme-2f91a2586519c0c01b521f4c10d20d8deb9bff93.tar.gz gpgme-2f91a2586519c0c01b521f4c10d20d8deb9bff93.zip |
2003-09-30 Marcus Brinkmann <[email protected]>
* gpgme.h (gpg_strerror_r): Change prototype to match
gpg_strerror_r change.
* error.c (gpg_strerror_r): Likewise, also update implementation.
Diffstat (limited to '')
-rw-r--r-- | gpgme/ChangeLog | 4 | ||||
-rw-r--r-- | gpgme/error.c | 17 | ||||
-rw-r--r-- | gpgme/gpgme.h | 13 |
3 files changed, 22 insertions, 12 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 70f9ec82..93e2e3c2 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,9 @@ 2003-09-30 Marcus Brinkmann <[email protected]> + * gpgme.h (gpg_strerror_r): Change prototype to match + gpg_strerror_r change. + * error.c (gpg_strerror_r): Likewise, also update implementation. + * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440. diff --git a/gpgme/error.c b/gpgme/error.c index aac2c282..b17bb093 100644 --- a/gpgme/error.c +++ b/gpgme/error.c @@ -32,14 +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 the error string for ERR in the user-supplied buffer BUF of + size BUFLEN. This function is, in contrast to gpg_strerror, + thread-safe if a thread-safe strerror_r() function is provided by + the system. If the function succeeds, 0 is returned and BUF + contains the string describing the error. If the buffer was not + large enough, ERANGE is returned and BUF contains as much of the + beginning of the error string as fits into the buffer. */ +int +gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen) { - return gpg_strerror_r (err); + return gpg_strerror_r (err, buf, buflen); } diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h index df9a8e7b..921d57e5 100644 --- a/gpgme/gpgme.h +++ b/gpgme/gpgme.h @@ -131,11 +131,14 @@ gpgme_err_source (gpgme_error_t 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 the error string for ERR in the user-supplied buffer BUF of + size BUFLEN. This function is, in contrast to gpg_strerror, + thread-safe if a thread-safe strerror_r() function is provided by + the system. If the function succeeds, 0 is returned and BUF + contains the string describing the error. If the buffer was not + large enough, ERANGE is returned and BUF contains as much of the + beginning of the error string as fits into the buffer. */ +int gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen); /* Return a pointer to a string containing a description of the error |