Changeset 7dc2e57b for libcfa/src/fstream.cfa
- Timestamp:
- Jul 15, 2019, 2:43:38 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a87d40b, e67991f
- Parents:
- ce12e2b (diff), 4f37255 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
rce12e2b r7dc2e57b 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 12 12:03:53201913 // Update Count : 34 412 // Last Modified On : Sun Jul 14 11:51:10 2019 13 // Update Count : 347 14 14 // 15 15 … … 119 119 #ifdef __CFA_DEBUG__ 120 120 if ( file == 0 ) { 121 abort ( IO_MSG "open output file \"%s\", %s", name, strerror( errno ));121 abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno ); 122 122 } // if 123 123 #endif // __CFA_DEBUG__ … … 133 133 134 134 if ( fclose( (FILE *)(os.file) ) == EOF ) { 135 abort ( IO_MSG "close output %s", strerror( errno ));135 abort | IO_MSG "close output" | nl | strerror( errno ); 136 136 } // if 137 137 } // close … … 139 139 ofstream & write( ofstream & os, const char * data, size_t size ) { 140 140 if ( fail( os ) ) { 141 abort ( "attempt write I/O on failed stream\n" );141 abort | IO_MSG "attempt write I/O on failed stream"; 142 142 } // if 143 143 144 144 if ( fwrite( data, 1, size, (FILE *)(os.file) ) != size ) { 145 abort ( IO_MSG "write %s", strerror( errno ));145 abort | IO_MSG "write" | nl | strerror( errno ); 146 146 } // if 147 147 return os; … … 154 154 if ( len == EOF ) { 155 155 if ( ferror( (FILE *)(os.file) ) ) { 156 abort ( "invalid write\n" );156 abort | IO_MSG "invalid write"; 157 157 } // if 158 158 } // if … … 211 211 #ifdef __CFA_DEBUG__ 212 212 if ( file == 0 ) { 213 abort ( IO_MSG "open input file \"%s\", %s\n", name, strerror( errno ));213 abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno ); 214 214 } // if 215 215 #endif // __CFA_DEBUG__ … … 225 225 226 226 if ( fclose( (FILE *)(is.file) ) == EOF ) { 227 abort ( IO_MSG "close input %s", strerror( errno ));227 abort | IO_MSG "close input" | nl | strerror( errno ); 228 228 } // if 229 229 } // close … … 231 231 ifstream & read( ifstream & is, char * data, size_t size ) { 232 232 if ( fail( is ) ) { 233 abort ( "attempt read I/O on failed stream\n" );233 abort | IO_MSG "attempt read I/O on failed stream"; 234 234 } // if 235 235 236 236 if ( fread( data, size, 1, (FILE *)(is.file) ) == 0 ) { 237 abort ( IO_MSG "read %s", strerror( errno ));237 abort | IO_MSG "read" | nl | strerror( errno ); 238 238 } // if 239 239 return is; … … 242 242 ifstream &ungetc( ifstream & is, char c ) { 243 243 if ( fail( is ) ) { 244 abort ( "attempt ungetc I/O on failed stream\n" );244 abort | IO_MSG "attempt ungetc I/O on failed stream"; 245 245 } // if 246 246 247 247 if ( ungetc( c, (FILE *)(is.file) ) == EOF ) { 248 abort ( IO_MSG "ungetc %s", strerror( errno ));248 abort | IO_MSG "ungetc" | nl | strerror( errno ); 249 249 } // if 250 250 return is; … … 258 258 if ( len == EOF ) { 259 259 if ( ferror( (FILE *)(is.file) ) ) { 260 abort ( "invalid read\n" );260 abort | IO_MSG "invalid read"; 261 261 } // if 262 262 } // if
Note: See TracChangeset
for help on using the changeset viewer.