Commit | Line | Data |
---|---|---|
e75247ce | 1 | /* |
161423a6 RE |
2 | * Copyright (c) 1980 Regents of the University of California. |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
e75247ce | 5 | * |
60fce068 | 6 | * @(#)fiodefs.h 5.2 (Berkeley) %G% |
161423a6 RE |
7 | */ |
8 | ||
9 | /* | |
e75247ce DW |
10 | * fortran file i/o type definitions |
11 | */ | |
12 | ||
13 | #include <stdio.h> | |
14 | #include "f_errno.h" | |
15 | ||
16 | /* Logical Unit Table Size */ | |
b6bccb7d | 17 | #define MXUNIT 100 |
e75247ce DW |
18 | |
19 | #define GLITCH '\2' /* special quote for Stu, generated in f77pass1 */ | |
20 | ||
60fce068 | 21 | #define NAMELIST -2 |
e75247ce DW |
22 | #define LISTDIRECTED -1 |
23 | #define FORMATTED 1 | |
24 | ||
25 | #define ERROR 1 | |
26 | #define OK 0 | |
27 | #define YES 1 | |
28 | #define NO 0 | |
29 | ||
30 | #define STDERR 0 | |
31 | #define STDIN 5 | |
32 | #define STDOUT 6 | |
33 | ||
34 | #define WRITE 1 | |
35 | #define READ 2 | |
36 | #define SEQ 3 | |
37 | #define DIR 4 | |
38 | #define FMT 5 | |
39 | #define UNF 6 | |
40 | #define EXT 7 | |
41 | #define INT 8 | |
42 | ||
43 | typedef char ioflag; | |
44 | typedef long ftnint; | |
45 | typedef ftnint flag; | |
46 | typedef long ftnlen; | |
47 | ||
48 | typedef struct /*external read, write*/ | |
49 | { flag cierr; | |
50 | ftnint ciunit; | |
51 | flag ciend; | |
52 | char *cifmt; | |
53 | ftnint cirec; | |
54 | } cilist; | |
55 | ||
56 | typedef struct /*internal read, write*/ | |
57 | { flag icierr; | |
58 | char *iciunit; | |
59 | flag iciend; | |
60 | char *icifmt; | |
61 | ftnint icirlen; | |
62 | ftnint icirnum; | |
63 | ftnint icirec; | |
64 | } icilist; | |
65 | ||
66 | typedef struct /*open*/ | |
67 | { flag oerr; | |
68 | ftnint ounit; | |
69 | char *ofnm; | |
70 | ftnlen ofnmlen; | |
71 | char *osta; | |
72 | char *oacc; | |
73 | char *ofm; | |
74 | ftnint orl; | |
75 | char *oblnk; | |
76 | } olist; | |
77 | ||
78 | typedef struct /*close*/ | |
79 | { flag cerr; | |
80 | ftnint cunit; | |
81 | char *csta; | |
82 | } cllist; | |
83 | ||
84 | typedef struct /*rewind, backspace, endfile*/ | |
85 | { flag aerr; | |
86 | ftnint aunit; | |
87 | } alist; | |
88 | ||
89 | typedef struct /*units*/ | |
90 | { FILE *ufd; /*0=unconnected*/ | |
91 | char *ufnm; | |
92 | long uinode; | |
93 | int url; /*0=sequential*/ | |
94 | flag useek; /*true=can backspace, use dir, ...*/ | |
95 | flag ufmt; | |
96 | flag uprnt; | |
97 | flag ublnk; | |
98 | flag uend; | |
99 | flag uwrt; /*last io was write*/ | |
100 | flag uscrtch; | |
101 | } unit; | |
102 | ||
103 | typedef struct /* inquire */ | |
104 | { flag inerr; | |
105 | ftnint inunit; | |
106 | char *infile; | |
107 | ftnlen infilen; | |
108 | ftnint *inex; /*parameters in standard's order*/ | |
109 | ftnint *inopen; | |
110 | ftnint *innum; | |
111 | ftnint *innamed; | |
112 | char *inname; | |
113 | ftnlen innamlen; | |
114 | char *inacc; | |
115 | ftnlen inacclen; | |
116 | char *inseq; | |
117 | ftnlen inseqlen; | |
118 | char *indir; | |
119 | ftnlen indirlen; | |
120 | char *inform; | |
121 | ftnlen informlen; | |
122 | char *infmt; | |
123 | ftnint infmtlen; | |
124 | char *inunf; | |
125 | ftnlen inunflen; | |
126 | ftnint *inrecl; | |
127 | ftnint *innrec; | |
128 | char *inblank; | |
129 | ftnlen inblanklen; | |
130 | } inlist; | |
131 | ||
132 | typedef union | |
133 | { float pf; | |
134 | double pd; | |
135 | } ufloat; | |
136 | ||
137 | typedef union | |
138 | { short is; | |
139 | char ic; | |
140 | long il; | |
141 | } uint; | |
142 | ||
3ff0834a | 143 | struct ioiflg { |
2297a6f8 | 144 | short if_oeof; |
3ff0834a DW |
145 | short if_ctrl; |
146 | short if_bzro; | |
147 | }; | |
2297a6f8 | 148 | #define opneof ioiflg_.if_oeof |
3ff0834a DW |
149 | #define ccntrl ioiflg_.if_ctrl |
150 | #define blzero ioiflg_.if_bzro |