| 1 |
/* do not edit automatically generated by mc from mcError. */ |
| 2 |
/* mcError.def provides an interface between the string handling modules. |
| 3 |
|
| 4 |
Copyright (C) 2015-2025 Free Software Foundation, Inc. |
| 5 |
Contributed by Gaius Mulley <[email protected]>. |
| 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 |
#include <stdbool.h> |
| 33 |
# if !defined (PROC_D) |
| 34 |
# define PROC_D |
| 35 |
typedef void (*PROC_t) (void); |
| 36 |
typedef struct { PROC_t proc; } PROC; |
| 37 |
# endif |
| 38 |
|
| 39 |
# include "GSYSTEM.h" |
| 40 |
# include "GDynamicStrings.h" |
| 41 |
|
| 42 |
# if defined (_mcError_C) |
| 43 |
# define EXTERN |
| 44 |
# else |
| 45 |
# define EXTERN extern |
| 46 |
# endif |
| 47 |
|
| 48 |
#if !defined (mcError_error_D) |
| 49 |
# define mcError_error_D |
| 50 |
typedef void *mcError_error; |
| 51 |
#endif |
| 52 |
|
| 53 |
|
| 54 |
/* |
| 55 |
internalError - displays an internal error message together with the compiler source |
| 56 |
file and line number. |
| 57 |
This function is not buffered and is used when the compiler is about |
| 58 |
to give up. |
| 59 |
*/ |
| 60 |
|
| 61 |
EXTERN void mcError_internalError (const char *a_, unsigned int _a_high, const char *file_, unsigned int _file_high, unsigned int line); |
| 62 |
|
| 63 |
/* |
| 64 |
writeFormat0 - displays the source module and line together |
| 65 |
with the encapsulated format string. |
| 66 |
Used for simple error messages tied to the current token. |
| 67 |
*/ |
| 68 |
|
| 69 |
EXTERN void mcError_writeFormat0 (const char *a_, unsigned int _a_high); |
| 70 |
|
| 71 |
/* |
| 72 |
writeFormat1 - displays the source module and line together |
| 73 |
with the encapsulated format string. |
| 74 |
Used for simple error messages tied to the current token. |
| 75 |
*/ |
| 76 |
|
| 77 |
EXTERN void mcError_writeFormat1 (const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high); |
| 78 |
|
| 79 |
/* |
| 80 |
writeFormat2 - displays the module and line together with the encapsulated |
| 81 |
format strings. |
| 82 |
Used for simple error messages tied to the current token. |
| 83 |
*/ |
| 84 |
|
| 85 |
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); |
| 86 |
|
| 87 |
/* |
| 88 |
writeFormat3 - displays the module and line together with the encapsulated |
| 89 |
format strings. |
| 90 |
Used for simple error messages tied to the current token. |
| 91 |
*/ |
| 92 |
|
| 93 |
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); |
| 94 |
|
| 95 |
/* |
| 96 |
newError - creates and returns a new error handle. |
| 97 |
*/ |
| 98 |
|
| 99 |
EXTERN mcError_error mcError_newError (unsigned int atTokenNo); |
| 100 |
|
| 101 |
/* |
| 102 |
newWarning - creates and returns a new error handle suitable for a warning. |
| 103 |
A warning will not stop compilation. |
| 104 |
*/ |
| 105 |
|
| 106 |
EXTERN mcError_error mcError_newWarning (unsigned int atTokenNo); |
| 107 |
|
| 108 |
/* |
| 109 |
chainError - creates and returns a new error handle, this new error |
| 110 |
is associated with, e, and is chained onto the end of, e. |
| 111 |
*/ |
| 112 |
|
| 113 |
EXTERN mcError_error mcError_chainError (unsigned int atTokenNo, mcError_error e); |
| 114 |
EXTERN void mcError_errorFormat0 (mcError_error e, const char *a_, unsigned int _a_high); |
| 115 |
EXTERN void mcError_errorFormat1 (mcError_error e, const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high); |
| 116 |
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); |
| 117 |
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); |
| 118 |
EXTERN void mcError_errorString (mcError_error e, DynamicStrings_String str); |
| 119 |
EXTERN void mcError_errorStringAt (DynamicStrings_String s, unsigned int tok); |
| 120 |
EXTERN void mcError_errorStringAt2 (DynamicStrings_String s, unsigned int tok1, unsigned int tok2); |
| 121 |
EXTERN void mcError_errorStringsAt2 (DynamicStrings_String s1, DynamicStrings_String s2, unsigned int tok1, unsigned int tok2); |
| 122 |
EXTERN void mcError_warnStringAt (DynamicStrings_String s, unsigned int tok); |
| 123 |
EXTERN void mcError_warnStringAt2 (DynamicStrings_String s, unsigned int tok1, unsigned int tok2); |
| 124 |
EXTERN void mcError_warnStringsAt2 (DynamicStrings_String s1, DynamicStrings_String s2, unsigned int tok1, unsigned int tok2); |
| 125 |
|
| 126 |
/* |
| 127 |
warnFormat0 - displays the source module and line together |
| 128 |
with the encapsulated format string. |
| 129 |
Used for simple warning messages tied to the current token. |
| 130 |
*/ |
| 131 |
|
| 132 |
EXTERN void mcError_warnFormat0 (const char *a_, unsigned int _a_high); |
| 133 |
|
| 134 |
/* |
| 135 |
warnFormat1 - displays the source module and line together |
| 136 |
with the encapsulated format string. |
| 137 |
Used for simple warning messages tied to the current token. |
| 138 |
*/ |
| 139 |
|
| 140 |
EXTERN void mcError_warnFormat1 (const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high); |
| 141 |
|
| 142 |
/* |
| 143 |
flushErrors - switches the output channel to the error channel |
| 144 |
and then writes out all errors. |
| 145 |
If an error is present the compilation is terminated. |
| 146 |
All warnings are ignored. |
| 147 |
*/ |
| 148 |
|
| 149 |
EXTERN void mcError_flushErrors (void); |
| 150 |
|
| 151 |
/* |
| 152 |
flushWarnings - switches the output channel to the error channel |
| 153 |
and then writes out all warnings. |
| 154 |
If an error is present the compilation is terminated, |
| 155 |
if warnings only were emitted then compilation will |
| 156 |
continue. |
| 157 |
*/ |
| 158 |
|
| 159 |
EXTERN void mcError_flushWarnings (void); |
| 160 |
|
| 161 |
/* |
| 162 |
errorAbort0 - aborts compiling, it flushes all warnings and errors before aborting. |
| 163 |
*/ |
| 164 |
|
| 165 |
EXTERN void mcError_errorAbort0 (const char *a_, unsigned int _a_high); |
| 166 |
# ifdef __cplusplus |
| 167 |
} |
| 168 |
# endif |
| 169 |
|
| 170 |
# undef EXTERN |
| 171 |
#endif |