Changeset ae0c1c3 for libcfa/src/fstream.cfa
- Timestamp:
- Apr 25, 2025, 7:08:53 PM (8 months ago)
- Branches:
- master
- Children:
- 7d02d35, ecfa58be
- Parents:
- 65bd3c2
- File:
-
- 1 edited
-
libcfa/src/fstream.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
r65bd3c2 rae0c1c3 202 202 } // nl 203 203 204 static basic_ostream_data(ofstream) ofstream_basic_data = { 205 sepPrt$, 206 sepReset$, 207 sepReset$, 208 sepGetCur$, 209 sepSetCur$, 210 getNL$, 211 setNL$, 212 getANL$, 213 setANL$, 214 getPrt$, 215 setPrt$, 216 nlOn, 217 nlOff, 218 sep, 219 nosep, 220 sepOn, 221 sepOff, 222 sepGet, 223 sepSet, 224 sepGetTuple, 225 sepSetTuple, 226 ends, 227 fmt, 228 }; 229 230 basic_ostream_data(ofstream) const & basic_ostream_table = ofstream_basic_data; 231 232 static ostream_data(ofstream) ofstream_data; 233 234 // This should be an initializer like for the basic table. 235 // But, initialization of a structure with an inline structure doesn't work. 236 __attribute__((constructor(200))) 237 static void __ofstream_data_init__() { 238 basic_ostream_data(ofstream) & basic = ofstream_data; 239 basic.sepPrt$ = sepPrt$; 240 basic.sepReset$ = (void(*)(ofstream&))sepReset$; 241 basic.sepReset$ = (void(*)(ofstream&, bool))sepReset$; 242 basic.sepGetCur$ = sepGetCur$; 243 basic.sepSetCur$ = sepSetCur$; 244 basic.getNL$ = getNL$; 245 basic.setNL$ = setNL$; 246 basic.getANL$ = getANL$; 247 basic.setANL$ = setANL$; 248 basic.getPrt$ = getPrt$; 249 basic.setPrt$ = setPrt$; 250 basic.nlOn = nlOn; 251 basic.nlOff = nlOff; 252 basic.sep = sep; 253 basic.nosep = nosep; 254 basic.sepOn = sepOn; 255 basic.sepOff = sepOff; 256 basic.sepGet = sepGet; 257 basic.sepSet = sepSet; 258 basic.sepGetTuple = sepGetTuple; 259 basic.sepSetTuple = sepSetTuple; 260 basic.ends = ends; 261 basic.fmt = fmt; 262 ofstream_data.fail = fail; 263 ofstream_data.clearerr = clearerr; 264 ofstream_data.flush = flush; 265 ofstream_data.open = open; 266 ofstream_data.close = close; 267 ofstream_data.write = write; 268 } 269 270 ostream_data(ofstream) const & ostream_table = ofstream_data; 204 271 205 272 // *********************************** ifstream *********************************** … … 211 278 nlOnOff$ = false; // => skip newlines when reading single characters 212 279 } // ?{} 280 281 static basic_istream_data(ifstream) ifstream_basic_data = { 282 getANL$, 283 setANL$, 284 nlOn, 285 nlOff, 286 fmt, 287 ungetc, 288 eof, 289 clearerr, 290 }; 291 292 basic_istream_data(ifstream) const & basic_istream_table = ifstream_basic_data; 293 294 static istream_data(ifstream) ifstream_data; 295 296 // This should be an initializer like for the basic table. 297 // But, initialization of a structure with an inline structure doesn't work. 298 __attribute__((constructor(200))) 299 static void __ifstream_data_init__() { 300 basic_istream_data(ifstream) & basic = ifstream_data; 301 basic.getANL$ = getANL$; 302 basic.setANL$ = setANL$; 303 basic.nlOn = nlOn; 304 basic.nlOff = nlOff; 305 basic.fmt = fmt; 306 basic.ungetc = ungetc; 307 basic.eof = eof; 308 basic.clearerr = clearerr; 309 ifstream_data.fail = fail; 310 ifstream_data.open = (void(*)(ifstream &, const char *, const char *))open; 311 ifstream_data.open = (void(*)(ifstream &, const char *))open; 312 ifstream_data.close = close; 313 ifstream_data.read = read; 314 } 315 316 istream_data(ifstream) const & istream_table = ifstream_data; 213 317 214 318 bool getANL$( ifstream & os ) { return os.nlOnOff$; }
Note:
See TracChangeset
for help on using the changeset viewer.