source: src/libcfa/fstream@ ff2d7341

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since ff2d7341 was 17e5e2b, checked in by Thierry Delisle <tdelisle@…>, 9 years ago

Added proper include guards to cfa headers so they can be added to the c++ include path without issues

  • Property mode set to 100644
File size: 1.8 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 : 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
23enum { separateSize = 16 };
24struct 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 * );
32void sepOn( ofstream * );
33void sepOff( ofstream * );
34void sepReset( ofstream * );
35void sepReset( ofstream *, _Bool );
36void sepSet( ofstream *, const char * );
37const char * sepGet( ofstream * );
38_Bool sepDisable( ofstream * );
39_Bool sepEnable( ofstream * );
40int fail( ofstream * );
41int flush( ofstream * );
42void open( ofstream *, const char * name, const char * mode );
43void close( ofstream * );
44ofstream * write( ofstream *, const char * data, unsigned long int size );
45int prtfmt( ofstream *, const char fmt[], ... );
46
47extern ofstream * sout, * serr;
48
49// implement context istream
50struct ifstream {
51 void *file;
52}; // ifstream
53
54int fail( ifstream * is );
55int eof( ifstream * is );
56void open( ifstream * is, const char * name, const char * mode );
57void close( ifstream * is );
58ifstream * read( ifstream * is, char * data, unsigned long int size );
59ifstream * ungetc( ifstream * is, char c );
60int scanfmt( ifstream *, const char fmt[], ... );
61
62extern 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
Note: See TracBrowser for help on using the repository browser.