annotate ext/clapack/include/f2c.h @ 510:2adcd94c2079

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