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