f2c.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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
  199. /* If you are using a C++ compiler, append the following to f2c.h
  200. for compiling libF77 and libI77. */
  201. #ifdef __cplusplus
  202. extern "C" {
  203. extern int abort_(void);
  204. extern double c_abs(complex *);
  205. extern void c_cos(complex *, complex *);
  206. extern void c_div(complex *, complex *, complex *);
  207. extern void c_exp(complex *, complex *);
  208. extern void c_log(complex *, complex *);
  209. extern void c_sin(complex *, complex *);
  210. extern void c_sqrt(complex *, complex *);
  211. extern double d_abs(double *);
  212. extern double d_acos(double *);
  213. extern double d_asin(double *);
  214. extern double d_atan(double *);
  215. extern double d_atn2(double *, double *);
  216. extern void d_cnjg(doublecomplex *, doublecomplex *);
  217. extern double d_cos(double *);
  218. extern double d_cosh(double *);
  219. extern double d_dim(double *, double *);
  220. extern double d_exp(double *);
  221. extern double d_imag(doublecomplex *);
  222. extern double d_int(double *);
  223. extern double d_lg10(double *);
  224. extern double d_log(double *);
  225. extern double d_mod(double *, double *);
  226. extern double d_nint(double *);
  227. extern double d_prod(float *, float *);
  228. extern double d_sign(double *, double *);
  229. extern double d_sin(double *);
  230. extern double d_sinh(double *);
  231. extern double d_sqrt(double *);
  232. extern double d_tan(double *);
  233. extern double d_tanh(double *);
  234. extern double derf_(double *);
  235. extern double derfc_(double *);
  236. extern integer do_fio(ftnint *, char *, ftnlen);
  237. extern integer do_lio(ftnint *, ftnint *, char *, ftnlen);
  238. extern integer do_uio(ftnint *, char *, ftnlen);
  239. extern integer e_rdfe(void);
  240. extern integer e_rdue(void);
  241. extern integer e_rsfe(void);
  242. extern integer e_rsfi(void);
  243. extern integer e_rsle(void);
  244. extern integer e_rsli(void);
  245. extern integer e_rsue(void);
  246. extern integer e_wdfe(void);
  247. extern integer e_wdue(void);
  248. extern integer e_wsfe(void);
  249. extern integer e_wsfi(void);
  250. extern integer e_wsle(void);
  251. extern integer e_wsli(void);
  252. extern integer e_wsue(void);
  253. extern int ef1asc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
  254. extern integer ef1cmc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
  255. extern double erf(double);
  256. extern double erf_(float *);
  257. extern double erfc(double);
  258. extern double erfc_(float *);
  259. extern integer f_back(alist *);
  260. extern integer f_clos(cllist *);
  261. extern integer f_end(alist *);
  262. extern void f_exit(void);
  263. extern integer f_inqu(inlist *);
  264. extern integer f_open(olist *);
  265. extern integer f_rew(alist *);
  266. extern int flush_(void);
  267. extern void getarg_(integer *, char *, ftnlen);
  268. extern void getenv_(char *, char *, ftnlen, ftnlen);
  269. extern short h_abs(short *);
  270. extern short h_dim(short *, short *);
  271. extern short h_dnnt(double *);
  272. extern short h_indx(char *, char *, ftnlen, ftnlen);
  273. extern short h_len(char *, ftnlen);
  274. extern short h_mod(short *, short *);
  275. extern short h_nint(float *);
  276. extern short h_sign(short *, short *);
  277. extern short hl_ge(char *, char *, ftnlen, ftnlen);
  278. extern short hl_gt(char *, char *, ftnlen, ftnlen);
  279. extern short hl_le(char *, char *, ftnlen, ftnlen);
  280. extern short hl_lt(char *, char *, ftnlen, ftnlen);
  281. extern integer i_abs(integer *);
  282. extern integer i_dim(integer *, integer *);
  283. extern integer i_dnnt(double *);
  284. extern integer i_indx(char *, char *, ftnlen, ftnlen);
  285. extern integer i_len(char *, ftnlen);
  286. extern integer i_mod(integer *, integer *);
  287. extern integer i_nint(float *);
  288. extern integer i_sign(integer *, integer *);
  289. extern integer iargc_(void);
  290. extern ftnlen l_ge(char *, char *, ftnlen, ftnlen);
  291. extern ftnlen l_gt(char *, char *, ftnlen, ftnlen);
  292. extern ftnlen l_le(char *, char *, ftnlen, ftnlen);
  293. extern ftnlen l_lt(char *, char *, ftnlen, ftnlen);
  294. extern void pow_ci(complex *, complex *, integer *);
  295. extern double pow_dd(double *, double *);
  296. extern double pow_di(double *, integer *);
  297. extern short pow_hh(short *, shortint *);
  298. extern integer pow_ii(integer *, integer *);
  299. extern double pow_ri(float *, integer *);
  300. extern void pow_zi(doublecomplex *, doublecomplex *, integer *);
  301. extern void pow_zz(doublecomplex *, doublecomplex *, doublecomplex *);
  302. extern double r_abs(float *);
  303. extern double r_acos(float *);
  304. extern double r_asin(float *);
  305. extern double r_atan(float *);
  306. extern double r_atn2(float *, float *);
  307. extern void r_cnjg(complex *, complex *);
  308. extern double r_cos(float *);
  309. extern double r_cosh(float *);
  310. extern double r_dim(float *, float *);
  311. extern double r_exp(float *);
  312. extern double r_imag(complex *);
  313. extern double r_int(float *);
  314. extern double r_lg10(float *);
  315. extern double r_log(float *);
  316. extern double r_mod(float *, float *);
  317. extern double r_nint(float *);
  318. extern double r_sign(float *, float *);
  319. extern double r_sin(float *);
  320. extern double r_sinh(float *);
  321. extern double r_sqrt(float *);
  322. extern double r_tan(float *);
  323. extern double r_tanh(float *);
  324. extern void s_cat(char *, char **, integer *, integer *, ftnlen);
  325. extern integer s_cmp(char *, char *, ftnlen, ftnlen);
  326. extern void s_copy(char *, char *, ftnlen, ftnlen);
  327. extern int s_paus(char *, ftnlen);
  328. extern integer s_rdfe(cilist *);
  329. extern integer s_rdue(cilist *);
  330. extern integer s_rnge(char *, integer, char *, integer);
  331. extern integer s_rsfe(cilist *);
  332. extern integer s_rsfi(icilist *);
  333. extern integer s_rsle(cilist *);
  334. extern integer s_rsli(icilist *);
  335. extern integer s_rsne(cilist *);
  336. extern integer s_rsni(icilist *);
  337. extern integer s_rsue(cilist *);
  338. extern int s_stop(char *, ftnlen);
  339. extern integer s_wdfe(cilist *);
  340. extern integer s_wdue(cilist *);
  341. extern integer s_wsfe(cilist *);
  342. extern integer s_wsfi(icilist *);
  343. extern integer s_wsle(cilist *);
  344. extern integer s_wsli(icilist *);
  345. extern integer s_wsne(cilist *);
  346. extern integer s_wsni(icilist *);
  347. extern integer s_wsue(cilist *);
  348. extern void sig_die(char *, int);
  349. extern integer signal_(integer *, void (*)(int));
  350. extern integer system_(char *, ftnlen);
  351. extern double z_abs(doublecomplex *);
  352. extern void z_cos(doublecomplex *, doublecomplex *);
  353. extern void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
  354. extern void z_exp(doublecomplex *, doublecomplex *);
  355. extern void z_log(doublecomplex *, doublecomplex *);
  356. extern void z_sin(doublecomplex *, doublecomplex *);
  357. extern void z_sqrt(doublecomplex *, doublecomplex *);
  358. }
  359. #endif