1: /*
2: * $Id: merr.h,v 1.3 2025/03/09 19:50:47 snw Exp $
3: * freem error codes
4: *
5: *
6: * Author: Serena Willis <snw@coherent-logic.com>
7: * Copyright (C) 1998 MUG Deutschland
8: * Copyright (C) 2020, 2025 Coherent Logic Development LLC
9: *
10: *
11: * This file is part of FreeM.
12: *
13: * FreeM is free software: you can redistribute it and/or modify
14: * it under the terms of the GNU Affero Public License as published by
15: * the Free Software Foundation, either version 3 of the License, or
16: * (at your option) any later version.
17: *
18: * FreeM is distributed in the hope that it will be useful,
19: * but WITHOUT ANY WARRANTY; without even the implied warranty of
20: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: * GNU Affero Public License for more details.
22: *
23: * You should have received a copy of the GNU Affero Public License
24: * along with FreeM. If not, see <https://www.gnu.org/licenses/>.
25: *
26: * $Log: merr.h,v $
27: * Revision 1.3 2025/03/09 19:50:47 snw
28: * Second phase of REUSE compliance and header reformat
29: *
30: *
31: * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
32: * SPDX-License-Identifier: AGPL-3.0-or-later
33: **/
34:
35: #ifndef _MERR_H
36: # define _MERR_H
37:
38: /* error codes */
39: #define OK 0
40: #define INRPT 1
41: #define BKERR 2
42: #define NOSTAND 3
43: #define UNDEF 4
44: #define LBLUNDEF 5
45: #define MISSOPD 6
46: #define MISSOP 7
47: #define ILLOP 8
48: #define QUOTER 9
49: #define COMMAER 10
50: #define ASSIGNER 11
51: #define ARGER 12
52: #define SPACER 13
53: #define BRAER 14
54: #define LVLERR 15
55: #define DIVER 16
56: #define ILLFUN 17
57: #define FUNARG 18
58: #define ZTERR 19
59: #define NEXTER 20
60: #define SELER 21
61: #define CMMND 22
62: #define ARGLIST 23
63: #define INVEXPR 24
64: #define INVREF 25
65: #define MXSTR 26
66: #define TOOPARA 27
67: #define NOPEN 28
68: #define NODEVICE 29
69: #define PROTECT 30
70: #define GLOBER 31
71: #define FILERR 32
72: #define PGMOV 33
73: #define STKOV 34
74: #define STORE 35
75: #define NOREAD 36
76: #define NOWRITE 37
77: #define NOPGM 38
78: #define NAKED 39
79: #define SBSCR 40
80: #define ISYNTX 41
81: #define DBDGD 42
82: #define KILLER 43
83: #define HUPER 44
84: #define MXNUM 45
85: #define NOVAL 46
86: #define TYPEMISMATCH 47
87: #define MEMOV 48
88:
89: /* socket errors */
90: #define NAMERES 49
91: #define SCKCREAT 50
92: #define SCKIFAM 51
93: #define SCKITYP 52
94: #define SCKIPRT 53
95: #define SCKCERR 54
96: #define SCKAERR 55
97: #define SCKACON 56
98: #define SCKNCON 57
99: #define SCKEOPT 58
100: #define SCKERCV 59
101: #define SCKESND 60
102: #define NORPI 61
103: #define CREDEF 62
104: #define CMODIFY 63
105: #define FILEXWR 64
106: #define INEWMUL 65
107: #define ZINVHORO 66
108: #define TYPMISMATCH 67
109: #define INVTYPE 68
110: #define INVLIBOPT 69
111: #define ECODEINV 80
112: #define ASSERT 81
113: #define USERERR 82
114:
115: /* OO errors */
116: #define OBJFLDACCV 83
117: #define OBJCONFLICT 84
118: #define OBJPRIVOVFL 85
119: #define OBJACINVALID 86
120:
121: /* catch-all for otherwise-unspecified syntax errors */
122: #define SYNTERR 128
123:
124: /* ANSI X11.1 errors */
125: #define M1 140
126: #define M2 141
127: #define M3 142
128: #define M4 143
129: #define M5 144
130: #define M6 145
131: #define M7 146
132: #define M8 147
133: #define M9 148
134: #define M10 149
135: #define M11 150
136: #define M12 151
137: #define M13 152
138: #define M14 153
139: #define M15 154
140: #define M16 155
141: #define M17 156
142: #define M18 157
143: #define M19 158
144: #define M20 159
145: #define M21 160
146: #define M22 161
147: #define M23 162
148: #define M24 163
149: #define M25 164
150: #define M26 165
151: #define M27 166
152: #define M28 167
153: #define M29 168
154: #define M30 169
155: #define M31 170
156: #define M32 171
157: #define M33 172
158: #define M34 173
159: #define M35 174
160: #define M36 175
161: #define M37 176
162: #define M38 177
163: #define M39 178
164: #define M40 179
165: #define M41 180
166: #define M42 181
167: #define M43 182
168: #define M44 183
169: #define M45 184
170: #define M46 185
171: #define M47 186
172: #define M48 187
173: #define M49 188
174: #define M50 189
175: #define M51 190
176: #define M52 191
177: #define M53 192
178: #define M54 193
179: #define M55 194
180: #define M56 195
181: #define M57 196
182: #define M58 197
183: #define M59 198
184: #define M60 199
185: #define M75 214
186: #define M101 240
187: #define M102 241
188: #define M103 242
189: #define M104 243
190:
191: /* pseudo-errors (never reported) */
192: #define ASYNC 254
193: #define CTRLB 255
194:
195: /* MAXERR = maximum error number plus one */
196: #define MAXERR CTRLB + 1
197: #define MAXVNDERR 49
198:
199: #define MDCERRDIFF 0 /*91*/
200: #define ECODEOFFSET 139
201: #define MDCFIRSTERR 140
202:
203: #define NESTLEVLS 80
204:
205: extern int merr_raise(int num);
206: extern int merr(void);
207: extern short merr_in_break(void);
208: extern void merr_set_break(void);
209: extern void merr_clear_break(void);
210: extern int merr_num_to_code (int num, char *code);
211: extern int merr_code_to_num (char *code);
212: extern void merr_set_ecode_ierr (void);
213: extern int merr_set_ecode (char *t_code);
214: extern void merr_dump (int num, char *rtn, char *nsn, char *tcod, int tpos);
215: extern void merr_set_iochan_err(int channel, short frm_err, char *err_text);
216: extern void merr_clear_iochan_err(int channel);
217:
218: typedef struct merr_stackent {
219: char ECODE[256];
220: char MCODE[256];
221: char PLACE[256];
222: } merr_stackent;
223:
224: extern merr_stackent merr_stack[];
225: extern char etrap[];
226: extern char ecode[];
227: extern char user_ecode[];
228: extern int estack;
229: extern int etrap_lvl;
230: extern int merr_topstk;
231:
232: #define ERRCHK() if (merr () != OK) goto err
233: #define merr_clear() merr_raise (OK)
234:
235: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>