Changeset c8371b5
- Timestamp:
- Oct 10, 2021, 5:02:46 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 321a1b15
- Parents:
- fe8c31e
- git-author:
- Peter A. Buhr <pabuhr@…> (10/10/21 16:59:59)
- git-committer:
- Peter A. Buhr <pabuhr@…> (10/10/21 17:02:46)
- Location:
- libcfa/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
rfe8c31e rc8371b5 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 6 18:39:13202113 // Update Count : 5 0812 // Last Modified On : Sun Oct 10 11:23:05 2021 13 // Update Count : 512 14 14 // 15 15 … … 206 206 } // ?{} 207 207 208 bool getANL$( ifstream & os ) { return os.nlOnOff$; } 209 208 210 inline void lock( ifstream & os ) with( os ) { lock( os.lock$ ); } 209 211 inline void unlock( ifstream & os ) { unlock( os.lock$ ); } … … 215 217 void ^?{}( ifstream & is ) { close( is ); } 216 218 219 bool fail( ifstream & is ) { return is.file$ == 0p || ferror( (FILE *)(is.file$) ); } 220 void clear( ifstream & is ) { clearerr( (FILE *)(is.file$) ); } 221 217 222 void nlOn( ifstream & os ) { os.nlOnOff$ = true; } 218 223 void nlOff( ifstream & os ) { os.nlOnOff$ = false; } 219 bool getANL( ifstream & os ) { return os.nlOnOff$; } 220 221 bool fail( ifstream & is ) { return is.file$ == 0p || ferror( (FILE *)(is.file$) ); } 222 void clear( ifstream & is ) { clearerr( (FILE *)(is.file$) ); } 223 224 void ends( ifstream & is ) { 225 } // ends 226 227 bool eof( ifstream & is ) { return feof( (FILE *)(is.file$) ); } 224 225 void ends( ifstream & is ) {} 226 227 bool eof( ifstream & is ) { return feof( (FILE *)(is.file$) ) != 0; } 228 228 229 229 void open( ifstream & is, const char name[], const char mode[] ) { -
libcfa/src/fstream.hfa
rfe8c31e rc8371b5 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 6 18:45:49202113 // Update Count : 24 012 // Last Modified On : Sun Oct 10 09:37:32 2021 13 // Update Count : 243 14 14 // 15 15 … … 77 77 void open( ofstream &, const char name[] ); 78 78 void close( ofstream & ); 79 79 80 ofstream & write( ofstream &, const char data[], size_t size ); 80 81 … … 105 106 106 107 // private 108 bool getANL$( ifstream & ); 109 107 110 void lock( ifstream & ); 108 111 void unlock( ifstream & ); … … 111 114 void nlOn( ifstream & ); 112 115 void nlOff( ifstream & ); 113 bool getANL( ifstream & );114 116 void ends( ifstream & ); 115 117 int fmt( ifstream &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) )); … … 121 123 void open( ifstream & is, const char name[] ); 122 124 void close( ifstream & is ); 125 123 126 ifstream & read( ifstream & is, char data[], size_t size ); 124 127 ifstream & ungetc( ifstream & is, char c ); -
libcfa/src/iostream.cfa
rfe8c31e rc8371b5 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 6 18:55:03202113 // Update Count : 134 412 // Last Modified On : Sun Oct 10 09:28:17 2021 13 // Update Count : 1345 14 14 // 15 15 … … 822 822 fmt( is, "%c", &temp ); // must pass pointer through varg to fmt 823 823 // do not overwrite parameter with newline unless appropriate 824 if ( temp != '\n' || getANL ( is ) ) { c = temp; break; }824 if ( temp != '\n' || getANL$( is ) ) { c = temp; break; } 825 825 if ( eof( is ) ) break; 826 826 } // for -
libcfa/src/iostream.hfa
rfe8c31e rc8371b5 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 6 18:54:59202113 // Update Count : 40 412 // Last Modified On : Sun Oct 10 10:02:07 2021 13 // Update Count : 407 14 14 // 15 15 … … 291 291 292 292 trait basic_istream( istype & ) { 293 bool getANL( istype & ); // get scan newline (on/off) 293 // private 294 bool getANL$( istype & ); // get scan newline (on/off) 295 // public 294 296 void nlOn( istype & ); // read newline 295 297 void nlOff( istype & ); // scan newline 296 297 298 void ends( istype & os ); // end of output statement 298 299 int fmt( istype &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) ));
Note: See TracChangeset
for help on using the changeset viewer.