Ignore:
Timestamp:
May 15, 2017, 6:43:54 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
6c6455f
Parents:
3dafd83
Message:

code formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/fstream.c

    r3dafd83 r9ebd778  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 23 08:20:41 2017
    13 // Update Count     : 226
     12// Last Modified On : Mon May 15 18:11:11 2017
     13// Update Count     : 234
    1414//
    1515
     
    3838}
    3939
     40// private
    4041_Bool sepPrt( ofstream * os ) { return os->sepOnOff; }
     42void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }
     43void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }
     44const char * sepGetCur( ofstream * os ) { return os->sepCur; }
     45void sepSetCur( ofstream * os, const char * sepCur ) { os->sepCur = sepCur; }
     46
     47// public
    4148void sepOn( ofstream * os ) { os->sepOnOff = 1; }
    4249void sepOff( ofstream * os ) { os->sepOnOff = 0; }
    43 void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }
    44 void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }
    45 
    46 const char * sepGetCur( ofstream * os ) { return os->sepCur; }
    47 void sepSetCur( ofstream * os, const char * sepCur ) { os->sepCur = sepCur; }
    48 
    49 const char * sepGet( ofstream * os ) { return os->separator; }
    50 
    51 void sepSet( ofstream * os, const char * s ) {
    52         assert( s );
    53         strncpy( os->separator, s, separateSize - 1 );
    54         os->separator[separateSize - 1] = '\0';
    55 } // sepSet
    56 
    57 const char * sepGetTuple( ofstream * os ) { return os->tupleSeparator; }
    58 
    59 void sepSetTuple( ofstream * os, const char * s ) {
    60         assert( s );
    61         strncpy( os->tupleSeparator, s, separateSize - 1 );
    62         os->tupleSeparator[separateSize - 1] = '\0';
    63 } // sepSet
    6450
    6551_Bool sepDisable( ofstream *os ) {
     
    7359        _Bool temp = os->sepDefault;
    7460        os->sepDefault = true;
    75         sepReset( os );
     61        if ( os->sepOnOff ) sepReset( os );                                     // start of line ?
    7662        return temp;
    7763} // sepEnable
     64
     65const char * sepGet( ofstream * os ) { return os->separator; }
     66void sepSet( ofstream * os, const char * s ) {
     67        assert( s );
     68        strncpy( os->separator, s, separateSize - 1 );
     69        os->separator[separateSize - 1] = '\0';
     70} // sepSet
     71
     72const char * sepGetTuple( ofstream * os ) { return os->tupleSeparator; }
     73void sepSetTuple( ofstream * os, const char * s ) {
     74        assert( s );
     75        strncpy( os->tupleSeparator, s, separateSize - 1 );
     76        os->tupleSeparator[separateSize - 1] = '\0';
     77} // sepSet
    7878
    7979int fail( ofstream * os ) {
Note: See TracChangeset for help on using the changeset viewer.