xref: /openbsd/gnu/usr.bin/gcc/gcc/f/bad.h (revision c87b03e5)
1 /* bad.h -- Public #include File (module.h template V1.0)
2    Copyright (C) 1995, 2002 Free Software Foundation, Inc.
3    Contributed by James Craig Burley.
4 
5 This file is part of GNU Fortran.
6 
7 GNU Fortran is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11 
12 GNU Fortran is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with GNU Fortran; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
21 
22    Owning Modules:
23       bad.c
24 
25    Modifications:
26 */
27 
28 /* Allow multiple inclusion to work. */
29 
30 #ifndef GCC_F_BAD_H
31 #define GCC_F_BAD_H
32 
33 /* Simple definitions and enumerations. */
34 
35 typedef enum
36   {
37 #define FFEBAD_MSG(KWD,SEV,MSG) KWD,
38 #include "bad.def"
39 #undef FFEBAD_MSG
40     FFEBAD
41   } ffebad;
42 
43 typedef enum
44   {
45 
46     /* Order important; must be increasing severity. */
47 
48     FFEBAD_severityINFORMATIONAL,	/* User notice. */
49     FFEBAD_severityTRIVIAL,	/* Internal notice. */
50     FFEBAD_severityWARNING,	/* User warning. */
51     FFEBAD_severityPECULIAR,	/* Internal warning. */
52     FFEBAD_severityPEDANTIC,	/* Pedantic, could be warning or error. */
53     FFEBAD_severityFATAL,	/* User error. */
54     FFEBAD_severityWEIRD,	/* Internal error. */
55     FFEBAD_severitySEVERE,	/* User error, cannot continue. */
56     FFEBAD_severityDISASTER,	/* Internal error, cannot continue. */
57     FFEBAD_severity
58   } ffebadSeverity;
59 
60 /* Typedefs. */
61 
62 typedef unsigned char ffebadIndex;
63 
64 /* Include files needed by this one. */
65 
66 #include "where.h"
67 
68 /* Structure definitions. */
69 
70 
71 /* Global objects accessed by users of this module. */
72 
73 extern bool ffebad_is_inhibited_;
74 
75 /* Declare functions with prototypes. */
76 
77 void ffebad_finish (void);
78 void ffebad_here (ffebadIndex i, ffewhereLine wl, ffewhereColumn wc);
79 void ffebad_init_0 (void);
80 bool ffebad_is_fatal (ffebad errnum);
81 ffebadSeverity ffebad_severity (ffebad errnum);
82 bool ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
83 		    const char *msgid);
84 void ffebad_string (const char *string);
85 
86 /* Define macros. */
87 
88 #define ffebad_inhibit() (ffebad_is_inhibited_)
89 #define ffebad_init_1()
90 #define ffebad_init_2()
91 #define ffebad_init_3()
92 #define ffebad_init_4()
93 #define ffebad_set_inhibit(f) (ffebad_is_inhibited_ = (f))
94 #define ffebad_start(e) ffebad_start_ (FALSE, (e), FFEBAD_severity, NULL)
95 #define ffebad_start_lex(e) ffebad_start_ (TRUE, (e), FFEBAD_severity, NULL)
96 #define ffebad_start_msg(msgid,s) ffebad_start_ (FALSE, FFEBAD, (s), (msgid))
97 #define ffebad_start_msg_lex(msgid,s) ffebad_start_ (TRUE, FFEBAD, (s), (msgid))
98 #define ffebad_terminate_0()
99 #define ffebad_terminate_1()
100 #define ffebad_terminate_2()
101 #define ffebad_terminate_3()
102 #define ffebad_terminate_4()
103 
104 /* End of #include file. */
105 
106 #endif /* ! GCC_F_BAD_H */
107