| 1 | /* |
| 2 | char id_fiodefs[] = "@(#)fiodefs.h 1.1"; |
| 3 | * |
| 4 | * fortran file i/o type definitions |
| 5 | */ |
| 6 | |
| 7 | #include <stdio.h> |
| 8 | #include "f_errno.h" |
| 9 | |
| 10 | /* Logical Unit Table Size */ |
| 11 | #define MXUNIT _NFILE |
| 12 | |
| 13 | #define GLITCH '\2' /* special quote for Stu, generated in f77pass1 */ |
| 14 | |
| 15 | #define LISTDIRECTED -1 |
| 16 | #define FORMATTED 1 |
| 17 | |
| 18 | #define ERROR 1 |
| 19 | #define OK 0 |
| 20 | #define YES 1 |
| 21 | #define NO 0 |
| 22 | |
| 23 | #define STDERR 0 |
| 24 | #define STDIN 5 |
| 25 | #define STDOUT 6 |
| 26 | |
| 27 | #define WRITE 1 |
| 28 | #define READ 2 |
| 29 | #define SEQ 3 |
| 30 | #define DIR 4 |
| 31 | #define FMT 5 |
| 32 | #define UNF 6 |
| 33 | #define EXT 7 |
| 34 | #define INT 8 |
| 35 | |
| 36 | typedef char ioflag; |
| 37 | typedef long ftnint; |
| 38 | typedef ftnint flag; |
| 39 | typedef long ftnlen; |
| 40 | |
| 41 | typedef struct /*external read, write*/ |
| 42 | { flag cierr; |
| 43 | ftnint ciunit; |
| 44 | flag ciend; |
| 45 | char *cifmt; |
| 46 | ftnint cirec; |
| 47 | } cilist; |
| 48 | |
| 49 | typedef struct /*internal read, write*/ |
| 50 | { flag icierr; |
| 51 | char *iciunit; |
| 52 | flag iciend; |
| 53 | char *icifmt; |
| 54 | ftnint icirlen; |
| 55 | ftnint icirnum; |
| 56 | ftnint icirec; |
| 57 | } icilist; |
| 58 | |
| 59 | typedef struct /*open*/ |
| 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 | |
| 71 | typedef struct /*close*/ |
| 72 | { flag cerr; |
| 73 | ftnint cunit; |
| 74 | char *csta; |
| 75 | } cllist; |
| 76 | |
| 77 | typedef struct /*rewind, backspace, endfile*/ |
| 78 | { flag aerr; |
| 79 | ftnint aunit; |
| 80 | } alist; |
| 81 | |
| 82 | typedef struct /*units*/ |
| 83 | { FILE *ufd; /*0=unconnected*/ |
| 84 | char *ufnm; |
| 85 | long uinode; |
| 86 | int url; /*0=sequential*/ |
| 87 | flag useek; /*true=can backspace, use dir, ...*/ |
| 88 | flag ufmt; |
| 89 | flag uprnt; |
| 90 | flag ublnk; |
| 91 | flag uend; |
| 92 | flag uwrt; /*last io was write*/ |
| 93 | flag uscrtch; |
| 94 | } unit; |
| 95 | |
| 96 | typedef struct /* inquire */ |
| 97 | { flag inerr; |
| 98 | ftnint inunit; |
| 99 | char *infile; |
| 100 | ftnlen infilen; |
| 101 | ftnint *inex; /*parameters in standard's order*/ |
| 102 | ftnint *inopen; |
| 103 | ftnint *innum; |
| 104 | ftnint *innamed; |
| 105 | char *inname; |
| 106 | ftnlen innamlen; |
| 107 | char *inacc; |
| 108 | ftnlen inacclen; |
| 109 | char *inseq; |
| 110 | ftnlen inseqlen; |
| 111 | char *indir; |
| 112 | ftnlen indirlen; |
| 113 | char *inform; |
| 114 | ftnlen informlen; |
| 115 | char *infmt; |
| 116 | ftnint infmtlen; |
| 117 | char *inunf; |
| 118 | ftnlen inunflen; |
| 119 | ftnint *inrecl; |
| 120 | ftnint *innrec; |
| 121 | char *inblank; |
| 122 | ftnlen inblanklen; |
| 123 | } inlist; |
| 124 | |
| 125 | typedef union |
| 126 | { float pf; |
| 127 | double pd; |
| 128 | } ufloat; |
| 129 | |
| 130 | typedef union |
| 131 | { short is; |
| 132 | char ic; |
| 133 | long il; |
| 134 | } uint; |
| 135 | |