xref: /openbsd/gnu/usr.bin/gcc/gcc/f/where.h (revision c87b03e5)
1 /* where.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       where.c
24 
25    Modifications:
26 */
27 
28 /* Allow multiple inclusion to work. */
29 
30 #ifndef GCC_F_WHERE_H
31 #define GCC_F_WHERE_H
32 
33 /* Simple definitions and enumerations. */
34 
35 #define FFEWHERE_columnMAX UCHAR_MAX
36 #define FFEWHERE_columnUNKNOWN 0
37 #define FFEWHERE_indexMAX 36
38 #define FFEWHERE_indexUNKNOWN UCHAR_MAX
39 #define FFEWHERE_lineMAX ULONG_MAX
40 #define FFEWHERE_lineUNKNOWN (&ffewhere_unknown_line_)
41 #define FFEWHERE_filenameUNKNOWN ("(input file)")
42 
43 /* Typedefs. */
44 
45 typedef unsigned char ffewhereColumnNumber;	/* Change FFEWHERE_columnMAX
46 						   too. */
47 #define ffewhereColumnNumber_f ""
48 typedef unsigned char ffewhereColumn;
49 typedef struct _ffewhere_file_ *ffewhereFile;
50 typedef unsigned short ffewhereLength_;
51 #define ffewhereLength_f_ ""
52 typedef unsigned long ffewhereLineNumber;	/* Change FFEWHERE_lineMAX
53 						   too. */
54 #define ffewhereLineNumber_f "l"
55 typedef struct _ffewhere_line_ *ffewhereLine;
56 typedef unsigned char ffewhereIndex;
57 #define ffewhereIndex_f ""
58 typedef ffewhereIndex ffewhereTrack[FFEWHERE_indexMAX * 2 - 2];
59 typedef unsigned int ffewhereUses_;
60 #define ffewhereUses_f_ ""
61 
62 /* Include files needed by this one. */
63 
64 #include "top.h"
65 
66 /* Structure definitions. */
67 
68 struct _ffewhere_file_ GTY (())
69   {
70     size_t length;
71     char text[1];
72   };
73 
74 struct _ffewhere_line_
75   {
76     ffewhereLine next;
77     ffewhereLine previous;
78     ffewhereLineNumber line_num;
79     ffewhereUses_ uses;
80     ffewhereLength_ length;
81     char content[1];
82   };
83 
84 /* Global objects accessed by users of this module. */
85 
86 extern struct _ffewhere_line_ ffewhere_unknown_line_;
87 
88 /* Declare functions with prototypes. */
89 
90 ffewhereFile ffewhere_file_new (const char *name, size_t length);
91 void ffewhere_file_set (ffewhereFile wf, bool have_num, ffewhereLineNumber ln);
92 void ffewhere_init_1 (void);
93 char *ffewhere_line_content (ffewhereLine l);
94 ffewhereFile ffewhere_line_file (ffewhereLine l);
95 ffewhereLineNumber ffewhere_line_filelinenum (ffewhereLine l);
96 void ffewhere_line_kill (ffewhereLine l);
97 ffewhereLine ffewhere_line_new (ffewhereLineNumber ln);
98 ffewhereLine ffewhere_line_use (ffewhereLine wl);
99 void ffewhere_set_from_track (ffewhereLine *wol, ffewhereColumn *woc,
100 		     ffewhereLine wrl, ffewhereColumn wrc, ffewhereTrack wt,
101 			      ffewhereIndex i);
102 void ffewhere_track (ffewhereLine *wl, ffewhereColumn *wc, ffewhereTrack wt,
103 	   ffewhereIndex i, ffewhereLineNumber ln, ffewhereColumnNumber cn);
104 void ffewhere_track_clear (ffewhereTrack wt, ffewhereIndex length);
105 void ffewhere_track_copy (ffewhereTrack dwt, ffewhereTrack swt,
106 			  ffewhereIndex start, ffewhereIndex length);
107 void ffewhere_track_kill (ffewhereLine wrl, ffewhereColumn wrc, ffewhereTrack wt,
108 			  ffewhereIndex length);
109 
110 /* Define macros. */
111 
112 #define ffewhere_column_is_unknown(c) (c == FFEWHERE_columnUNKNOWN)
113 #define ffewhere_column_kill(c) ((void) 0)
114 #define ffewhere_column_new(cn) (cn)
115 #define ffewhere_column_number(c) (c)
116 #define ffewhere_column_unknown() (FFEWHERE_columnUNKNOWN)
117 #define ffewhere_column_use(c) (c)
118 #define ffewhere_file_name(f) ((f)->text)
119 #define ffewhere_file_namelen(f) ((f)->length)
120 #define ffewhere_init_0()
121 #define ffewhere_init_2()
122 #define ffewhere_init_3()
123 #define ffewhere_init_4()
124 #define ffewhere_line_filename(l) (ffewhere_line_file(l)->text)
125 #define ffewhere_line_is_unknown(l) (l == FFEWHERE_lineUNKNOWN)
126 #define ffewhere_line_number(l) ((l)->line_num)
127 #define ffewhere_line_unknown() (FFEWHERE_lineUNKNOWN)
128 #define ffewhere_terminate_0()
129 #define ffewhere_terminate_1()
130 #define ffewhere_terminate_2()
131 #define ffewhere_terminate_3()
132 #define ffewhere_terminate_4()
133 
134 /* End of #include file. */
135 
136 #endif /* ! GCC_F_EHERE_H */
137