- Timestamp:
- Mar 9, 2017, 10:38:44 PM (8 years ago)
- 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:
- 149d297
- Parents:
- d3bc0ad
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/fstream
rd3bc0ad r6152c81 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Apr 28 08:08:04 201613 // Update Count : 8812 // Last Modified On : Tue Mar 7 14:48:08 2017 13 // Update Count : 91 14 14 // 15 15 … … 23 23 void *file; 24 24 _Bool sepDefault; 25 int sepOnOff; // FIX ME: type should be _Bool25 _Bool sepOnOff; 26 26 char separator[separateSize]; 27 27 }; // ofstream … … 32 32 void sepReset( ofstream * ); 33 33 void sepReset( ofstream *, _Bool ); 34 const char * sepGet( ofstream * ); 34 35 void sepSet( ofstream *, const char * ); 35 const char * sepGet( ofstream * );36 36 _Bool sepDisable( ofstream * ); 37 37 _Bool sepEnable( ofstream * ); 38 38 39 int fail( ofstream * ); 39 40 int flush( ofstream * ); -
src/libcfa/fstream.c
rd3bc0ad r6152c81 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 15 13:35:29 201613 // Update Count : 1 8812 // Last Modified On : Tue Mar 7 14:48:09 2017 13 // Update Count : 192 14 14 // 15 15 … … 21 21 #include <stdarg.h> // varargs 22 22 #include <string.h> // strlen 23 #include <stdbool.h> // true/false 23 24 #include <float.h> // DBL_DIG, LDBL_DIG 24 25 #include <complex.h> // creal, cimag … … 32 33 void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; } 33 34 void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; } 35 const char * sepGet( ofstream * os ) { return &(os->separator[0]); } 36 34 37 void sepSet( ofstream * os, const char * s ) { 35 38 strncpy( &(os->separator[0]), s, separateSize - 1 ); 36 39 os->separator[separateSize - 1] = '\0'; 37 40 } // sepSet 38 const char * sepGet( ofstream * os ) { return &(os->separator[0]); } 41 39 42 _Bool sepDisable( ofstream *os ) { 40 43 _Bool temp = os->sepDefault; 41 os->sepDefault = 0;44 os->sepDefault = false; 42 45 sepReset( os ); 43 46 return temp; 44 47 } // sepDisable 48 45 49 _Bool sepEnable( ofstream *os ) { 46 50 _Bool temp = os->sepDefault; 47 os->sepDefault = 1;51 os->sepDefault = true; 48 52 sepReset( os ); 49 53 return temp;
Note: See TracChangeset
for help on using the changeset viewer.