OSDN Git Service

Warning fixes:
[pf3gnuchains/gcc-fork.git] / libchill / iomodes.h
1 /* Implement Input/Output runtime actions for CHILL.
2    Copyright (C) 1992,1993 Free Software Foundation, Inc.
3    Author: Wilfried Moser, et al
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20
21 /* As a special exception, if you link this library with other files,
22    some of which are compiled with GCC, to produce an executable,
23    this library does not by itself cause the resulting executable
24    to be covered by the GNU General Public License.
25    This exception does not however invalidate any other reasons why
26    the executable file might be covered by the GNU General Public License.  */
27
28 #ifndef _iomodes_h_
29 #define _iomodes_h_
30
31 #include "auxtypes.h"
32
33 typedef enum { ReadOnly, WriteOnly, ReadWrite
34 } Usage_Mode;
35
36 typedef enum { First, Same, Last
37 } Where_Mode;
38
39 typedef enum { None, Fixed, VaryingChars
40 } Record_t;
41
42 /* association flags */
43 #define IO_ISASSOCIATED 0x00000001
44 #define IO_EXISTING     0x00000002
45 #define IO_READABLE     0x00000004
46 #define IO_WRITEABLE    0x00000008
47 #define IO_INDEXABLE    0x00000010
48 #define IO_SEQUENCIBLE  0x00000020
49 #define IO_VARIABLE     0x00000040
50 #define IO_FIRSTLINE    0x00000100
51 #define IO_FORCE_PAGE   0x00000200
52
53 struct Access_Mode;
54
55 #define READBUFLEN 512
56 typedef struct
57 {
58   unsigned long len;
59   unsigned long cur;
60   char buf[READBUFLEN];
61 } readbuf_t;
62
63 typedef struct Association_Mode {
64   unsigned long       flags;      /* INIT = 0 */
65   char*               pathname;
66   struct Access_Mode* access;
67   int                 handle;
68   readbuf_t*          bufptr;
69   long                syserrno;
70   char                usage;
71   char                ctl_pre;
72   char                ctl_post;
73 } Association_Mode;
74
75 /*
76    rectype   indexed   max. reclength    act. reclength
77    ---------------------------------------------------
78    None        T/F        0
79    Fixed       T/F     SIZE(recmode)  =  SIZE(recmode)
80    Varying       F     SIZE(recmode) >=  length
81 */
82
83 /* access/text flags */
84 #define IO_TEXTLOCATION 0x80000000
85 #define IO_INDEXED      0x00000001
86 #define IO_TEXTIO       0x00000002
87 #define IO_OUTOFFILE    0x00010000
88
89 typedef struct Access_Mode {
90   unsigned long     flags;     /* INIT */   
91   unsigned long     reclength; /* INIT */
92   signed long       lowindex;  /* INIT */
93   signed long       highindex; /* INIT */
94   Association_Mode* association;
95   unsigned long     base;
96   char*             store_loc;
97   Record_t          rectype;   /* INIT */
98 } Access_Mode;
99
100 typedef struct Text_Mode {
101   unsigned long flags;         /* INIT */
102   VarString*    text_record;   /* INIT */
103   Access_Mode*  access_sub;    /* INIT */
104   unsigned long actual_index;
105 } Text_Mode;
106
107 typedef enum
108 {
109     __IO_UNUSED,
110
111     __IO_ByteVal,
112     __IO_UByteVal,
113     __IO_IntVal,
114     __IO_UIntVal,
115     __IO_LongVal,
116     __IO_ULongVal,
117
118     __IO_ByteLoc,
119     __IO_UByteLoc,
120     __IO_IntLoc,
121     __IO_UIntLoc,
122     __IO_LongLoc,
123     __IO_ULongLoc,
124
125     __IO_ByteRangeLoc,
126     __IO_UByteRangeLoc,
127     __IO_IntRangeLoc,
128     __IO_UIntRangeLoc,
129     __IO_LongRangeLoc,
130     __IO_ULongRangeLoc,
131
132     __IO_BoolVal,
133     __IO_BoolLoc,
134     __IO_BoolRangeLoc,
135
136     __IO_SetVal,
137     __IO_SetLoc,
138     __IO_SetRangeLoc,
139
140     __IO_CharVal,
141     __IO_CharLoc,
142     __IO_CharRangeLoc,
143
144     __IO_CharStrLoc,
145
146     __IO_CharVaryingLoc,
147
148     __IO_BitStrLoc,
149
150     __IO_RealVal,
151     __IO_RealLoc,
152     __IO_LongRealVal,
153     __IO_LongRealLoc
154 } __tmp_IO_enum;
155
156 typedef struct
157 {
158     long        value;
159     char*       name;
160 } __tmp_IO_enum_table_type;
161
162 typedef struct
163 {
164     long                      value;
165     __tmp_IO_enum_table_type* name_table;
166 } __tmp_WIO_set;
167
168 typedef struct
169 {
170     char*       ptr;
171     long        lower;
172     long        upper;
173 } __tmp_IO_charrange;
174
175 typedef union
176 {
177       signed long  slong;
178     unsigned long  ulong;
179 }  __tmp_IO_long;
180
181 typedef struct
182 {
183     void*         ptr;
184     __tmp_IO_long lower;
185     __tmp_IO_long upper;
186 } __tmp_IO_intrange;
187
188 typedef struct
189 {
190     void*           ptr;
191     unsigned long   lower;
192     unsigned long   upper;
193 } __tmp_RIO_boolrange;
194
195 typedef struct
196 {
197     void*                     ptr;
198     long                      length;
199     __tmp_IO_enum_table_type* name_table;
200 } __tmp_RIO_set;
201
202 typedef struct
203 {
204     void*                      ptr;
205     long                       length;
206     __tmp_IO_enum_table_type*  name_table;
207     unsigned long              lower;
208     unsigned long              upper;
209 } __tmp_RIO_setrange;
210
211 typedef struct
212 {
213     char*       string;
214     long        string_length;
215 } __tmp_IO_charstring;
216
217 typedef union
218 {
219     char                     __valbyte;
220     unsigned char            __valubyte;
221     short                    __valint;
222     unsigned short           __valuint;
223     long                     __vallong;
224     unsigned long            __valulong;
225     void*                    __locint;
226     __tmp_IO_intrange        __locintrange;
227
228     unsigned char            __valbool;
229     unsigned char*           __locbool;
230     __tmp_RIO_boolrange      __locboolrange;
231
232     __tmp_WIO_set            __valset;
233     __tmp_RIO_set            __locset;
234     __tmp_RIO_setrange       __locsetrange;
235
236     unsigned char            __valchar;
237     unsigned char*           __locchar;
238     __tmp_IO_charrange       __loccharrange;
239
240     __tmp_IO_charstring      __loccharstring;
241
242     float                    __valreal;
243     float*                   __locreal;
244     double                   __vallongreal;
245     double*                  __loclongreal;
246 } __tmp_IO_union;
247
248 /*
249  * CAUTION: The longest variant of __tmp_IO_union is 5 words long.
250  * Together with __descr this caters for double alignment where required.
251  */
252 typedef struct
253 {
254     __tmp_IO_union    __t;
255     __tmp_IO_enum     __descr;
256 } __tmp_IO_list;
257
258 #endif