PLaSK library

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