source: src/libcfa/fstream @ 90c3b1c

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 90c3b1c was 90c3b1c, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

compile CFA with C++11, further update refrat with lstlisting macros, support varags, enumeration initialization, add implicit separators to output streams, update example programs that print

  • Property mode set to 100644
File size: 1.6 KB
Line 
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 : Wed Mar  2 15:08:14 2016
13// Update Count     : 78
14//
15
16#ifndef __FSTREAM_H__
17#define __FSTREAM_H__
18
19#include "iostream"
20
21enum { separateSize = 16 };
22struct ofstream { void *file; int separate; char separator[separateSize]; };
23
24_Bool sepPrt( ofstream * );
25void sepOn( ofstream * );
26void sepOff( ofstream * );
27void sepSet( ofstream *, const char * );
28const char * sepGet( ofstream * );
29void sepDisable( ofstream * );
30void sepEnable( ofstream * );
31int fail( ofstream * );
32int flush( ofstream * );
33void open( ofstream *, const char * name, const char * mode );
34void close( ofstream * );
35ofstream * write( ofstream *, const char * data, unsigned long int size );
36int prtfmt( ofstream *, const char fmt[], ... );
37
38extern ofstream * sout, * serr;
39
40// implement context istream
41struct ifstream { void *file; };
42
43int fail( ifstream * is );
44int eof( ifstream * is );
45void open( ifstream * is, const char * name, const char * mode );
46void close( ifstream * is );
47ifstream * read( ifstream * is, char * data, unsigned long int size );
48ifstream * ungetc( ifstream * is, char c );
49int scanfmt( ifstream *, const char fmt[], ... );
50
51extern ifstream *sin;
52
53#endif // __FSTREAM_H__
54
55// Local Variables: //
56// mode: c //
57// tab-width: 4 //
58// End: //
59
Note: See TracBrowser for help on using the repository browser.