summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-09-14 14:24:34 +0000
committerWerner Koch <wk@gnupg.org>2006-09-14 14:24:34 +0000
commit12172fa6fa5136cfaa8eca23cb83840386a3892f (patch)
tree8261c598e67f51dd708bc9b2a11f56704e2db224 /lang
parent1a01e7ec9f4943367ed27330017f52a1bf2cbaa5 (diff)
downloadlibgpg-error-12172fa6fa5136cfaa8eca23cb83840386a3892f.tar.gz
Ready for a new releaselibgpg-error-1.4
Diffstat (limited to 'lang')
-rw-r--r--lang/cl/gpg-error-package.lisp4
-rw-r--r--lang/cl/gpg-error.lisp15
2 files changed, 18 insertions, 1 deletions
diff --git a/lang/cl/gpg-error-package.lisp b/lang/cl/gpg-error-package.lisp
index 0a39663..73adca0 100644
--- a/lang/cl/gpg-error-package.lisp
+++ b/lang/cl/gpg-error-package.lisp
@@ -58,5 +58,7 @@
:gpg-strsource
:gpg-err-code-from-errno
:gpg-err-code-to-errno
+ :gpg-err-code-from-syserror
:gpg-err-make-from-errno
- :gpg-error-from-errno))
+ :gpg-error-from-errno
+ :gpg-error-from-syserror))
diff --git a/lang/cl/gpg-error.lisp b/lang/cl/gpg-error.lisp
index 68a65e1..3bf4999 100644
--- a/lang/cl/gpg-error.lisp
+++ b/lang/cl/gpg-error.lisp
@@ -109,6 +109,10 @@
(defcfun ("gpg_err_code_to_errno" c-gpg-err-code-to-errno) :int
(code gpg-err-code-t))
+(defcfun ("gpg_err_code_from_syserror"
+ c-gpg-err-code-from-syserror) gpg-err-code-t
+ (void))
+
;;; Self-documenting convenience functions.
;;; See below.
@@ -211,6 +215,13 @@
system error, 0 is returned."
(c-gpg-err-code-to-errno (gpg-err-code code)))
+(defun gpg-err-code-from-syserror ()
+ "Retrieve the error code directly from the system ERRNO. If the system error
+ is not mapped, :gpg-err-unknown-errno is returned and
+ :gpg-err-missing-errno if ERRNO has the value 0."
+ (gpg-err-code-as-key (c-gpg-err-code-from-syserror)))
+
+
;;; Self-documenting convenience functions.
(defun gpg-err-make-from-errno (source err)
@@ -218,3 +229,7 @@
(defun gpg-error-from-errno (err)
(gpg-error (gpg-err-code-from-errno err)))
+
+(defun gpg-error-from-syserror ()
+ (gpg-error (gpg-err-code-from-syserror)))
+