Ignore:
Timestamp:
Jul 5, 2017, 5:00:46 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
55a68c3, 5805d15
Parents:
f7cb0bc (diff), 1ce2189 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/fstream.c

    rf7cb0bc ra5de33e  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 15 18:11:11 2017
    13 // Update Count     : 234
     12// Last Modified On : Sat Jul  1 16:37:54 2017
     13// Update Count     : 242
    1414//
    1515
     
    3333        this->sepDefault = sepDefault;
    3434        this->sepOnOff = sepOnOff;
     35        this->lastSepOn = false;
    3536        sepSet( this, separator );
    3637        sepSetCur( this, sepGet( this ) );
     
    3940
    4041// private
    41 _Bool sepPrt( ofstream * os ) { return os->sepOnOff; }
     42_Bool lastSepOn( ofstream * os ) { return os->lastSepOn; }
     43_Bool sepPrt( ofstream * os ) { os->lastSepOn = false; return os->sepOnOff; }
    4244void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }
    4345void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }
     
    4648
    4749// public
    48 void sepOn( ofstream * os ) { os->sepOnOff = 1; }
    49 void sepOff( ofstream * os ) { os->sepOnOff = 0; }
     50void sepOn( ofstream * os ) { os->lastSepOn = true; os->sepOnOff = true; }
     51void sepOff( ofstream * os ) { os->lastSepOn = false; os->sepOnOff = 0; }
    5052
    5153_Bool sepDisable( ofstream *os ) {
    5254        _Bool temp = os->sepDefault;
    5355        os->sepDefault = false;
     56        os->lastSepOn = false;
    5457        sepReset( os );
    5558        return temp;
     
    9295                exit( EXIT_FAILURE );
    9396        } // if
    94         ?{}( os, file, 1, 0, " ", ", " );
     97        ?{}( os, file, true, false, " ", ", " );
    9598} // open
    9699
     
    132135} // fmt
    133136
    134 static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), 1, 0, " ", ", " };
     137static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), true, false, " ", ", " };
    135138ofstream *sout = &soutFile;
    136 static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), 1, 0, " ", ", " };
     139static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), true, false, " ", ", " };
    137140ofstream *serr = &serrFile;
    138141
Note: See TracChangeset for help on using the changeset viewer.