source: src/libcfa/fstream @ 53ba273

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 53ba273 was 53ba273, checked in by Peter A. Buhr <pabuhr@…>, 8 years ago

switch from std=c99 to std=gnu99, update latex macros, refrat and extend user manual, update limits/iostream/fstream, add rational numbers

  • Property mode set to 100644
File size: 1.7 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
[53ba273]12// Last Modified On : Tue Apr  5 22:37:12 2016
13// Update Count     : 82
[86bd7c1f]14//
15
[42dcae7]16#ifndef __FSTREAM_H__
17#define __FSTREAM_H__
[51b7345]18
[d3b7937]19#include "iostream"
[51b7345]20
[90c3b1c]21enum { separateSize = 16 };
[53ba273]22struct ofstream {
23        void *file;
24        _Bool sepDefault;
25        _Bool sepOnOff;
26        char separator[separateSize];
27}; // ofstream
[90c3b1c]28
29_Bool sepPrt( ofstream * );
30void sepOn( ofstream * );
31void sepOff( ofstream * );
[53ba273]32void sepReset( ofstream * );
33void sepReset( ofstream *, _Bool );
[90c3b1c]34void sepSet( ofstream *, const char * );
35const char * sepGet( ofstream * );
[53ba273]36_Bool sepDisable( ofstream * );
37_Bool sepEnable( ofstream * );
[90c3b1c]38int fail( ofstream * );
39int flush( ofstream * );
40void open( ofstream *, const char * name, const char * mode );
41void close( ofstream * );
42ofstream * write( ofstream *, const char * data, unsigned long int size );
43int prtfmt( ofstream *, const char fmt[], ... );
[51b7345]44
[6ba0659]45extern ofstream * sout, * serr;
[51b7345]46
[134b86a]47// implement context istream
[53ba273]48struct ifstream {
49        void *file;
50}; // ifstream
[6ba0659]51
52int fail( ifstream * is );
53int eof( ifstream * is );
[90c3b1c]54void open( ifstream * is, const char * name, const char * mode );
[6ba0659]55void close( ifstream * is );
[90c3b1c]56ifstream * read( ifstream * is, char * data, unsigned long int size );
[6ba0659]57ifstream * ungetc( ifstream * is, char c );
[90c3b1c]58int scanfmt( ifstream *, const char fmt[], ... );
[51b7345]59
[6ba0659]60extern ifstream *sin;
[51b7345]61
[42dcae7]62#endif // __FSTREAM_H__
[86bd7c1f]63
64// Local Variables: //
[d3b7937]65// mode: c //
[86bd7c1f]66// tab-width: 4 //
67// End: //
[90c3b1c]68
Note: See TracBrowser for help on using the repository browser.