1 /* info.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
27 Extensive rewrite for new cleaner approach.
30 /* Allow multiple inclusion to work. */
35 /* Simple definitions and enumerations. */
39 #define FFEINFO_BASICTYPE(KWD,LNAM,SNAM) KWD,
41 #undef FFEINFO_BASICTYPE
46 { /* If these kindtypes aren't in size order,
47 change _kindtype_max. */
49 FFEINFO_kindtypeINTEGER1
,
50 FFEINFO_kindtypeINTEGER2
,
51 FFEINFO_kindtypeINTEGER3
,
52 FFEINFO_kindtypeINTEGER4
,
53 FFEINFO_kindtypeINTEGER5
,
54 FFEINFO_kindtypeINTEGER6
,
55 FFEINFO_kindtypeINTEGER7
,
56 FFEINFO_kindtypeINTEGER8
,
57 FFEINFO_kindtypeLOGICAL1
= 1, /* Ok to omit, but ok to overlap. */
58 FFEINFO_kindtypeLOGICAL2
,
59 FFEINFO_kindtypeLOGICAL3
,
60 FFEINFO_kindtypeLOGICAL4
,
61 FFEINFO_kindtypeLOGICAL5
,
62 FFEINFO_kindtypeLOGICAL6
,
63 FFEINFO_kindtypeLOGICAL7
,
64 FFEINFO_kindtypeLOGICAL8
,
65 FFEINFO_kindtypeREAL1
= 1, /* Ok to omit, but ok to overlap. */
66 FFEINFO_kindtypeREAL2
,
67 FFEINFO_kindtypeREAL3
,
68 FFEINFO_kindtypeREAL4
,
69 FFEINFO_kindtypeREAL5
,
70 FFEINFO_kindtypeREAL6
,
71 FFEINFO_kindtypeREAL7
,
72 FFEINFO_kindtypeREAL8
,
73 FFEINFO_kindtypeCHARACTER1
= 1, /* Ok to omit, but ok to overlap. */
74 FFEINFO_kindtypeCHARACTER2
,
75 FFEINFO_kindtypeCHARACTER3
,
76 FFEINFO_kindtypeCHARACTER4
,
77 FFEINFO_kindtypeCHARACTER5
,
78 FFEINFO_kindtypeCHARACTER6
,
79 FFEINFO_kindtypeCHARACTER7
,
80 FFEINFO_kindtypeCHARACTER8
,
87 #define FFEINFO_KIND(KWD,LNAM,SNAM) KWD,
95 #define FFEINFO_WHERE(KWD,LNAM,SNAM) KWD,
103 typedef struct _ffeinfo_ ffeinfo
;
104 typedef char ffeinfoRank
;
106 /* Include files needed by this one. */
111 /* Structure definitions. */
115 ffeinfoBasictype basictype
;
116 ffeinfoKindtype kindtype
;
120 ffetargetCharacterSize size
;
123 /* Global objects accessed by users of this module. */
126 /* Declare functions with prototypes. */
128 ffeinfoBasictype
ffeinfo_basictype_combine (ffeinfoBasictype l
,
130 const char *ffeinfo_basictype_string (ffeinfoBasictype basictype
);
131 void ffeinfo_init_0 (void);
132 const char *ffeinfo_kind_message (ffeinfoKind kind
);
133 const char *ffeinfo_kind_string (ffeinfoKind kind
);
134 ffeinfoKindtype
ffeinfo_kindtype_max(ffeinfoBasictype bt
,
137 const char *ffeinfo_kindtype_string (ffeinfoKindtype kind_type
);
138 const char *ffeinfo_where_string (ffeinfoWhere where
);
139 ffeinfo
ffeinfo_new (ffeinfoBasictype basictype
, ffeinfoKindtype kindtype
,
140 ffeinfoRank rank
, ffeinfoKind kind
, ffeinfoWhere where
,
141 ffetargetCharacterSize size
);
142 void ffeinfo_set_type (ffeinfoBasictype basictype
, ffeinfoKindtype kindtype
,
144 ffetype
ffeinfo_type (ffeinfoBasictype basictype
, ffeinfoKindtype kindtype
);
148 #define ffeinfo_basictype(i) (i.basictype)
149 #define ffeinfo_init_1()
150 #define ffeinfo_init_2()
151 #define ffeinfo_init_3()
152 #define ffeinfo_init_4()
153 #define ffeinfo_kind(i) (i.kind)
154 #define ffeinfo_kindtype(i) (i.kindtype)
156 #define ffeinfo_new(bt,kt,r,k,w,sz) \
157 ((ffeinfo) {(bt), (kt), (r), (k), (w), (sz)})
159 #define ffeinfo_new_any() \
160 ffeinfo_new (FFEINFO_basictypeANY, FFEINFO_kindtypeANY, 0, \
161 FFEINFO_kindANY, FFEINFO_whereANY, \
162 FFETARGET_charactersizeNONE)
163 #define ffeinfo_new_null() \
164 ffeinfo_new (FFEINFO_basictypeNONE, FFEINFO_kindtypeNONE, 0, \
165 FFEINFO_kindNONE, FFEINFO_whereNONE, \
166 FFETARGET_charactersizeNONE)
167 #define ffeinfo_rank(i) (i.rank)
168 #define ffeinfo_size(i) (i.size)
169 #define ffeinfo_terminate_0()
170 #define ffeinfo_terminate_1()
171 #define ffeinfo_terminate_2()
172 #define ffeinfo_terminate_3()
173 #define ffeinfo_terminate_4()
174 #define ffeinfo_use(i) i
175 #define ffeinfo_where(i) (i.where)
177 #define FFEINFO_kindtypeINTEGERDEFAULT FFEINFO_kindtypeINTEGER1
178 #define FFEINFO_kindtypeLOGICALDEFAULT FFEINFO_kindtypeLOGICAL1
179 #define FFEINFO_kindtypeREALDEFAULT FFEINFO_kindtypeREAL1
180 #define FFEINFO_kindtypeREALDOUBLE FFEINFO_kindtypeREAL2
181 #define FFEINFO_kindtypeREALQUAD FFEINFO_kindtypeREAL3
182 #define FFEINFO_kindtypeCHARACTERDEFAULT FFEINFO_kindtypeCHARACTER1
184 /* End of #include file. */