]>
Commit | Line | Data |
---|---|---|
1eee94d3 GM |
1 | /* do not edit automatically generated by mc from mcError. */ |
2 | /* mcError.def provides an interface between the string handling modules. | |
3 | ||
83ffe9cd | 4 | Copyright (C) 2015-2023 Free Software Foundation, Inc. |
1eee94d3 GM |
5 | Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>. |
6 | ||
7 | This file is part of GNU Modula-2. | |
8 | ||
9 | GNU Modula-2 is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
11 | the Free Software Foundation; either version 3, or (at your option) | |
12 | any later version. | |
13 | ||
14 | GNU Modula-2 is distributed in the hope that it will be useful, but | |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
20 | along with GNU Modula-2; see the file COPYING3. If not see | |
21 | <http://www.gnu.org/licenses/>. */ | |
22 | ||
23 | ||
24 | #if !defined (_mcError_H) | |
25 | # define _mcError_H | |
26 | ||
27 | #include "config.h" | |
28 | #include "system.h" | |
29 | # ifdef __cplusplus | |
30 | extern "C" { | |
31 | # endif | |
32 | # if !defined (PROC_D) | |
33 | # define PROC_D | |
34 | typedef void (*PROC_t) (void); | |
35 | typedef struct { PROC_t proc; } PROC; | |
36 | # endif | |
37 | ||
38 | # include "GSYSTEM.h" | |
39 | # include "GDynamicStrings.h" | |
40 | ||
41 | # if defined (_mcError_C) | |
42 | # define EXTERN | |
43 | # else | |
44 | # define EXTERN extern | |
45 | # endif | |
46 | ||
47 | #if !defined (mcError_error_D) | |
48 | # define mcError_error_D | |
49 | typedef void *mcError_error; | |
50 | #endif | |
51 | ||
52 | ||
53 | /* | |
54 | internalError - displays an internal error message together with the compiler source | |
55 | file and line number. | |
56 | This function is not buffered and is used when the compiler is about | |
57 | to give up. | |
58 | */ | |
59 | ||
60 | EXTERN void mcError_internalError (const char *a_, unsigned int _a_high, const char *file_, unsigned int _file_high, unsigned int line); | |
61 | ||
62 | /* | |
63 | writeFormat0 - displays the source module and line together | |
64 | with the encapsulated format string. | |
65 | Used for simple error messages tied to the current token. | |
66 | */ | |
67 | ||
68 | EXTERN void mcError_writeFormat0 (const char *a_, unsigned int _a_high); | |
69 | ||
70 | /* | |
71 | writeFormat1 - displays the source module and line together | |
72 | with the encapsulated format string. | |
73 | Used for simple error messages tied to the current token. | |
74 | */ | |
75 | ||
76 | EXTERN void mcError_writeFormat1 (const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high); | |
77 | ||
78 | /* | |
79 | writeFormat2 - displays the module and line together with the encapsulated | |
80 | format strings. | |
81 | Used for simple error messages tied to the current token. | |
82 | */ | |
83 | ||
84 | EXTERN void mcError_writeFormat2 (const char *a_, unsigned int _a_high, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high); | |
85 | ||
86 | /* | |
87 | writeFormat3 - displays the module and line together with the encapsulated | |
88 | format strings. | |
89 | Used for simple error messages tied to the current token. | |
90 | */ | |
91 | ||
92 | EXTERN void mcError_writeFormat3 (const char *a_, unsigned int _a_high, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high, const unsigned char *w3_, unsigned int _w3_high); | |
93 | ||
94 | /* | |
95 | newError - creates and returns a new error handle. | |
96 | */ | |
97 | ||
98 | EXTERN mcError_error mcError_newError (unsigned int atTokenNo); | |
99 | ||
100 | /* | |
101 | newWarning - creates and returns a new error handle suitable for a warning. | |
102 | A warning will not stop compilation. | |
103 | */ | |
104 | ||
105 | EXTERN mcError_error mcError_newWarning (unsigned int atTokenNo); | |
106 | ||
107 | /* | |
108 | chainError - creates and returns a new error handle, this new error | |
109 | is associated with, e, and is chained onto the end of, e. | |
110 | */ | |
111 | ||
112 | EXTERN mcError_error mcError_chainError (unsigned int atTokenNo, mcError_error e); | |
113 | EXTERN void mcError_errorFormat0 (mcError_error e, const char *a_, unsigned int _a_high); | |
114 | EXTERN void mcError_errorFormat1 (mcError_error e, const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high); | |
115 | EXTERN void mcError_errorFormat2 (mcError_error e, const char *a_, unsigned int _a_high, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high); | |
116 | EXTERN void mcError_errorFormat3 (mcError_error e, const char *a_, unsigned int _a_high, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high, const unsigned char *w3_, unsigned int _w3_high); | |
117 | EXTERN void mcError_errorString (mcError_error e, DynamicStrings_String str); | |
118 | EXTERN void mcError_errorStringAt (DynamicStrings_String s, unsigned int tok); | |
119 | EXTERN void mcError_errorStringAt2 (DynamicStrings_String s, unsigned int tok1, unsigned int tok2); | |
120 | EXTERN void mcError_errorStringsAt2 (DynamicStrings_String s1, DynamicStrings_String s2, unsigned int tok1, unsigned int tok2); | |
121 | EXTERN void mcError_warnStringAt (DynamicStrings_String s, unsigned int tok); | |
122 | EXTERN void mcError_warnStringAt2 (DynamicStrings_String s, unsigned int tok1, unsigned int tok2); | |
123 | EXTERN void mcError_warnStringsAt2 (DynamicStrings_String s1, DynamicStrings_String s2, unsigned int tok1, unsigned int tok2); | |
124 | ||
125 | /* | |
126 | warnFormat0 - displays the source module and line together | |
127 | with the encapsulated format string. | |
128 | Used for simple warning messages tied to the current token. | |
129 | */ | |
130 | ||
131 | EXTERN void mcError_warnFormat0 (const char *a_, unsigned int _a_high); | |
132 | ||
133 | /* | |
134 | warnFormat1 - displays the source module and line together | |
135 | with the encapsulated format string. | |
136 | Used for simple warning messages tied to the current token. | |
137 | */ | |
138 | ||
139 | EXTERN void mcError_warnFormat1 (const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high); | |
140 | ||
141 | /* | |
142 | flushErrors - switches the output channel to the error channel | |
143 | and then writes out all errors. | |
144 | If an error is present the compilation is terminated. | |
145 | All warnings are ignored. | |
146 | */ | |
147 | ||
148 | EXTERN void mcError_flushErrors (void); | |
149 | ||
150 | /* | |
151 | flushWarnings - switches the output channel to the error channel | |
152 | and then writes out all warnings. | |
153 | If an error is present the compilation is terminated, | |
154 | if warnings only were emitted then compilation will | |
155 | continue. | |
156 | */ | |
157 | ||
158 | EXTERN void mcError_flushWarnings (void); | |
159 | ||
160 | /* | |
161 | errorAbort0 - aborts compiling, it flushes all warnings and errors before aborting. | |
162 | */ | |
163 | ||
164 | EXTERN void mcError_errorAbort0 (const char *a_, unsigned int _a_high); | |
165 | # ifdef __cplusplus | |
166 | } | |
167 | # endif | |
168 | ||
169 | # undef EXTERN | |
170 | #endif |