3 * Key management error codes
5 * (c) 2004 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of Catacomb.
12 * Catacomb is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Library General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * Catacomb is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with Catacomb; if not, write to the Free
24 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
28 #ifndef CATACOMB_KEY_ERROR_H
29 #define CATACOMB_KEY_ERROR_H
35 /*----- Error codes -------------------------------------------------------*/
37 #define KEY_ERRORS(_) \
38 _(OK, 0, "No error") \
39 _(BADTAG, -1, "Bad tag string") \
40 _(BADTYPE, -2, "Bad type string") \
41 _(BADCOMMENT, -3, "Bad comment string") \
42 _(DUPID, -4, "Key id already exists") \
43 _(DUPTAG, -5, "Key tag already exists") \
44 _(READONLY, -6, "Key file is read-only") \
45 _(WILLEXPIRE, -7, "Key will eventually expire") \
46 _(EXPIRED, -8, "Key has expired") \
47 _(BADFLAGS, -9, "Bad key flags string") \
48 _(BADPASS, -10, "Failed to unlock key") \
49 _(WRONGTYPE, -11, "Unexpected key encoding type") \
50 _(NOTFOUND, -12, "Key not found") \
51 _(BADATTR, -13, "Bad attribute name") \
52 _(MALFORMED, -14, "Malformed key data") \
53 _(IO, -15, "I/O error") \
56 #define ENTRY(tag, num, str) KERR_##tag = num,
62 /*----- Functions provided ------------------------------------------------*/
64 /* --- @key_strerror@ --- *
66 * Arguments: @int err@ = error code from @key_new@
68 * Returns: Pointer to error string.
70 * Use: Translates a @KERR@ error code into a human-readable string.
73 extern const char *key_strerror(int /*err*/);
75 /*----- That's all, folks -------------------------------------------------*/