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