aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2010-08-18 14:14:27 +0000
committerMarcus Brinkmann <[email protected]>2010-08-18 14:14:27 +0000
commit15a3f59481e6b134e80cbb9e88fffa0c9f67c8b4 (patch)
treec21242c4088d8cbcfa5024df49ed95be7c2bf0e5 /src/error.c
parentAre you ready already? (diff)
downloadgpgme-15a3f59481e6b134e80cbb9e88fffa0c9f67c8b4.tar.gz
gpgme-15a3f59481e6b134e80cbb9e88fffa0c9f67c8b4.zip
2010-08-18 Marcus Brinkmann <[email protected]>
* gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno. * libgpgme.vers: Likewise. * gpgme.h.in (gpgme_error_from_errno): Fix return type to gpgme_error_t. (gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype. (gpgme_error_from_syserror): New inline function (why are gpgme_err_make_from_errno and gpgme_error_from_errno not inline functions?). * error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t. (gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/error.c b/src/error.c
index 6f37ef7d..f970e682 100644
--- a/src/error.c
+++ b/src/error.c
@@ -74,6 +74,25 @@ gpgme_err_code_to_errno (gpgme_err_code_t code)
return gpg_err_code_from_errno (code);
}
+
+/* Retrieve the error code directly from the ERRNO variable. This
+ returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
+ (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
+gpgme_err_code_t
+gpgme_err_code_from_syserror (void)
+{
+ return gpg_err_code_from_syserror ();
+}
+
+
+/* Set the ERRNO variable. This function is the preferred way to set
+ ERRNO due to peculiarities on WindowsCE. */
+void
+gpgme_err_set_errno (int err)
+{
+ gpg_err_set_errno (err);
+}
+
/* Return an error value with the error source SOURCE and the system
error ERR. */
@@ -85,7 +104,7 @@ gpgme_err_make_from_errno (gpg_err_source_t source, int err)
/* Return an error value with the system error ERR. */
-gpgme_err_code_t
+gpgme_error_t
gpgme_error_from_errno (int err)
{
return gpgme_error (gpg_err_code_from_errno (err));