#ifndef FSTREAM_H
#define FSTREAM_H

#include "iostream.h"

typedef struct ofstream ofstream;

/* implement context ostream */
ofstream *write( ofstream *, const char *, streamsize_type );
int fail( ofstream * );

ofstream *ofstream_stdout();
ofstream *ofstream_stderr();
ofstream *ofstream_fromfile( const char *name );
void ofstream_close( ofstream *os );

typedef struct ifstream ifstream;

/* implement context istream */
ifstream *read( ifstream *, char *, streamsize_type );
ifstream *unread( ifstream *, char );
int fail( ifstream * );
int eof( ifstream * );

ifstream *ifstream_stdin();
ifstream *ifstream_fromfile( const char *name );

#endif /* #ifndef FSTREAM_H */
