// // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // fstream -- // // Author : Peter A. Buhr // Created On : Wed May 27 17:56:53 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Thu Apr 28 08:08:04 2016 // Update Count : 88 // #ifndef __FSTREAM_H__ #define __FSTREAM_H__ #include "iostream" enum { separateSize = 16 }; struct ofstream { void *file; _Bool sepDefault; int sepOnOff; // FIX ME: type should be _Bool char separator[separateSize]; }; // ofstream _Bool sepPrt( ofstream * ); void sepOn( ofstream * ); void sepOff( ofstream * ); void sepReset( ofstream * ); void sepReset( ofstream *, _Bool ); void sepSet( ofstream *, const char * ); const char * sepGet( ofstream * ); _Bool sepDisable( ofstream * ); _Bool sepEnable( ofstream * ); int fail( ofstream * ); int flush( ofstream * ); void open( ofstream *, const char * name, const char * mode ); void close( ofstream * ); ofstream * write( ofstream *, const char * data, unsigned long int size ); int prtfmt( ofstream *, const char fmt[], ... ); extern ofstream * sout, * serr; // implement context istream struct ifstream { void *file; }; // ifstream int fail( ifstream * is ); int eof( ifstream * is ); void open( ifstream * is, const char * name, const char * mode ); void close( ifstream * is ); ifstream * read( ifstream * is, char * data, unsigned long int size ); ifstream * ungetc( ifstream * is, char c ); int scanfmt( ifstream *, const char fmt[], ... ); extern ifstream *sin; #endif // __FSTREAM_H__ // Local Variables: // // mode: c // // tab-width: 4 // // End: //