Reset parser in grace_set_project().
[grace.git] / src / f2c.h
blob3a268e7164c4035897950dddbffa75230fdb613e
1 /*
2 * Grace - Graphics for Exploratory Data Analysis
3 *
4 * Home page: http://plasma-gate.weizmann.ac.il/Grace/
5 *
6 * Copyright (c) 1991-95 Paul J Turner, Portland, OR
7 * Copyright (c) 1996-98 GRACE Development Team
8 *
9 * Maintained by Evgeny Stambulchik
12 * All Rights Reserved
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 /* f2c.h -- Standard Fortran to C header file */
31 /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
33 - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
35 #ifndef F2C_INCLUDE
36 #define F2C_INCLUDE
38 typedef long int integer;
39 typedef unsigned long uinteger;
40 typedef char *address;
41 typedef short int shortint;
42 typedef float real;
43 typedef double doublereal;
44 typedef struct { real r, i; } complex;
45 typedef struct { doublereal r, i; } doublecomplex;
46 typedef long int logical;
47 typedef short int shortlogical;
48 typedef char logical1;
49 typedef char integer1;
50 #if 0 /* Adjust for integer*8. */
51 typedef long long longint; /* system-dependent */
52 typedef unsigned long long ulongint; /* system-dependent */
53 #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
54 #define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
55 #endif
57 #define TRUE_ (1)
58 #define FALSE_ (0)
60 /* Extern is for use with -E */
61 #ifndef Extern
62 #define Extern extern
63 #endif
65 /* I/O stuff */
67 #ifdef f2c_i2
68 /* for -i2 */
69 typedef short flag;
70 typedef short ftnlen;
71 typedef short ftnint;
72 #else
73 typedef long int flag;
74 typedef long int ftnlen;
75 typedef long int ftnint;
76 #endif
78 /*external read, write*/
79 typedef struct
80 { flag cierr;
81 ftnint ciunit;
82 flag ciend;
83 char *cifmt;
84 ftnint cirec;
85 } cilist;
87 /*internal read, write*/
88 typedef struct
89 { flag icierr;
90 char *iciunit;
91 flag iciend;
92 char *icifmt;
93 ftnint icirlen;
94 ftnint icirnum;
95 } icilist;
97 /*open*/
98 typedef struct
99 { flag oerr;
100 ftnint ounit;
101 char *ofnm;
102 ftnlen ofnmlen;
103 char *osta;
104 char *oacc;
105 char *ofm;
106 ftnint orl;
107 char *oblnk;
108 } olist;
110 /*close*/
111 typedef struct
112 { flag cerr;
113 ftnint cunit;
114 char *csta;
115 } cllist;
117 /*rewind, backspace, endfile*/
118 typedef struct
119 { flag aerr;
120 ftnint aunit;
121 } alist;
123 /* inquire */
124 typedef struct
125 { flag inerr;
126 ftnint inunit;
127 char *infile;
128 ftnlen infilen;
129 ftnint *inex; /*parameters in standard's order*/
130 ftnint *inopen;
131 ftnint *innum;
132 ftnint *innamed;
133 char *inname;
134 ftnlen innamlen;
135 char *inacc;
136 ftnlen inacclen;
137 char *inseq;
138 ftnlen inseqlen;
139 char *indir;
140 ftnlen indirlen;
141 char *infmt;
142 ftnlen infmtlen;
143 char *inform;
144 ftnint informlen;
145 char *inunf;
146 ftnlen inunflen;
147 ftnint *inrecl;
148 ftnint *innrec;
149 char *inblank;
150 ftnlen inblanklen;
151 } inlist;
153 #define VOID void
155 union Multitype { /* for multiple entry points */
156 integer1 g;
157 shortint h;
158 integer i;
159 /* longint j; */
160 real r;
161 doublereal d;
162 complex c;
163 doublecomplex z;
166 typedef union Multitype Multitype;
168 /*typedef long int Long;*/ /* No longer used; formerly in Namelist */
170 struct Vardesc { /* for Namelist */
171 char *name;
172 char *addr;
173 ftnlen *dims;
174 int type;
176 typedef struct Vardesc Vardesc;
178 struct Namelist {
179 char *name;
180 Vardesc **vars;
181 int nvars;
183 typedef struct Namelist Namelist;
185 /* AIX has abs() defined */
186 #ifdef abs
187 #undef abs
188 #endif
190 #define abs(x) ((x) >= 0 ? (x) : -(x))
191 #define dabs(x) (doublereal)abs(x)
192 #define min(a,b) ((a) <= (b) ? (a) : (b))
193 #define max(a,b) ((a) >= (b) ? (a) : (b))
194 #define dmin(a,b) (doublereal)min(a,b)
195 #define dmax(a,b) (doublereal)max(a,b)
196 #define bit_test(a,b) ((a) >> (b) & 1)
197 #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
198 #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
200 /* procedure parameter types for -A and -C++ */
202 #define F2C_proc_par_types 1
203 #ifdef __cplusplus
204 typedef int /* Unknown procedure type */ (*U_fp)(...);
205 typedef shortint (*J_fp)(...);
206 typedef integer (*I_fp)(...);
207 typedef real (*R_fp)(...);
208 typedef doublereal (*D_fp)(...), (*E_fp)(...);
209 typedef /* Complex */ VOID (*C_fp)(...);
210 typedef /* Double Complex */ VOID (*Z_fp)(...);
211 typedef logical (*L_fp)(...);
212 typedef shortlogical (*K_fp)(...);
213 typedef /* Character */ VOID (*H_fp)(...);
214 typedef /* Subroutine */ int (*S_fp)(...);
215 #else
216 typedef int /* Unknown procedure type */ (*U_fp)();
217 typedef shortint (*J_fp)();
218 typedef integer (*I_fp)();
219 typedef real (*R_fp)();
220 typedef doublereal (*D_fp)(), (*E_fp)();
221 typedef /* Complex */ VOID (*C_fp)();
222 typedef /* Double Complex */ VOID (*Z_fp)();
223 typedef logical (*L_fp)();
224 typedef shortlogical (*K_fp)();
225 typedef /* Character */ VOID (*H_fp)();
226 typedef /* Subroutine */ int (*S_fp)();
227 #endif
228 /* E_fp is for real functions when -R is not specified */
229 typedef VOID C_f; /* complex function */
230 typedef VOID H_f; /* character function */
231 typedef VOID Z_f; /* double complex function */
232 typedef doublereal E_f; /* real function with -R not specified */
234 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
236 #ifndef Skip_f2c_Undefs
237 #undef cray
238 #undef gcos
239 #undef mc68010
240 #undef mc68020
241 #undef mips
242 #undef pdp11
243 #undef sgi
244 #undef sparc
245 #undef sun
246 #undef sun2
247 #undef sun3
248 #undef sun4
249 #undef u370
250 #undef u3b
251 #undef u3b2
252 #undef u3b5
253 #undef unix
254 #undef vax
255 #endif
256 #endif