42842afe79f039e6488cf378e24494f80b8c66b4
[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   GNUPG_Line_Too_Long = 48,
78   GNUPG_Not_Trusted = 49,
79   GNUPG_Canceled = 50,
80   GNUPG_Bad_CA_Certificate = 51,
81   GNUPG_Certificate_Expired = 52,
82   GNUPG_Certificate_Too_Young = 53,
83   GNUPG_Unsupported_Certificate = 54,
84   GNUPG_Unknown_Sexp = 55,
85   GNUPG_Unsupported_Protection = 56,
86   GNUPG_Corrupted_Protection = 57,
87   GNUPG_Ambiguous_Name = 58,
88   GNUPG_Card_Error = 59,
89   GNUPG_Card_Reset = 60,
90   GNUPG_Card_Removed = 61,
91   GNUPG_Invalid_Card = 62,
92   GNUPG_Card_Not_Present = 63,
93   GNUPG_No_PKCS15_App = 64,
94   GNUPG_Not_Confirmed = 65,
95   GNUPG_Configuration_Error = 66,
96   GNUPG_No_Policy_Match = 67,
97 };
98
99 /* Status codes - fixme: should go into another file */
100 enum {
101   STATUS_ENTER,
102   STATUS_LEAVE,
103   STATUS_ABORT,
104   STATUS_GOODSIG,
105   STATUS_BADSIG,
106   STATUS_ERRSIG,
107   STATUS_BADARMOR,
108   STATUS_RSA_OR_IDEA,
109   STATUS_SIGEXPIRED,
110   STATUS_KEYREVOKED,
111   STATUS_TRUST_UNDEFINED,
112   STATUS_TRUST_NEVER,
113   STATUS_TRUST_MARGINAL,
114   STATUS_TRUST_FULLY,
115   STATUS_TRUST_ULTIMATE,
116   
117   STATUS_SHM_INFO,
118   STATUS_SHM_GET,
119   STATUS_SHM_GET_BOOL,
120   STATUS_SHM_GET_HIDDEN,
121   
122   STATUS_NEED_PASSPHRASE,
123   STATUS_VALIDSIG,
124   STATUS_SIG_ID,
125   STATUS_ENC_TO,
126   STATUS_NODATA,
127   STATUS_BAD_PASSPHRASE,
128   STATUS_NO_PUBKEY,
129   STATUS_NO_SECKEY,
130   STATUS_NEED_PASSPHRASE_SYM,
131   STATUS_DECRYPTION_FAILED,
132   STATUS_DECRYPTION_OKAY,
133   STATUS_MISSING_PASSPHRASE,
134   STATUS_GOOD_PASSPHRASE,
135   STATUS_GOODMDC,
136   STATUS_BADMDC,
137   STATUS_ERRMDC,
138   STATUS_IMPORTED,
139   STATUS_IMPORT_RES,
140   STATUS_FILE_START,
141   STATUS_FILE_DONE,
142   STATUS_FILE_ERROR,
143   
144   STATUS_BEGIN_DECRYPTION,
145   STATUS_END_DECRYPTION,
146   STATUS_BEGIN_ENCRYPTION,
147   STATUS_END_ENCRYPTION,
148   
149   STATUS_DELETE_PROBLEM,
150   STATUS_GET_BOOL,
151   STATUS_GET_LINE,
152   STATUS_GET_HIDDEN,
153   STATUS_GOT_IT,
154   STATUS_PROGRESS,
155   STATUS_SIG_CREATED,
156   STATUS_SESSION_KEY,
157   STATUS_NOTATION_NAME,
158   STATUS_NOTATION_DATA,
159   STATUS_POLICY_URL,
160   STATUS_BEGIN_STREAM,
161   STATUS_END_STREAM,
162   STATUS_KEY_CREATED,
163   STATUS_USERID_HIN,
164   STATUS_UNEXPECTED,
165   STATUS_INV_RECP,
166   STATUS_NO_RECP,
167   STATUS_ALREADY_SIGNED,
168 };
169
170
171 /*-- errors.c (built) --*/
172 const char *gnupg_strerror (int err);
173
174
175 #endif /*GNUPG_COMMON_ERRORS_H*/