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 | // |
---|
7 | // fstream -- |
---|
8 | // |
---|
9 | // Author : Peter A. Buhr |
---|
10 | // Created On : Wed May 27 17:56:53 2015 |
---|
11 | // Last Modified By : Peter A. Buhr |
---|
12 | // Last Modified On : Thu Apr 28 08:08:04 2016 |
---|
13 | // Update Count : 88 |
---|
14 | // |
---|
15 | |
---|
16 | #ifdef __CFORALL__ |
---|
17 | |
---|
18 | #ifndef __FSTREAM_H__ |
---|
19 | #define __FSTREAM_H__ |
---|
20 | |
---|
21 | #include "iostream" |
---|
22 | |
---|
23 | enum { separateSize = 16 }; |
---|
24 | struct ofstream { |
---|
25 | void *file; |
---|
26 | _Bool sepDefault; |
---|
27 | int sepOnOff; // FIX ME: type should be _Bool |
---|
28 | char separator[separateSize]; |
---|
29 | }; // ofstream |
---|
30 | |
---|
31 | _Bool sepPrt( ofstream * ); |
---|
32 | void sepOn( ofstream * ); |
---|
33 | void sepOff( ofstream * ); |
---|
34 | void sepReset( ofstream * ); |
---|
35 | void sepReset( ofstream *, _Bool ); |
---|
36 | void sepSet( ofstream *, const char * ); |
---|
37 | const char * sepGet( ofstream * ); |
---|
38 | _Bool sepDisable( ofstream * ); |
---|
39 | _Bool sepEnable( ofstream * ); |
---|
40 | int fail( ofstream * ); |
---|
41 | int flush( ofstream * ); |
---|
42 | void open( ofstream *, const char * name, const char * mode ); |
---|
43 | void close( ofstream * ); |
---|
44 | ofstream * write( ofstream *, const char * data, unsigned long int size ); |
---|
45 | int prtfmt( ofstream *, const char fmt[], ... ); |
---|
46 | |
---|
47 | extern ofstream * sout, * serr; |
---|
48 | |
---|
49 | // implement context istream |
---|
50 | struct ifstream { |
---|
51 | void *file; |
---|
52 | }; // ifstream |
---|
53 | |
---|
54 | int fail( ifstream * is ); |
---|
55 | int eof( ifstream * is ); |
---|
56 | void open( ifstream * is, const char * name, const char * mode ); |
---|
57 | void close( ifstream * is ); |
---|
58 | ifstream * read( ifstream * is, char * data, unsigned long int size ); |
---|
59 | ifstream * ungetc( ifstream * is, char c ); |
---|
60 | int scanfmt( ifstream *, const char fmt[], ... ); |
---|
61 | |
---|
62 | extern ifstream *sin; |
---|
63 | |
---|
64 | #endif // __FSTREAM_H__ |
---|
65 | |
---|
66 | #else |
---|
67 | #include_next <fstream> |
---|
68 | #endif //__CFORALL__ |
---|
69 | |
---|
70 | // Local Variables: // |
---|
71 | // mode: c // |
---|
72 | // tab-width: 4 // |
---|
73 | // End: // |
---|
74 | |
---|