1 /* where.h -- Public #include File (module.h template V1.0)
2 Copyright (C) 1995 Free Software Foundation, Inc.
3 Contributed by James Craig Burley.
5 This file is part of GNU Fortran.
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)
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.
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
28 /* Allow multiple inclusion to work. */
33 /* Simple definitions and enumerations. */
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)")
45 typedef unsigned char ffewhereColumnNumber
; /* Change FFEWHERE_columnMAX
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
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_ ""
62 /* Include files needed by this one. */
67 /* Structure definitions. */
69 struct _ffewhere_file_
75 struct _ffewhere_line_
78 ffewhereLine previous
;
79 ffewhereLineNumber line_num
;
81 ffewhereLength_ length
;
85 /* Global objects accessed by users of this module. */
87 extern struct _ffewhere_line_ ffewhere_unknown_line_
;
89 /* Declare functions with prototypes. */
91 void ffewhere_file_kill (ffewhereFile wf
);
92 ffewhereFile
ffewhere_file_new (const char *name
, size_t length
);
93 void ffewhere_file_set (ffewhereFile wf
, bool have_num
, ffewhereLineNumber ln
);
94 void ffewhere_init_1 (void);
95 char *ffewhere_line_content (ffewhereLine l
);
96 ffewhereFile
ffewhere_line_file (ffewhereLine l
);
97 ffewhereLineNumber
ffewhere_line_filelinenum (ffewhereLine l
);
98 void ffewhere_line_kill (ffewhereLine l
);
99 ffewhereLine
ffewhere_line_new (ffewhereLineNumber ln
);
100 ffewhereLine
ffewhere_line_use (ffewhereLine wl
);
101 void ffewhere_set_from_track (ffewhereLine
*wol
, ffewhereColumn
*woc
,
102 ffewhereLine wrl
, ffewhereColumn wrc
, ffewhereTrack wt
,
104 void ffewhere_track (ffewhereLine
*wl
, ffewhereColumn
*wc
, ffewhereTrack wt
,
105 ffewhereIndex i
, ffewhereLineNumber ln
, ffewhereColumnNumber cn
);
106 void ffewhere_track_clear (ffewhereTrack wt
, ffewhereIndex length
);
107 void ffewhere_track_copy (ffewhereTrack dwt
, ffewhereTrack swt
,
108 ffewhereIndex start
, ffewhereIndex length
);
109 void ffewhere_track_kill (ffewhereLine wrl
, ffewhereColumn wrc
, ffewhereTrack wt
,
110 ffewhereIndex length
);
114 #define ffewhere_column_is_unknown(c) (c == FFEWHERE_columnUNKNOWN)
115 #define ffewhere_column_kill(c) ((void) 0)
116 #define ffewhere_column_new(cn) (cn)
117 #define ffewhere_column_number(c) (c)
118 #define ffewhere_column_unknown() (FFEWHERE_columnUNKNOWN)
119 #define ffewhere_column_use(c) (c)
120 #define ffewhere_file_name(f) ((f)->text)
121 #define ffewhere_file_namelen(f) ((f)->length)
122 #define ffewhere_init_0()
123 #define ffewhere_init_2()
124 #define ffewhere_init_3()
125 #define ffewhere_init_4()
126 #define ffewhere_line_filename(l) (ffewhere_line_file(l)->text)
127 #define ffewhere_line_is_unknown(l) (l == FFEWHERE_lineUNKNOWN)
128 #define ffewhere_line_number(l) ((l)->line_num)
129 #define ffewhere_line_unknown() (FFEWHERE_lineUNKNOWN)
130 #define ffewhere_terminate_0()
131 #define ffewhere_terminate_1()
132 #define ffewhere_terminate_2()
133 #define ffewhere_terminate_3()
134 #define ffewhere_terminate_4()
136 /* End of #include file. */
138 #endif /* ! GCC_F_EHERE_H */