f2c.h 4.6 KB

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