source: src/libcfa/fstream @ bdad1679

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 bdad1679 was 90c3b1c, checked in by Peter A. Buhr <pabuhr@…>, 8 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
RevLine 
[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__
[51b7345]18
[d3b7937]19#include "iostream"
[51b7345]20
[90c3b1c]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[], ... );
[51b7345]37
[6ba0659]38extern ofstream * sout, * serr;
[51b7345]39
[134b86a]40// implement context istream
[90c3b1c]41struct ifstream { void *file; };
[6ba0659]42
43int fail( ifstream * is );
44int eof( ifstream * is );
[90c3b1c]45void open( ifstream * is, const char * name, const char * mode );
[6ba0659]46void close( ifstream * is );
[90c3b1c]47ifstream * read( ifstream * is, char * data, unsigned long int size );
[6ba0659]48ifstream * ungetc( ifstream * is, char c );
[90c3b1c]49int scanfmt( ifstream *, const char fmt[], ... );
[51b7345]50
[6ba0659]51extern ifstream *sin;
[51b7345]52
[42dcae7]53#endif // __FSTREAM_H__
[86bd7c1f]54
55// Local Variables: //
[d3b7937]56// mode: c //
[86bd7c1f]57// tab-width: 4 //
58// End: //
[90c3b1c]59
Note: See TracBrowser for help on using the repository browser.