Changeset 874b16e


Ignore:
Timestamp:
Jun 5, 2023, 10:33:25 PM (4 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ast-experimental, master
Children:
6a93e4d
Parents:
134e6d9
Message:

lower case type names open_failure, close_failure, write_failure, read_failure

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    r134e6d9 r874b16e  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr  9 14:55:54 2022
    13 // Update Count     : 515
     12// Last Modified On : Mon Jun  5 22:00:23 2023
     13// Update Count     : 518
    1414//
    1515
     
    117117    } // for
    118118        if ( file == 0p ) {
    119                 throw (Open_Failure){ os };
     119                throw (open_failure){ os };
    120120                // abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno );
    121121        } // if
     
    137137    } // for
    138138        if ( ret == EOF ) {
    139                 throw (Close_Failure){ os };
     139                throw (close_failure){ os };
    140140                // abort | IO_MSG "close output" | nl | strerror( errno );
    141141        } // if
     
    145145ofstream & write( ofstream & os, const char data[], size_t size ) {
    146146        if ( fail( os ) ) {
    147                 throw (Write_Failure){ os };
     147                throw (write_failure){ os };
    148148                // abort | IO_MSG "attempt write I/O on failed stream";
    149149        } // if
    150150
    151151        if ( fwrite( data, 1, size, (FILE *)(os.file$) ) != size ) {
    152                 throw (Write_Failure){ os };
     152                throw (write_failure){ os };
    153153                // abort | IO_MSG "write" | nl | strerror( errno );
    154154        } // if
     
    240240    } // for
    241241        if ( file == 0p ) {
    242                 throw (Open_Failure){ is };
     242                throw (open_failure){ is };
    243243                // abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno );
    244244        } // if
     
    260260    } // for
    261261        if ( ret == EOF ) {
    262                 throw (Close_Failure){ is };
     262                throw (close_failure){ is };
    263263                // abort | IO_MSG "close input" | nl | strerror( errno );
    264264        } // if
     
    268268ifstream & read( ifstream & is, char data[], size_t size ) {
    269269        if ( fail( is ) ) {
    270                 throw (Read_Failure){ is };
     270                throw (read_failure){ is };
    271271                // abort | IO_MSG "attempt read I/O on failed stream";
    272272        } // if
    273273
    274274        if ( fread( data, size, 1, (FILE *)(is.file$) ) == 0 ) {
    275                 throw (Read_Failure){ is };
     275                throw (read_failure){ is };
    276276                // abort | IO_MSG "read" | nl | strerror( errno );
    277277        } // if
     
    318318
    319319
    320 static vtable(Open_Failure) Open_Failure_vt;
     320static vtable(open_failure) open_failure_vt;
    321321
    322322// exception I/O constructors
    323 void ?{}( Open_Failure & ex, ofstream & ostream ) with(ex) {
    324         virtual_table = &Open_Failure_vt;
     323void ?{}( open_failure & ex, ofstream & ostream ) with(ex) {
     324        virtual_table = &open_failure_vt;
    325325        ostream = &ostream;
    326326        tag = 1;
    327327} // ?{}
    328328
    329 void ?{}( Open_Failure & ex, ifstream & istream ) with(ex) {
    330         virtual_table = &Open_Failure_vt;
     329void ?{}( open_failure & ex, ifstream & istream ) with(ex) {
     330        virtual_table = &open_failure_vt;
    331331        istream = &istream;
    332332        tag = 0;
     
    334334
    335335
    336 static vtable(Close_Failure) Close_Failure_vt;
     336static vtable(close_failure) close_failure_vt;
    337337
    338338// exception I/O constructors
    339 void ?{}( Close_Failure & ex, ofstream & ostream ) with(ex) {
    340         virtual_table = &Close_Failure_vt;
     339void ?{}( close_failure & ex, ofstream & ostream ) with(ex) {
     340        virtual_table = &close_failure_vt;
    341341        ostream = &ostream;
    342342        tag = 1;
    343343} // ?{}
    344344
    345 void ?{}( Close_Failure & ex, ifstream & istream ) with(ex) {
    346         virtual_table = &Close_Failure_vt;
     345void ?{}( close_failure & ex, ifstream & istream ) with(ex) {
     346        virtual_table = &close_failure_vt;
    347347        istream = &istream;
    348348        tag = 0;
     
    350350
    351351
    352 static vtable(Write_Failure) Write_Failure_vt;
     352static vtable(write_failure) write_failure_vt;
    353353
    354354// exception I/O constructors
    355 void ?{}( Write_Failure & ex, ofstream & ostream ) with(ex) {
    356         virtual_table = &Write_Failure_vt;
     355void ?{}( write_failure & ex, ofstream & ostream ) with(ex) {
     356        virtual_table = &write_failure_vt;
    357357        ostream = &ostream;
    358358        tag = 1;
    359359} // ?{}
    360360
    361 void ?{}( Write_Failure & ex, ifstream & istream ) with(ex) {
    362         virtual_table = &Write_Failure_vt;
     361void ?{}( write_failure & ex, ifstream & istream ) with(ex) {
     362        virtual_table = &write_failure_vt;
    363363        istream = &istream;
    364364        tag = 0;
     
    366366
    367367
    368 static vtable(Read_Failure) Read_Failure_vt;
     368static vtable(read_failure) read_failure_vt;
    369369
    370370// exception I/O constructors
    371 void ?{}( Read_Failure & ex, ofstream & ostream ) with(ex) {
    372         virtual_table = &Read_Failure_vt;
     371void ?{}( read_failure & ex, ofstream & ostream ) with(ex) {
     372        virtual_table = &read_failure_vt;
    373373        ostream = &ostream;
    374374        tag = 1;
    375375} // ?{}
    376376
    377 void ?{}( Read_Failure & ex, ifstream & istream ) with(ex) {
    378         virtual_table = &Read_Failure_vt;
     377void ?{}( read_failure & ex, ifstream & istream ) with(ex) {
     378        virtual_table = &read_failure_vt;
    379379        istream = &istream;
    380380        tag = 0;
    381381} // ?{}
    382382
    383 // void throwOpen_Failure( ofstream & ostream ) {
    384 //      Open_Failure exc = { ostream };
     383// void throwopen_failure( ofstream & ostream ) {
     384//      open_failure exc = { ostream };
    385385// }
    386386
    387 // void throwOpen_Failure( ifstream & istream ) {
    388 //      Open_Failure exc = { istream };
     387// void throwopen_failure( ifstream & istream ) {
     388//      open_failure exc = { istream };
    389389// }
    390390
  • libcfa/src/fstream.hfa

    r134e6d9 r874b16e  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct 10 09:37:32 2021
    13 // Update Count     : 243
     12// Last Modified On : Mon Jun  5 22:00:20 2023
     13// Update Count     : 246
    1414//
    1515
     
    137137
    138138
    139 exception Open_Failure {
     139exception open_failure {
    140140        union {
    141141                ofstream * ostream;
     
    146146};
    147147
    148 void ?{}( Open_Failure & this, ofstream & );
    149 void ?{}( Open_Failure & this, ifstream & );
     148void ?{}( open_failure & this, ofstream & );
     149void ?{}( open_failure & this, ifstream & );
    150150
    151 exception Close_Failure {
     151exception close_failure {
    152152        union {
    153153                ofstream * ostream;
     
    158158};
    159159
    160 void ?{}( Close_Failure & this, ofstream & );
    161 void ?{}( Close_Failure & this, ifstream & );
     160void ?{}( close_failure & this, ofstream & );
     161void ?{}( close_failure & this, ifstream & );
    162162
    163 exception Write_Failure {
     163exception write_failure {
    164164        union {
    165165                ofstream * ostream;
     
    170170};
    171171
    172 void ?{}( Write_Failure & this, ofstream & );
    173 void ?{}( Write_Failure & this, ifstream & );
     172void ?{}( write_failure & this, ofstream & );
     173void ?{}( write_failure & this, ifstream & );
    174174
    175 exception Read_Failure {
     175exception read_failure {
    176176        union {
    177177                ofstream * ostream;
     
    182182};
    183183
    184 void ?{}( Read_Failure & this, ofstream & );
    185 void ?{}( Read_Failure & this, ifstream & );
     184void ?{}( read_failure & this, ofstream & );
     185void ?{}( read_failure & this, ifstream & );
    186186
    187187// Local Variables: //
  • libcfa/src/parseconfig.cfa

    r134e6d9 r874b16e  
    144144                        in | nl;                                                                // ignore remainder of line
    145145                } // for
    146         } catch( Open_Failure * ex; ex->istream == &in ) {
     146        } catch( open_failure * ex; ex->istream == &in ) {
    147147                delete( kv_pairs );
    148148                throw *ex;
  • tests/.expect/copyfile.txt

    r134e6d9 r874b16e  
    1010// Created On       : Fri Jun 19 13:44:05 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun 19 17:58:03 2020
    13 // Update Count     : 4
     12// Last Modified On : Mon Jun  5 21:20:07 2023
     13// Update Count     : 5
    1414//
    1515
     
    3030                        exit | "Usage" | argv[0] | "[ input-file (default stdin) [ output-file (default stdout) ] ]";
    3131                } // choose
    32         } catch( Open_Failure * ex ; ex->istream == &in ) {
     32        } catch( open_failure * ex ; ex->istream == &in ) {
    3333                exit | "Unable to open input file" | argv[1];
    34         } catch( Open_Failure * ex ; ex->ostream == &out ) {
     34        } catch( open_failure * ex ; ex->ostream == &out ) {
    3535                close( in );                                                                    // optional
    3636                exit | "Unable to open output file" | argv[2];
  • tests/.in/copyfile.txt

    r134e6d9 r874b16e  
    1010// Created On       : Fri Jun 19 13:44:05 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun 19 17:58:03 2020
    13 // Update Count     : 4
     12// Last Modified On : Mon Jun  5 21:20:07 2023
     13// Update Count     : 5
    1414//
    1515
     
    3030                        exit | "Usage" | argv[0] | "[ input-file (default stdin) [ output-file (default stdout) ] ]";
    3131                } // choose
    32         } catch( Open_Failure * ex ; ex->istream == &in ) {
     32        } catch( open_failure * ex ; ex->istream == &in ) {
    3333                exit | "Unable to open input file" | argv[1];
    34         } catch( Open_Failure * ex ; ex->ostream == &out ) {
     34        } catch( open_failure * ex ; ex->ostream == &out ) {
    3535                close( in );                                                                    // optional
    3636                exit | "Unable to open output file" | argv[2];
  • tests/configs/.expect/parseconfig.txt

    r134e6d9 r874b16e  
    1212Maximum student trips: 3
    1313
    14 Open_Failure thrown when config file does not exist
     14open_failure thrown when config file does not exist
    1515Failed to open the config file
    1616
  • tests/configs/parseconfig.cfa

    r134e6d9 r874b16e  
    6666
    6767
    68         sout | "Open_Failure thrown when config file does not exist";
     68        sout | "open_failure thrown when config file does not exist";
    6969        try {
    7070                parse_config( xstr(IN_DIR) "doesnt-exist.txt", entries, NUM_ENTRIES, parse_tabular_config_format );
    71         } catch( Open_Failure * ex ) {
     71        } catch( open_failure * ex ) {
    7272                sout | "Failed to open the config file";
    7373        }
  • tests/copyfile.cfa

    r134e6d9 r874b16e  
    1010// Created On       : Fri Jun 19 13:44:05 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 15 15:00:48 2020
    13 // Update Count     : 6
     12// Last Modified On : Mon Jun  5 21:20:19 2023
     13// Update Count     : 7
    1414//
    1515
     
    3030                        exit | "Usage" | argv[0] | "[ input-file (default stdin) [ output-file (default stdout) ] ]";
    3131                } // choose
    32         } catch( Open_Failure * ex ; ex->istream == &in ) {
     32        } catch( open_failure * ex ; ex->istream == &in ) {
    3333                exit | "Unable to open input file" | argv[1];
    34         } catch( Open_Failure * ex ; ex->ostream == &out ) {
     34        } catch( open_failure * ex ; ex->ostream == &out ) {
    3535                close( in );                                                                    // optional
    3636                exit | "Unable to open output file" | argv[2];
Note: See TracChangeset for help on using the changeset viewer.