summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <mb@g10code.com>2003-06-04 02:07:59 +0000
committerMarcus Brinkmann <mb@g10code.com>2003-06-04 02:07:59 +0000
commitcb2cbf10386bd8c5418eeda06b0f5ff15aa7bac5 (patch)
treef72f9534371d8fa8c0c37a8827348e2e869d13e2
parent1695532847be035dd679068eff654acdd9038e25 (diff)
downloadlibgpg-error-cb2cbf10386bd8c5418eeda06b0f5ff15aa7bac5.tar.gz
2003-06-04 Marcus Brinkmann <marcus@g10code.de>
* src/gpg-error.h (gpg_err_code_t): Add GPG_ERR_INV_ENGINE, GPG_ERR_PUBKEY_NOT_TRUSTED, GPG_ERR_DECRYPT_FAILED, GPG_ERR_KEY_EXPIRED. (gpg_make_error): Rename to gpg_err_make. (gpg_error): Use here. * tests/t-strerror.c (main): And here. (gpg_make_error_from_errno): Rename to gpg_err_make_from_errno.
-rw-r--r--ChangeLog8
-rw-r--r--src/err-codes.h.in4
-rw-r--r--src/gpg-error.h11
-rw-r--r--tests/t-strerror.c5
4 files changed, 22 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 0015614..1d144e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2003-06-04 Marcus Brinkmann <marcus@g10code.de>
+ * src/gpg-error.h (gpg_err_code_t): Add GPG_ERR_INV_ENGINE,
+ GPG_ERR_PUBKEY_NOT_TRUSTED, GPG_ERR_DECRYPT_FAILED,
+ GPG_ERR_KEY_EXPIRED.
+ (gpg_make_error): Rename to gpg_err_make.
+ (gpg_error): Use here.
+ * tests/t-strerror.c (main): And here.
+ (gpg_make_error_from_errno): Rename to gpg_err_make_from_errno.
+
* src/gpg-error.h (gpg_make_error_from_errno): New inline function.
(gpg_error_from_errno): Likewise.
diff --git a/src/err-codes.h.in b/src/err-codes.h.in
index 6b67dbe..1243828 100644
--- a/src/err-codes.h.in
+++ b/src/err-codes.h.in
@@ -140,6 +140,10 @@
123 Card not initialized
124 Unsupported operation
125 Wrong key usage
+150 Invalid crypto engine
+151 Public key not trusted
+152 Decryption failed
+153 Key expired
201 Invalid length specifier in S-expression
202 String too long in S-expression
203 Unmatched parentheses in S-expression
diff --git a/src/gpg-error.h b/src/gpg-error.h
index e69399a..2d126c8 100644
--- a/src/gpg-error.h
+++ b/src/gpg-error.h
@@ -203,6 +203,11 @@ typedef enum
GPG_ERR_UNSUPPORTED_OPERATION = 124,
GPG_ERR_WRONG_KEY_USAGE = 125,
+ GPG_ERR_INV_ENGINE = 150,
+ GPG_ERR_PUBKEY_NOT_TRUSTED = 151,
+ GPG_ERR_DECRYPT_FAILED = 152,
+ GPG_ERR_KEY_EXPIRED = 153,
+
/* Error codes pertaining to S-expressions. */
GPG_ERR_SEXP_INV_LEN_SPEC = 201,
GPG_ERR_SEXP_STRING_TOO_LONG = 202,
@@ -412,7 +417,7 @@ typedef unsigned int gpg_error_t;
/* Construct an error value from an error code and source. Within a
subsystem, use gpg_error. */
static __inline__ gpg_error_t
-gpg_make_error (gpg_err_source_t source, gpg_err_code_t code)
+gpg_err_make (gpg_err_source_t source, gpg_err_code_t code)
{
return code == GPG_ERR_NO_ERROR ? GPG_ERR_NO_ERROR
: (((source & GPG_ERR_SOURCE_MASK) << GPG_ERR_SOURCE_SHIFT)
@@ -429,7 +434,7 @@ gpg_make_error (gpg_err_source_t source, gpg_err_code_t code)
static __inline__ gpg_error_t
gpg_error (gpg_err_code_t code)
{
- return gpg_make_error (GPG_ERR_SOURCE_DEFAULT, code);
+ return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, code);
}
@@ -475,7 +480,7 @@ int gpg_err_code_to_errno (gpg_err_code_t code);
/* Self-documenting convenience functions. */
static __inline__ gpg_error_t
-gpg_make_error_from_errno (gpg_err_source_t source, int err)
+gpg_err_make_from_errno (gpg_err_source_t source, int err)
{
return gpg_make_error (source, gpg_err_code_from_errno (err));
}
diff --git a/tests/t-strerror.c b/tests/t-strerror.c
index 6e3aeba..e02b302 100644
--- a/tests/t-strerror.c
+++ b/tests/t-strerror.c
@@ -37,8 +37,7 @@ main (int argc, char *argv[])
int i = 1;
while (i + 1 < argc)
{
- gpg_error_t err = gpg_make_error (atoi (argv[i]),
- atoi (argv[i + 1]));
+ gpg_error_t err = gpg_err_make (atoi (argv[i]), atoi (argv[i + 1]));
printf ("%s: %s\n", gpg_strsource (err), gpg_strerror (err));
i += 2;
}
@@ -55,7 +54,7 @@ main (int argc, char *argv[])
while (i < sizeof (list) / sizeof (list[0]))
{
- gpg_error_t err = gpg_make_error (list[i].src, list[i].code);
+ gpg_error_t err = gpg_err_make (list[i].src, list[i].code);
printf ("%s: %s\n", gpg_strsource (err), gpg_strerror (err));
i++;
}