* maperror.c (map_assuan_err): Codes for CRL
[gnupg.git] / common / errors.h
1 /* errors.h - Globally used error codes
2  *      Copyright (C) 2001 Free Software Foundation, Inc.
3  *
4  * This file is part of GnuPG.
5  *
6  * GnuPG is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * GnuPG is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19  */
20
21 #ifndef GNUPG_COMMON_ERRORS_H
22 #define GNUPG_COMMON_ERRORS_H
23
24 #include "util.h"
25
26 /* Error numbers */
27 enum {
28   GNUPG_EOF = -1,
29   GNUPG_No_Error = 0,
30   GNUPG_General_Error = 1, 
31   GNUPG_Out_Of_Core = 2,
32   GNUPG_Invalid_Value = 3,
33   GNUPG_IO_Error = 4,
34   GNUPG_Resource_Limit = 5,
35   GNUPG_Internal_Error = 6,
36   GNUPG_Bad_Certificate = 7,
37   GNUPG_Bad_Certificate_Path = 8,
38   GNUPG_Missing_Certificate = 9,
39   GNUPG_No_Data = 10,
40   GNUPG_Bad_Signature = 11,
41   GNUPG_Not_Implemented = 12,
42   GNUPG_Conflict = 13,
43   GNUPG_Bug = 14,
44   GNUPG_Read_Error = 15,
45   GNUPG_Write_Error = 16,
46   GNUPG_Incomplete_Line = 17,
47   GNUPG_Invalid_Response = 18,
48   GNUPG_No_Agent = 19,
49   GNUPG_Agent_Error = 20,
50   GNUPG_No_Public_Key = 21,
51   GNUPG_No_Secret_Key = 22,
52   GNUPG_File_Open_Error = 23,
53   GNUPG_File_Create_Error = 24,
54   GNUPG_File_Error = 25,
55   GNUPG_Not_Supported = 26,
56   GNUPG_Invalid_Data = 27,
57   GNUPG_Assuan_Server_Fault = 28,
58   GNUPG_Assuan_Error = 29, /* catch all assuan error */
59   GNUPG_Invalid_Session_Key = 30,
60   GNUPG_Invalid_Sexp = 31,
61   GNUPG_Unsupported_Algorithm = 32,
62   GNUPG_No_PIN_Entry = 33,
63   GNUPG_PIN_Entry_Error = 34,
64   GNUPG_Bad_PIN = 35,
65   GNUPG_Bad_Passphrase = 36,
66   GNUPG_Invalid_Name = 37,
67   GNUPG_Bad_Public_Key = 38,
68   GNUPG_Bad_Secret_Key = 39,
69   GNUPG_Bad_Data = 40,
70   GNUPG_Invalid_Parameter = 41,
71   GNUPG_Tribute_to_D_A = 42,
72   GNUPG_No_Dirmngr = 43,
73   GNUPG_Dirmngr_Error = 44,
74   GNUPG_Certificate_Revoked = 45,
75   GNUPG_No_CRL_Known = 46,
76   GNUPG_CRL_Too_Old = 47,
77 };
78
79 /* Status codes - fixme: should go into another file */
80 enum {
81   STATUS_ENTER,
82   STATUS_LEAVE,
83   STATUS_ABORT,
84   STATUS_GOODSIG,
85   STATUS_BADSIG,
86   STATUS_ERRSIG,
87   STATUS_BADARMOR,
88   STATUS_RSA_OR_IDEA,
89   STATUS_SIGEXPIRED,
90   STATUS_KEYREVOKED,
91   STATUS_TRUST_UNDEFINED,
92   STATUS_TRUST_NEVER,
93   STATUS_TRUST_MARGINAL,
94   STATUS_TRUST_FULLY,
95   STATUS_TRUST_ULTIMATE,
96   
97   STATUS_SHM_INFO,
98   STATUS_SHM_GET,
99   STATUS_SHM_GET_BOOL,
100   STATUS_SHM_GET_HIDDEN,
101   
102   STATUS_NEED_PASSPHRASE,
103   STATUS_VALIDSIG,
104   STATUS_SIG_ID,
105   STATUS_ENC_TO,
106   STATUS_NODATA,
107   STATUS_BAD_PASSPHRASE,
108   STATUS_NO_PUBKEY,
109   STATUS_NO_SECKEY,
110   STATUS_NEED_PASSPHRASE_SYM,
111   STATUS_DECRYPTION_FAILED,
112   STATUS_DECRYPTION_OKAY,
113   STATUS_MISSING_PASSPHRASE,
114   STATUS_GOOD_PASSPHRASE,
115   STATUS_GOODMDC,
116   STATUS_BADMDC,
117   STATUS_ERRMDC,
118   STATUS_IMPORTED,
119   STATUS_IMPORT_RES,
120   STATUS_FILE_START,
121   STATUS_FILE_DONE,
122   STATUS_FILE_ERROR,
123   
124   STATUS_BEGIN_DECRYPTION,
125   STATUS_END_DECRYPTION,
126   STATUS_BEGIN_ENCRYPTION,
127   STATUS_END_ENCRYPTION,
128   
129   STATUS_DELETE_PROBLEM,
130   STATUS_GET_BOOL,
131   STATUS_GET_LINE,
132   STATUS_GET_HIDDEN,
133   STATUS_GOT_IT,
134   STATUS_PROGRESS,
135   STATUS_SIG_CREATED,
136   STATUS_SESSION_KEY,
137   STATUS_NOTATION_NAME,
138   STATUS_NOTATION_DATA,
139   STATUS_POLICY_URL,
140   STATUS_BEGIN_STREAM,
141   STATUS_END_STREAM,
142   STATUS_KEY_CREATED,
143   STATUS_USERID_HIN,
144   STATUS_UNEXPECTED,
145   STATUS_INV_RECP,
146   STATUS_NO_RECP,
147   STATUS_ALREADY_SIGNED,
148 };
149
150
151 /*-- errors.c (built) --*/
152 const char *gnupg_strerror (int err);
153
154
155 #endif /*GNUPG_COMMON_ERRORS_H*/