Commit | Line | Data |
---|---|---|
8b98d710 WJ |
1 | /* Copyright (C) 1989, 1992 Aladdin Enterprises. All rights reserved. |
2 | Distributed by Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of Ghostscript. | |
5 | ||
6 | Ghostscript is distributed in the hope that it will be useful, but | |
7 | WITHOUT ANY WARRANTY. No author or distributor accepts responsibility | |
8 | to anyone for the consequences of using it or for whether it serves any | |
9 | particular purpose or works at all, unless he says so in writing. Refer | |
10 | to the Ghostscript General Public License for full details. | |
11 | ||
12 | Everyone is granted permission to copy, modify and redistribute | |
13 | Ghostscript, but only under the conditions described in the Ghostscript | |
14 | General Public License. A copy of this license is supposed to have been | |
15 | given to you along with Ghostscript so you can know your rights and | |
16 | responsibilities. It should be in a file named COPYING. Among other | |
17 | things, the copyright notice and this notice must be preserved on all | |
18 | copies. */ | |
19 | ||
20 | /* errors.h */ | |
21 | /* Define error codes for GhostScript */ | |
22 | ||
23 | /* A procedure that may return an error always returns */ | |
24 | /* a non-negative value (zero, unless otherwise noted) for success, */ | |
25 | /* or negative for failure. */ | |
26 | /* We use ints rather than an enum to avoid a lot of casting. */ | |
27 | ||
28 | /* The following peculiar structure allows us to include this file */ | |
29 | /* wherever error code definitions are needed, and use the same file */ | |
30 | /* to generate the table of error names by setting INCLUDE_ERROR_NAMES. */ | |
31 | ||
32 | # ifdef INCLUDE_ERROR_NAMES | |
33 | ||
34 | /* Define the error name table */ | |
35 | const char _ds *gs_error_names[] = { | |
36 | #define _e_(code,name) name, | |
37 | ||
38 | # else /* !INCLUDE_ERROR_NAMES */ | |
39 | ||
40 | extern const char _ds *gs_error_names[]; | |
41 | # define _e_(code,name) | |
42 | ||
43 | #endif /* (!)INCLUDE_ERROR_NAMES */ | |
44 | ||
45 | /* ------ PostScript Level 1 errors ------ */ | |
46 | ||
47 | #define e_unknownerror (-1) /* unknown error */ | |
48 | _e_(e_unknown, "unknownerror") | |
49 | #define e_dictfull (-2) | |
50 | _e_(e_dictfull, "dictfull") | |
51 | #define e_dictstackoverflow (-3) | |
52 | _e_(e_dictstackoverflow, "dictstackoverflow") | |
53 | #define e_dictstackunderflow (-4) | |
54 | _e_(e_dictstackunderflow, "dictstackunderflow") | |
55 | #define e_execstackoverflow (-5) | |
56 | _e_(e_execstackoverflow, "execstackoverflow") | |
57 | #define e_interrupt (-6) | |
58 | _e_(e_interrupt, "interrupt") | |
59 | #define e_invalidaccess (-7) | |
60 | _e_(e_invalidaccess, "invalidaccess") | |
61 | #define e_invalidexit (-8) | |
62 | _e_(e_invalidexit, "invalidexit") | |
63 | #define e_invalidfileaccess (-9) | |
64 | _e_(e_invalidfileaccess, "invalidfileaccess") | |
65 | #define e_invalidfont (-10) | |
66 | _e_(e_invalidfont, "invalidfont") | |
67 | #define e_invalidrestore (-11) | |
68 | _e_(e_invalidrestore, "invalidrestore") | |
69 | #define e_ioerror (-12) | |
70 | _e_(e_ioerror, "ioerror") | |
71 | #define e_limitcheck (-13) | |
72 | _e_(e_limitcheck, "limitcheck") | |
73 | #define e_nocurrentpoint (-14) | |
74 | _e_(e_nocurrentpoint, "nocurrentpoint") | |
75 | #define e_rangecheck (-15) | |
76 | _e_(e_rangecheck, "rangecheck") | |
77 | #define e_stackoverflow (-16) | |
78 | _e_(e_stackoverflow, "stackoverflow") | |
79 | #define e_stackunderflow (-17) | |
80 | _e_(e_stackunderflow, "stackunderflow") | |
81 | #define e_syntaxerror (-18) | |
82 | _e_(e_syntaxerror, "syntaxerror") | |
83 | #define e_timeout (-19) | |
84 | _e_(e_timeout, "timeout") | |
85 | #define e_typecheck (-20) | |
86 | _e_(e_typecheck, "typecheck") | |
87 | #define e_undefined (-21) | |
88 | _e_(e_undefined, "undefined") | |
89 | #define e_undefinedfilename (-22) | |
90 | _e_(e_undefinedfilename, "undefinedfilename") | |
91 | #define e_undefinedresult (-23) | |
92 | _e_(e_undefinedresult, "undefinedresult") | |
93 | #define e_unmatchedmark (-24) | |
94 | _e_(e_unmatchedmark, "unmatchedmark") | |
95 | #define e_VMerror (-25) | |
96 | _e_(e_VMerror, "VMerror") | |
97 | ||
98 | /* ------ Additional Level 2 and DPS errors ------ */ | |
99 | ||
100 | #define e_invalidcontext (-26) | |
101 | _e_(e_invalidcontext, "invalidcontext") | |
102 | #define e_undefinedresource (-27) /* not used yet */ | |
103 | _e_(e_undefinedresource, "undefinedresource") | |
104 | ||
105 | # ifdef INCLUDE_ERROR_NAMES | |
106 | ||
107 | /* End of error name table */ | |
108 | 0 | |
109 | }; | |
110 | ||
111 | # endif /* INCLUDE_ERROR_NAMES */ |