f2c.h
Go to the documentation of this file.
00001 /* f2c.h  --  Standard Fortran to C header file */
00002 
00007 #ifndef F2C_INCLUDE
00008 #define F2C_INCLUDE
00009 #define _LARGE_FILE_SOURCE
00010 #define _LARGEFILE64_SOURCE
00011 #include <stdint.h>
00012 
00013 typedef int32_t integer;
00014 typedef uint32_t uinteger;
00015 typedef char *address;
00016 typedef int16_t shortint;
00017 typedef float real;
00018 typedef double doublereal;
00019 typedef struct { real r, i; } complex;
00020 typedef struct { doublereal r, i; } doublecomplex;
00021 typedef int32_t logical;
00022 typedef int16_t shortlogical;
00023 typedef char logical1;
00024 typedef char integer1;
00025 #ifdef INTEGER_STAR_8   /* Adjust for integer*8. */
00026 typedef int64_t longint;                /* system-dependent */
00027 typedef uint64_t ulongint;      /* system-dependent */
00028 #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
00029 #define qbit_set(a,b)   ((a) |  ((ulongint)1 << (b)))
00030 #endif
00031 
00032 #define TRUE_ (1)
00033 #define FALSE_ (0)
00034 
00035 /* Extern is for use with -E */
00036 #ifndef Extern
00037 #define Extern extern
00038 #endif
00039 
00040 /* I/O stuff */
00041 
00042 #ifdef f2c_i2
00043 /* for -i2 */
00044 typedef int16_t flag;
00045 typedef int16_t ftnlen;
00046 typedef int16_t ftnint;
00047 #else
00048 typedef int32_t flag;
00049 typedef int32_t ftnlen;
00050 typedef int32_t ftnint;
00051 #endif
00052 
00053 /*external read, write*/
00054 typedef struct
00055 {       flag cierr;
00056         ftnint ciunit;
00057         flag ciend;
00058         char *cifmt;
00059         ftnint cirec;
00060 } cilist;
00061 
00062 /*internal read, write*/
00063 typedef struct
00064 {       flag icierr;
00065         char *iciunit;
00066         flag iciend;
00067         char *icifmt;
00068         ftnint icirlen;
00069         ftnint icirnum;
00070 } icilist;
00071 
00072 /*open*/
00073 typedef struct
00074 {       flag oerr;
00075         ftnint ounit;
00076         char *ofnm;
00077         ftnlen ofnmlen;
00078         char *osta;
00079         char *oacc;
00080         char *ofm;
00081         ftnint orl;
00082         char *oblnk;
00083 } olist;
00084 
00085 /*close*/
00086 typedef struct
00087 {       flag cerr;
00088         ftnint cunit;
00089         char *csta;
00090 } cllist;
00091 
00092 /*rewind, backspace, endfile*/
00093 typedef struct
00094 {       flag aerr;
00095         ftnint aunit;
00096 } alist;
00097 
00098 /* inquire */
00099 typedef struct
00100 {       flag inerr;
00101         ftnint inunit;
00102         char *infile;
00103         ftnlen infilen;
00104         ftnint  *inex;  /*parameters in standard's order*/
00105         ftnint  *inopen;
00106         ftnint  *innum;
00107         ftnint  *innamed;
00108         char    *inname;
00109         ftnlen  innamlen;
00110         char    *inacc;
00111         ftnlen  inacclen;
00112         char    *inseq;
00113         ftnlen  inseqlen;
00114         char    *indir;
00115         ftnlen  indirlen;
00116         char    *infmt;
00117         ftnlen  infmtlen;
00118         char    *inform;
00119         ftnint  informlen;
00120         char    *inunf;
00121         ftnlen  inunflen;
00122         ftnint  *inrecl;
00123         ftnint  *innrec;
00124         char    *inblank;
00125         ftnlen  inblanklen;
00126 } inlist;
00127 
00128 #define VOID void
00129 
00130 union Multitype {       /* for multiple entry points */
00131         integer1 g;
00132         shortint h;
00133         integer i;
00134         /* longint j; */
00135         real r;
00136         doublereal d;
00137         complex c;
00138         doublecomplex z;
00139         };
00140 
00141 typedef union Multitype Multitype;
00142 
00143 /*typedef long int32_t Long;*/  /* No longer used; formerly in Namelist */
00144 
00145 struct Vardesc {        /* for Namelist */
00146         char *name;
00147         char *addr;
00148         ftnlen *dims;
00149         int32_t  type;
00150         };
00151 typedef struct Vardesc Vardesc;
00152 
00153 struct Namelist {
00154         char *name;
00155         Vardesc **vars;
00156         int32_t nvars;
00157         };
00158 typedef struct Namelist Namelist;
00159 
00160 #define abs(x) ((x) >= 0 ? (x) : -(x))
00161 #define dabs(x) (doublereal)abs(x)
00162 #define min(a,b) ((a) <= (b) ? (a) : (b))
00163 #define max(a,b) ((a) >= (b) ? (a) : (b))
00164 #define dmin(a,b) (doublereal)min(a,b)
00165 #define dmax(a,b) (doublereal)max(a,b)
00166 #define bit_test(a,b)   ((a) >> (b) & 1)
00167 #define bit_clear(a,b)  ((a) & ~((uinteger)1 << (b)))
00168 #define bit_set(a,b)    ((a) |  ((uinteger)1 << (b)))
00169 
00170 /* procedure parameter types for -A and -C++ */
00171 
00172 #define F2C_proc_par_types 1
00173 #ifdef __cplusplus
00174 typedef int /* Unknown procedure type */ (*U_fp)(...);
00175 typedef shortint (*J_fp)(...);
00176 typedef integer (*I_fp)(...);
00177 typedef real (*R_fp)(...);
00178 typedef doublereal (*D_fp)(...), (*E_fp)(...);
00179 typedef /* Complex */ VOID (*C_fp)(...);
00180 typedef /* Double Complex */ VOID (*Z_fp)(...);
00181 typedef logical (*L_fp)(...);
00182 typedef shortlogical (*K_fp)(...);
00183 typedef /* Character */ VOID (*H_fp)(...);
00184 typedef /* Subroutine */ int (*S_fp)(...);
00185 #else
00186 typedef int /* Unknown procedure type */ (*U_fp)();
00187 typedef shortint (*J_fp)();
00188 typedef integer (*I_fp)();
00189 typedef real (*R_fp)();
00190 typedef doublereal (*D_fp)(), (*E_fp)();
00191 typedef /* Complex */ VOID (*C_fp)();
00192 typedef /* Double Complex */ VOID (*Z_fp)();
00193 typedef logical (*L_fp)();
00194 typedef shortlogical (*K_fp)();
00195 typedef /* Character */ VOID (*H_fp)();
00196 typedef /* Subroutine */ int (*S_fp)();
00197 #endif
00198 /* E_fp is for real functions when -R is not specified */
00199 typedef VOID C_f;       /* complex function */
00200 typedef VOID H_f;       /* character function */
00201 typedef VOID Z_f;       /* double complex function */
00202 typedef doublereal E_f; /* real function with -R not specified */
00203 
00204 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
00205 
00206 #ifndef Skip_f2c_Undefs
00207 #undef cray
00208 #undef gcos
00209 #undef mc68010
00210 #undef mc68020
00211 #undef mips
00212 #undef pdp11
00213 #undef sgi
00214 #undef sparc
00215 #undef sun
00216 #undef sun2
00217 #undef sun3
00218 #undef sun4
00219 #undef u370
00220 #undef u3b
00221 #undef u3b2
00222 #undef u3b5
00223 #undef unix
00224 #undef vax
00225 #endif
00226 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:50