Borderbasix

f2c.H
Go to the documentation of this file.
1 /* f2c.h -- Standard Fortran to C header file */
2 
7 #ifndef F2C_INCLUDE
8 #define F2C_INCLUDE
9 
10 typedef long int integer;
11 typedef unsigned long uinteger;
12 typedef char *address;
13 typedef short int shortint;
14 typedef float singlereal;
15 typedef float f2c_real;
16 typedef double doublereal;
17 struct singlecomplex { singlereal r, i; };
18 struct f2c_complex { singlereal r, i; };
19 template<typename T>
20 struct doublecomplex { T r, i; };
21 
22 typedef long int logical;
23 typedef short int shortlogical;
24 typedef char logical1;
25 typedef char integer1;
26 #if 0 /* Adjust for integer*8. */
27 typedef long long longint; /* system-dependent */
28 typedef unsigned long long ulongint; /* system-dependent */
29 #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
30 #define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
31 #endif //
32 
33 #define TRUE_ (1)
34 #define FALSE_ (0)
35 
36 /* Extern is for use with -E */
37 #ifndef Extern
38 #define Extern extern
39 #endif //
40 
41 /* I/O stuff */
42 
43 #ifdef f2c_i2
44 /* for -i2 */
45 typedef short flag;
46 typedef short ftnlen;
47 typedef short ftnint;
48 #else
49 typedef long int flag;
50 typedef long int ftnlen;
51 typedef long int ftnint;
52 #endif //
53 
54 /*external read, write*/
55 typedef struct
56 { flag cierr;
57  ftnint ciunit;
58  flag ciend;
59  char *cifmt;
60  ftnint cirec;
61 } cilist;
62 
63 /*internal read, write*/
64 typedef struct
65 { flag icierr;
66  char *iciunit;
67  flag iciend;
68  char *icifmt;
69  ftnint icirlen;
70  ftnint icirnum;
71 } icilist;
72 
73 /*open*/
74 typedef struct
75 { flag oerr;
76  ftnint ounit;
77  char *ofnm;
78  ftnlen ofnmlen;
79  char *osta;
80  char *oacc;
81  char *ofm;
82  ftnint orl;
83  char *oblnk;
84 } olist;
85 
86 /*close*/
87 typedef struct
88 { flag cerr;
89  ftnint cunit;
90  char *csta;
91 } cllist;
92 
93 /*rewind, backspace, endfile*/
94 typedef struct
95 { flag aerr;
96  ftnint aunit;
97 } alist;
98 
99 /* inquire */
100 typedef struct
101 { flag inerr;
102  ftnint inunit;
103  char *infile;
104  ftnlen infilen;
105  ftnint *inex; /*parameters in standard's order*/
106  ftnint *inopen;
107  ftnint *innum;
108  ftnint *innamed;
109  char *inname;
110  ftnlen innamlen;
111  char *inacc;
112  ftnlen inacclen;
113  char *inseq;
114  ftnlen inseqlen;
115  char *indir;
116  ftnlen indirlen;
117  char *infmt;
118  ftnlen infmtlen;
119  char *inform;
120  ftnint informlen;
121  char *inunf;
122  ftnlen inunflen;
123  ftnint *inrecl;
124  ftnint *innrec;
125  char *inblank;
126  ftnlen inblanklen;
127 } inlist;
128 
129 #define VOID void
130 template<typename T>
131 union Multitype { /* for multiple entry points */
133  shortint h;
134  integer i;
135  /* longint j; */
137  doublereal d;
140  };
141 
142 //typedef union Multitype Multitype;
143 
144 /*typedef long int Long;*/ /* No longer used; formerly in Namelist */
145 
146 struct Vardesc { /* for Namelist */
147  char *name;
148  char *addr;
149  ftnlen *dims;
150  int type;
151  };
152 typedef struct Vardesc Vardesc;
153 
154 struct Namelist {
155  char *name;
156  Vardesc **vars;
157  int nvars;
158  };
159 typedef struct Namelist Namelist;
160 
161 #define abs(x) ((x) >= 0 ? (x) : -(x))
162 #define dabs(x) (doublereal)abs(x)
163 #ifndef min
164 //#define min(a,b) ((a) <= (b) ? (a) : (b))
165 #define max(a,b) ((a) >= (b) ? (a) : (b))
166 #endif //
167 #define dmin(a,b) (doublereal)min(a,b)
168 #define dmax(a,b) (doublereal)max(a,b)
169 #define bit_test(a,b) ((a) >> (b) & 1)
170 #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
171 #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
172 
173 /* procedure parameter types for -A and -C++ */
174 
175 #define F2C_proc_par_types 1
176 #ifdef __cplusplus
177 typedef int /* Unknown procedure type */ (*U_fp)(...);
178 typedef shortint (*J_fp)(...);
179 typedef integer (*I_fp)(...);
180 typedef singlereal (*R_fp)(...);
181 typedef doublereal (*D_fp)(...), (*E_fp)(...);
182 typedef /* Complex */ VOID (*C_fp)(...);
183 typedef /* Double Complex */ VOID (*Z_fp)(...);
184 typedef logical (*L_fp)(...);
185 typedef shortlogical (*K_fp)(...);
186 typedef /* Character */ VOID (*H_fp)(...);
187 typedef /* Subroutine */ int (*S_fp)(...);
188 #else
189 typedef int /* Unknown procedure type */ (*U_fp)();
190 typedef shortint (*J_fp)();
191 typedef integer (*I_fp)();
192 typedef singlereal (*R_fp)();
193 typedef doublereal (*D_fp)(), (*E_fp)();
194 typedef /* Complex */ VOID (*C_fp)();
195 typedef /* Double Complex */ VOID (*Z_fp)();
196 typedef logical (*L_fp)();
197 typedef shortlogical (*K_fp)();
198 typedef /* Character */ VOID (*H_fp)();
199 typedef /* Subroutine */ int (*S_fp)();
200 #endif //
201 /* E_fp is for real functions when -R is not specified */
202 typedef VOID C_f; /* complex function */
203 typedef VOID H_f; /* character function */
204 typedef VOID Z_f; /* double complex function */
205 typedef doublereal E_f; /* real function with -R not specified */
206 
207 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
208 
209 #ifndef Skip_f2c_Undefs
210 #undef cray
211 #undef gcos
212 #undef mc68010
213 #undef mc68020
214 #undef mips
215 #undef pdp11
216 #undef sgi
217 #undef sparc
218 #undef sun
219 #undef sun2
220 #undef sun3
221 #undef sun4
222 #undef u370
223 #undef u3b
224 #undef u3b2
225 #undef u3b5
226 #undef unix
227 #undef vax
228 #endif //
229 #endif //
long int flag
Definition: f2c.H:49
unsigned long uinteger
Definition: f2c.H:11
VOID(* C_fp)()
Definition: f2c.H:194
integer1 g
Definition: f2c.H:132
VOID C_f
Definition: f2c.H:202
long int integer
Definition: alp_f2c.H:23
char integer1
Definition: f2c.H:25
Definition: alp_f2c.H:67
doublereal i
Definition: alp_f2c.H:30
doublecomplex< T > z
Definition: f2c.H:139
char * addr
Definition: alp_f2c.H:149
long ftnlen
Definition: alp_f2c.H:53
short int shortint
Definition: f2c.H:13
VOID H_f
Definition: f2c.H:203
singlecomplex c
Definition: f2c.H:138
long flag
Definition: alp_f2c.H:52
doublereal(*)(* E_fp)()
Definition: f2c.H:193
Definition: alp_f2c.H:103
Definition: alp_f2c.H:77
Definition: alp_f2c.H:155
integer i
Definition: alp_f2c.H:136
int type
Definition: alp_f2c.H:151
Definition: alp_f2c.H:29
Definition: f2c.H:17
double doublereal
Definition: resolve.hpp:7
#define VOID
Definition: f2c.H:129
long int logical
Definition: f2c.H:22
VOID Z_f
Definition: f2c.H:204
Definition: alp_f2c.H:58
singlereal r
Definition: f2c.H:136
Definition: alp_f2c.H:97
ftnlen * dims
Definition: alp_f2c.H:150
double doublereal
Definition: f2c.H:16
float singlereal
Definition: f2c.H:14
singlereal(* R_fp)()
Definition: f2c.H:192
float f2c_real
Definition: f2c.H:15
integer(* I_fp)()
Definition: f2c.H:191
singlereal r
Definition: f2c.H:18
shortint(* J_fp)()
Definition: f2c.H:190
long int integer
Definition: f2c.H:10
char * name
Definition: alp_f2c.H:148
doublereal d
Definition: alp_f2c.H:138
singlereal r
Definition: f2c.H:17
int nvars
Definition: alp_f2c.H:158
T r
Definition: f2c.H:20
Definition: alp_f2c.H:147
VOID(* Z_fp)()
Definition: f2c.H:195
logical(* L_fp)()
Definition: f2c.H:196
short int shortint
Definition: alp_f2c.H:26
Definition: alp_f2c.H:90
Vardesc ** vars
Definition: alp_f2c.H:157
doublereal(* D_fp)()
Definition: f2c.H:193
long int ftnint
Definition: f2c.H:51
char * name
Definition: alp_f2c.H:156
long int ftnlen
Definition: f2c.H:50
Definition: alp_f2c.H:134
long ftnint
Definition: alp_f2c.H:54
shortint h
Definition: alp_f2c.H:135
char logical1
Definition: f2c.H:24
f2c_real i
Definition: alp_f2c.H:29
doublereal E_f
Definition: f2c.H:205
char * address
Definition: f2c.H:12
int(* S_fp)()
Definition: f2c.H:199
VOID(* H_fp)()
Definition: f2c.H:198
shortlogical(* K_fp)()
Definition: f2c.H:197
short int shortlogical
Definition: f2c.H:23
Definition: alp_f2c.H:30
singlereal i
Definition: f2c.H:17
Home  |  Download & InstallContributions