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