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