Changeset 768d091 for libcfa


Ignore:
Timestamp:
Apr 14, 2025, 9:05:58 PM (5 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
0d41e600
Parents:
10ef475
git-author:
Peter A. Buhr <pabuhr@…> (04/14/25 20:59:04)
git-committer:
Peter A. Buhr <pabuhr@…> (04/14/25 21:05:58)
Message:

rename I/O function "clear" to "clearerr"

Location:
libcfa/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/string_res.cfa

    r10ef475 r768d091  
    1010// Created On       : Fri Sep 03 11:00:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr 11 18:18:42 2025
    13 // Update Count     : 129
     12// Last Modified On : Mon Apr 14 20:45:39 2025
     13// Update Count     : 130
    1414//
    1515
     
    269269        if ( ! flags.ignore && s != 0p && args == 0 ) s[0] = '\0';
    270270        if ( args == 1 && eof( is ) ) {                                         // data but scan ended at EOF
    271                 clear( is );                                                                    // => reset EOF => detect again on next read
     271                clearerr( is );                                                                 // => reset EOF => detect again on next read
    272272        } // if
    273273        return is;
  • libcfa/src/fstream.cfa

    r10ef475 r768d091  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct  1 20:59:45 2024
    13 // Update Count     : 582
     12// Last Modified On : Mon Apr 14 20:41:51 2025
     13// Update Count     : 583
    1414//
    1515
     
    109109
    110110bool fail( ofstream & os ) { return os.file$ == 0 || ferror( (FILE *)(os.file$) ); }
    111 void clear( ofstream & os ) { clearerr( (FILE *)(os.file$) ); }
     111void clearerr( ofstream & os ) { clearerr( (FILE *)(os.file$) ); }
    112112int flush( ofstream & os ) { return fflush( (FILE *)(os.file$) ); }
    113113
     
    225225
    226226bool fail( ifstream & is ) { return is.file$ == 0p || ferror( (FILE *)(is.file$) ); }
    227 void clear( ifstream & is ) { clearerr( (FILE *)(is.file$) ); }
     227void clearerr( ifstream & is ) { clearerr( (FILE *)(is.file$) ); }
    228228
    229229void nlOn( ifstream & os ) { os.nlOnOff$ = true; }
  • libcfa/src/fstream.hfa

    r10ef475 r768d091  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 12 05:45:50 2024
    13 // Update Count     : 275
     12// Last Modified On : Mon Apr 14 20:42:01 2025
     13// Update Count     : 276
    1414//
    1515
     
    7474
    7575bool fail( ofstream & );
    76 void clear( ofstream & );
     76void clearerr( ofstream & );
    7777int flush( ofstream & );
    7878void open( ofstream &, const char name[], const char mode[] ); // FIX ME: use default = "w"
     
    122122
    123123bool fail( ifstream & is );
    124 void clear( ifstream & );
     124void clearerr( ifstream & );
    125125void open( ifstream & is, const char name[], const char mode[] ); // FIX ME: use default = "r"
    126126void open( ifstream & is, const char name[] );
  • libcfa/src/iostream.cfa

    r10ef475 r768d091  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr 11 18:19:09 2025
    13 // Update Count     : 2080
     12// Last Modified On : Mon Apr 14 20:43:14 2025
     13// Update Count     : 2081
    1414//
    1515
     
    10261026                if ( ! flags.ignore && s != 0p && args == 0 ) s[0] = '\0';
    10271027                if ( args == 1 && eof( is ) ) {                                 // data but scan ended at EOF
    1028                         clear( is );                                                            // => reset EOF => detect again on next read
     1028                        clearerr( is );                                                         // => reset EOF => detect again on next read
    10291029                } // if
    10301030                return is;
     
    11311131                } // if
    11321132                if ( args == 1 && eof( is ) ) {                                 // data but scan ended at EOF
    1133                         clear( is );                                                            // => reset EOF => detect again on next read
     1133                        clearerr( is );                                                         // => reset EOF => detect again on next read
    11341134                } // if
    11351135                return is;
     
    12261226          if ( eof( is ) ) {
    12271227                        if ( c == 0 ) return is;                                        // no characters read ?
    1228                         clear( is );                                                            // => read something => reset EOF => detect again on next read
     1228                        clearerr( is );                                                         // => read something => reset EOF => detect again on next read
    12291229                        break;
    12301230                } // if
  • libcfa/src/iostream.hfa

    r10ef475 r768d091  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr 11 18:11:25 2025
    13 // Update Count     : 766
     12// Last Modified On : Mon Apr 14 20:42:53 2025
     13// Update Count     : 767
    1414//
    1515
     
    5555trait ostream {
    5656        bool fail( ostype & );                                                          // operation failed?
    57         void clear( ostype & );
     57        void clearerr( ostype & );
    5858        int flush( ostype & );
    5959        void open( ostype &, const char name[], const char mode[] );
     
    318318        istype & ungetc( char, istype & );
    319319        bool eof( istype & );
    320         void clear( istype & );
     320        void clearerr( istype & );
    321321}; // basic_istream
    322322
  • libcfa/src/strstream.cfa

    r10ef475 r768d091  
    1010// Created On       : Thu Apr 22 22:24:35 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 12 05:45:47 2024
    13 // Update Count     : 113
     12// Last Modified On : Mon Apr 14 20:45:00 2025
     13// Update Count     : 116
    1414//
    1515
     
    145145void nlOff( istrstream & is ) { is.nlOnOff$ = false; }
    146146
    147 void ends( istrstream & is ) {}
    148 bool eof( istrstream & is ) { return false; }
    149 
    150147int fmt( istrstream & is, const char format[], ... ) with(is) {
    151148        va_list args;
     
    173170} // ungetc
    174171
     172bool eof( istrstream & is ) { return false; }
     173void clearerr( istrstream & ) {}                                                // no error flags to clear
     174void ends( istrstream & is ) {}
     175
    175176// Local Variables: //
    176177// tab-width: 4 //
  • libcfa/src/strstream.hfa

    r10ef475 r768d091  
    1010// Created On       : Thu Apr 22 22:20:59 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 12 05:45:48 2024
    13 // Update Count     : 56
     12// Last Modified On : Mon Apr 14 20:57:15 2025
     13// Update Count     : 61
    1414//
    1515
     
    7878
    7979
     80// Currently, this is a placeholder because vsscanf returns number of values read versus buffer position scanned.
     81// This issue makes it impossible to know where in the buffer the last read stopped.
     82
    8083struct istrstream {
    8184        char * buf$;
     
    8386        bool nlOnOff$;
    8487}; // istrstream
     88
     89void ?{}( istrstream &, char buf[] );
    8590
    8691// Satisfies basic_istream
     
    9398void nlOn( istrstream & );
    9499void nlOff( istrstream & );
    95 void ends( istrstream & );
    96 
    97100int fmt( istrstream &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) ));
    98101istrstream & ungetc( char, istrstream & );
    99102bool eof( istrstream & );
    100 
    101 void ?{}( istrstream &, char buf[] );
     103void clearerr( istrstream & );
     104void ends( istrstream & );
    102105
    103106// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.