c@427: /* f2c.h -- Standard Fortran to C header file */ c@427: c@427: /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." c@427: c@427: - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ c@427: c@427: #ifndef F2C_INCLUDE c@427: #define F2C_INCLUDE c@427: c@427: typedef int integer; c@427: typedef unsigned int uinteger; c@427: typedef char *address; c@427: typedef short shortint; c@427: typedef float real; c@427: typedef double doublereal; c@427: typedef struct { real r, i; } complex; c@427: typedef struct { doublereal r, i; } doublecomplex; c@427: typedef int logical; c@427: typedef short shortlogical; c@427: typedef char logical1; c@427: typedef char integer1; c@427: #ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ c@427: typedef int64_t longint; /* system-dependent */ c@427: typedef uint64_t ulongint; /* system-dependent */ c@427: #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) c@427: #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) c@427: #endif c@427: c@427: #define TRUE_ (1) c@427: #define FALSE_ (0) c@427: c@427: /* Extern is for use with -E */ c@427: #ifndef Extern c@427: #define Extern extern c@427: #endif c@427: c@427: /* I/O stuff */ c@427: c@427: #ifdef f2c_i2 c@427: /* for -i2 */ c@427: typedef short flag; c@427: typedef short ftnlen; c@427: typedef short ftnint; c@427: #else c@427: typedef int flag; c@427: typedef int ftnlen; c@427: typedef int ftnint; c@427: #endif c@427: c@427: /*external read, write*/ c@427: typedef struct c@427: { flag cierr; c@427: ftnint ciunit; c@427: flag ciend; c@427: char *cifmt; c@427: ftnint cirec; c@427: } cilist; c@427: c@427: /*internal read, write*/ c@427: typedef struct c@427: { flag icierr; c@427: char *iciunit; c@427: flag iciend; c@427: char *icifmt; c@427: ftnint icirlen; c@427: ftnint icirnum; c@427: } icilist; c@427: c@427: /*open*/ c@427: typedef struct c@427: { flag oerr; c@427: ftnint ounit; c@427: char *ofnm; c@427: ftnlen ofnmlen; c@427: char *osta; c@427: char *oacc; c@427: char *ofm; c@427: ftnint orl; c@427: char *oblnk; c@427: } olist; c@427: c@427: /*close*/ c@427: typedef struct c@427: { flag cerr; c@427: ftnint cunit; c@427: char *csta; c@427: } cllist; c@427: c@427: /*rewind, backspace, endfile*/ c@427: typedef struct c@427: { flag aerr; c@427: ftnint aunit; c@427: } alist; c@427: c@427: /* inquire */ c@427: typedef struct c@427: { flag inerr; c@427: ftnint inunit; c@427: char *infile; c@427: ftnlen infilen; c@427: ftnint *inex; /*parameters in standard's order*/ c@427: ftnint *inopen; c@427: ftnint *innum; c@427: ftnint *innamed; c@427: char *inname; c@427: ftnlen innamlen; c@427: char *inacc; c@427: ftnlen inacclen; c@427: char *inseq; c@427: ftnlen inseqlen; c@427: char *indir; c@427: ftnlen indirlen; c@427: char *infmt; c@427: ftnlen infmtlen; c@427: char *inform; c@427: ftnint informlen; c@427: char *inunf; c@427: ftnlen inunflen; c@427: ftnint *inrecl; c@427: ftnint *innrec; c@427: char *inblank; c@427: ftnlen inblanklen; c@427: } inlist; c@427: c@427: #define VOID void c@427: c@427: union Multitype { /* for multiple entry points */ c@427: integer1 g; c@427: shortint h; c@427: integer i; c@427: /* longint j; */ c@427: real r; c@427: doublereal d; c@427: complex c; c@427: doublecomplex z; c@427: }; c@427: c@427: typedef union Multitype Multitype; c@427: c@427: /*typedef long int Long;*/ /* No longer used; formerly in Namelist */ c@427: c@427: struct Vardesc { /* for Namelist */ c@427: char *name; c@427: char *addr; c@427: ftnlen *dims; c@427: int type; c@427: }; c@427: typedef struct Vardesc Vardesc; c@427: c@427: struct Namelist { c@427: char *name; c@427: Vardesc **vars; c@427: int nvars; c@427: }; c@427: typedef struct Namelist Namelist; c@427: c@427: #define abs(x) ((x) >= 0 ? (x) : -(x)) c@427: #define dabs(x) (doublereal)abs(x) c@427: #define min(a,b) ((a) <= (b) ? (a) : (b)) c@427: #define max(a,b) ((a) >= (b) ? (a) : (b)) c@427: #define dmin(a,b) (doublereal)min(a,b) c@427: #define dmax(a,b) (doublereal)max(a,b) c@427: #define bit_test(a,b) ((a) >> (b) & 1) c@427: #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) c@427: #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) c@427: c@427: /* procedure parameter types for -A and -C++ */ c@427: c@427: #define F2C_proc_par_types 1 c@427: #ifdef __cplusplus c@427: typedef int /* Unknown procedure type */ (*U_fp)(...); c@427: typedef shortint (*J_fp)(...); c@427: typedef integer (*I_fp)(...); c@427: typedef real (*R_fp)(...); c@427: typedef doublereal (*D_fp)(...), (*E_fp)(...); c@427: typedef /* Complex */ VOID (*C_fp)(...); c@427: typedef /* Double Complex */ VOID (*Z_fp)(...); c@427: typedef logical (*L_fp)(...); c@427: typedef shortlogical (*K_fp)(...); c@427: typedef /* Character */ VOID (*H_fp)(...); c@427: typedef /* Subroutine */ int (*S_fp)(...); c@427: #else c@427: typedef int /* Unknown procedure type */ (*U_fp)(); c@427: typedef shortint (*J_fp)(); c@427: typedef integer (*I_fp)(); c@427: typedef real (*R_fp)(); c@427: typedef doublereal (*D_fp)(), (*E_fp)(); c@427: typedef /* Complex */ VOID (*C_fp)(); c@427: typedef /* Double Complex */ VOID (*Z_fp)(); c@427: typedef logical (*L_fp)(); c@427: typedef shortlogical (*K_fp)(); c@427: typedef /* Character */ VOID (*H_fp)(); c@427: typedef /* Subroutine */ int (*S_fp)(); c@427: #endif c@427: /* E_fp is for real functions when -R is not specified */ c@427: typedef VOID C_f; /* complex function */ c@427: typedef VOID H_f; /* character function */ c@427: typedef VOID Z_f; /* double complex function */ c@427: typedef doublereal E_f; /* real function with -R not specified */ c@427: c@427: /* undef any lower-case symbols that your C compiler predefines, e.g.: */ c@427: c@427: #ifndef Skip_f2c_Undefs c@427: #undef cray c@427: #undef gcos c@427: #undef mc68010 c@427: #undef mc68020 c@427: #undef mips c@427: #undef pdp11 c@427: #undef sgi c@427: #undef sparc c@427: #undef sun c@427: #undef sun2 c@427: #undef sun3 c@427: #undef sun4 c@427: #undef u370 c@427: #undef u3b c@427: #undef u3b2 c@427: #undef u3b5 c@427: #undef unix c@427: #undef vax c@427: #endif c@427: #endif