source: src/libcfa/fstream@ 17e5e2b

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 17e5e2b 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
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
[8bc4ef8]12// Last Modified On : Thu Apr 28 08:08:04 2016
13// Update Count : 88
[86bd7c1f]14//
15
[17e5e2b]16#ifdef __CFORALL__
17
[42dcae7]18#ifndef __FSTREAM_H__
19#define __FSTREAM_H__
[51b73452]20
[d3b7937]21#include "iostream"
[51b73452]22
[90c3b1c]23enum { separateSize = 16 };
[53ba273]24struct ofstream {
25 void *file;
[8bc4ef8]26 _Bool sepDefault;
27 int sepOnOff; // FIX ME: type should be _Bool
[53ba273]28 char separator[separateSize];
29}; // ofstream
[90c3b1c]30
31_Bool sepPrt( ofstream * );
32void sepOn( ofstream * );
33void sepOff( ofstream * );
[53ba273]34void sepReset( ofstream * );
35void sepReset( ofstream *, _Bool );
[90c3b1c]36void sepSet( ofstream *, const char * );
37const char * sepGet( ofstream * );
[53ba273]38_Bool sepDisable( ofstream * );
39_Bool sepEnable( ofstream * );
[90c3b1c]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[], ... );
[51b73452]46
[6ba0659]47extern ofstream * sout, * serr;
[51b73452]48
[134b86a]49// implement context istream
[53ba273]50struct ifstream {
51 void *file;
52}; // ifstream
[6ba0659]53
54int fail( ifstream * is );
55int eof( ifstream * is );
[90c3b1c]56void open( ifstream * is, const char * name, const char * mode );
[6ba0659]57void close( ifstream * is );
[90c3b1c]58ifstream * read( ifstream * is, char * data, unsigned long int size );
[6ba0659]59ifstream * ungetc( ifstream * is, char c );
[90c3b1c]60int scanfmt( ifstream *, const char fmt[], ... );
[51b73452]61
[6ba0659]62extern ifstream *sin;
[51b73452]63
[42dcae7]64#endif // __FSTREAM_H__
[86bd7c1f]65
[17e5e2b]66#else
67#include_next <fstream>
68#endif //__CFORALL__
69
[86bd7c1f]70// Local Variables: //
[d3b7937]71// mode: c //
[86bd7c1f]72// tab-width: 4 //
73// End: //
[90c3b1c]74
Note: See TracBrowser for help on using the repository browser.