2002-02-01 Marcus Brinkmann <marcus@g10code.de>
[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 };
88
89 /* Status codes - fixme: should go into another file */
90 enum {
91   STATUS_ENTER,
92   STATUS_LEAVE,
93   STATUS_ABORT,
94   STATUS_GOODSIG,
95   STATUS_BADSIG,
96   STATUS_ERRSIG,
97   STATUS_BADARMOR,
98   STATUS_RSA_OR_IDEA,
99   STATUS_SIGEXPIRED,
100   STATUS_KEYREVOKED,
101   STATUS_TRUST_UNDEFINED,
102   STATUS_TRUST_NEVER,
103   STATUS_TRUST_MARGINAL,
104   STATUS_TRUST_FULLY,
105   STATUS_TRUST_ULTIMATE,
106   
107   STATUS_SHM_INFO,
108   STATUS_SHM_GET,
109   STATUS_SHM_GET_BOOL,
110   STATUS_SHM_GET_HIDDEN,
111   
112   STATUS_NEED_PASSPHRASE,
113   STATUS_VALIDSIG,
114   STATUS_SIG_ID,
115   STATUS_ENC_TO,
116   STATUS_NODATA,
117   STATUS_BAD_PASSPHRASE,
118   STATUS_NO_PUBKEY,
119   STATUS_NO_SECKEY,
120   STATUS_NEED_PASSPHRASE_SYM,
121   STATUS_DECRYPTION_FAILED,
122   STATUS_DECRYPTION_OKAY,
123   STATUS_MISSING_PASSPHRASE,
124   STATUS_GOOD_PASSPHRASE,
125   STATUS_GOODMDC,
126   STATUS_BADMDC,
127   STATUS_ERRMDC,
128   STATUS_IMPORTED,
129   STATUS_IMPORT_RES,
130   STATUS_FILE_START,
131   STATUS_FILE_DONE,
132   STATUS_FILE_ERROR,
133   
134   STATUS_BEGIN_DECRYPTION,
135   STATUS_END_DECRYPTION,
136   STATUS_BEGIN_ENCRYPTION,
137   STATUS_END_ENCRYPTION,
138   
139   STATUS_DELETE_PROBLEM,
140   STATUS_GET_BOOL,
141   STATUS_GET_LINE,
142   STATUS_GET_HIDDEN,
143   STATUS_GOT_IT,
144   STATUS_PROGRESS,
145   STATUS_SIG_CREATED,
146   STATUS_SESSION_KEY,
147   STATUS_NOTATION_NAME,
148   STATUS_NOTATION_DATA,
149   STATUS_POLICY_URL,
150   STATUS_BEGIN_STREAM,
151   STATUS_END_STREAM,
152   STATUS_KEY_CREATED,
153   STATUS_USERID_HIN,
154   STATUS_UNEXPECTED,
155   STATUS_INV_RECP,
156   STATUS_NO_RECP,
157   STATUS_ALREADY_SIGNED,
158 };
159
160
161 /*-- errors.c (built) --*/
162 const char *gnupg_strerror (int err);
163
164
165 #endif /*GNUPG_COMMON_ERRORS_H*/