[86bd7c1f] | 1 | //
|
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
|
---|
| 3 | //
|
---|
| 4 | // The contents of this file are covered under the licence agreement in the
|
---|
| 5 | // file "LICENCE" distributed with Cforall.
|
---|
| 6 | //
|
---|
[d3b7937] | 7 | // fstream --
|
---|
[86bd7c1f] | 8 | //
|
---|
[90c3b1c] | 9 | // Author : Peter A. Buhr
|
---|
[86bd7c1f] | 10 | // Created On : Wed May 27 17:56:53 2015
|
---|
| 11 | // Last Modified By : Peter A. Buhr
|
---|
[90c3b1c] | 12 | // Last Modified On : Wed Mar 2 15:08:14 2016
|
---|
| 13 | // Update Count : 78
|
---|
[86bd7c1f] | 14 | //
|
---|
| 15 |
|
---|
[42dcae7] | 16 | #ifndef __FSTREAM_H__
|
---|
| 17 | #define __FSTREAM_H__
|
---|
[51b73452] | 18 |
|
---|
[d3b7937] | 19 | #include "iostream"
|
---|
[51b73452] | 20 |
|
---|
[90c3b1c] | 21 | enum { separateSize = 16 };
|
---|
| 22 | struct ofstream { void *file; int separate; char separator[separateSize]; };
|
---|
| 23 |
|
---|
| 24 | _Bool sepPrt( ofstream * );
|
---|
| 25 | void sepOn( ofstream * );
|
---|
| 26 | void sepOff( ofstream * );
|
---|
| 27 | void sepSet( ofstream *, const char * );
|
---|
| 28 | const char * sepGet( ofstream * );
|
---|
| 29 | void sepDisable( ofstream * );
|
---|
| 30 | void sepEnable( ofstream * );
|
---|
| 31 | int fail( ofstream * );
|
---|
| 32 | int flush( ofstream * );
|
---|
| 33 | void open( ofstream *, const char * name, const char * mode );
|
---|
| 34 | void close( ofstream * );
|
---|
| 35 | ofstream * write( ofstream *, const char * data, unsigned long int size );
|
---|
| 36 | int prtfmt( ofstream *, const char fmt[], ... );
|
---|
[51b73452] | 37 |
|
---|
[6ba0659] | 38 | extern ofstream * sout, * serr;
|
---|
[51b73452] | 39 |
|
---|
[134b86a] | 40 | // implement context istream
|
---|
[90c3b1c] | 41 | struct ifstream { void *file; };
|
---|
[6ba0659] | 42 |
|
---|
| 43 | int fail( ifstream * is );
|
---|
| 44 | int eof( ifstream * is );
|
---|
[90c3b1c] | 45 | void open( ifstream * is, const char * name, const char * mode );
|
---|
[6ba0659] | 46 | void close( ifstream * is );
|
---|
[90c3b1c] | 47 | ifstream * read( ifstream * is, char * data, unsigned long int size );
|
---|
[6ba0659] | 48 | ifstream * ungetc( ifstream * is, char c );
|
---|
[90c3b1c] | 49 | int scanfmt( ifstream *, const char fmt[], ... );
|
---|
[51b73452] | 50 |
|
---|
[6ba0659] | 51 | extern ifstream *sin;
|
---|
[51b73452] | 52 |
|
---|
[42dcae7] | 53 | #endif // __FSTREAM_H__
|
---|
[86bd7c1f] | 54 |
|
---|
| 55 | // Local Variables: //
|
---|
[d3b7937] | 56 | // mode: c //
|
---|
[86bd7c1f] | 57 | // tab-width: 4 //
|
---|
| 58 | // End: //
|
---|
[90c3b1c] | 59 |
|
---|