Ignore:
Timestamp:
Apr 24, 2021, 11:29:51 AM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
fec63b2
Parents:
85d8153
Message:

formatting, rename public enum sepSize to ofstream_sepSize, change return type to bool for function fail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    r85d8153 rb431515  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Apr 20 19:04:46 2021
    13 // Update Count     : 425
     12// Last Modified On : Sat Apr 24 09:05:16 2021
     13// Update Count     : 426
    1414//
    1515
     
    1919#include <stdlib.h>                                                                             // exit
    2020#include <stdarg.h>                                                                             // varargs
    21 #include <string.h>                                                                             // strlen
    22 #include <float.h>                                                                              // DBL_DIG, LDBL_DIG
    23 #include <complex.h>                                                                    // creal, cimag
     21#include <string.h>                                                                             // strncpy, strerror
    2422#include <assert.h>
    2523#include <errno.h>                                                                              // errno
     
    9391void sepSet( ofstream & os, const char s[] ) {
    9492        assert( s );
    95         strncpy( os.separator$, s, sepSize - 1 );
    96         os.separator$[sepSize - 1] = '\0';
     93        strncpy( os.separator$, s, ofstream_sepSize - 1 );
     94        os.separator$[ofstream_sepSize - 1] = '\0';
    9795} // sepSet
    9896
     
    10098void sepSetTuple( ofstream & os, const char s[] ) {
    10199        assert( s );
    102         strncpy( os.tupleSeparator$, s, sepSize - 1 );
    103         os.tupleSeparator$[sepSize - 1] = '\0';
     100        strncpy( os.tupleSeparator$, s, ofstream_sepSize - 1 );
     101        os.tupleSeparator$[ofstream_sepSize - 1] = '\0';
    104102} // sepSet
    105103
     
    112110} // ends
    113111
    114 int fail( ofstream & os ) {
     112bool fail( ofstream & os ) {
    115113        return os.file$ == 0 || ferror( (FILE *)(os.file$) );
    116114} // fail
     
    228226bool getANL( ifstream & os ) { return os.nlOnOff$; }
    229227
    230 int fail( ifstream & is ) {
     228bool fail( ifstream & is ) {
    231229        return is.file$ == 0p || ferror( (FILE *)(is.file$) );
    232230} // fail
Note: See TracChangeset for help on using the changeset viewer.