class BufFile
{
public:
BufFile();
void SetName( const char *bufname );
void SetBfd( const int fd );
char *GetName();
int GetBfd();
bool Open( const char *pathname, int flags, Error *e );
bool DataReady( bool *ready, Error *e );
bool ReadLine( StrBuf *strbuf, bool *eof, Error *e );
bool Close( Error *e );
private:
bool Read( Error *e );
StrBuf name; // name of buffered file
int bfd; // file descriptor of buffered file
#define BUFSIZE 32768
char buf[ BUFSIZE + 1 ]; // buffer into which the file is read
char *bufp; // pointer to current buffer location
ssize_t n; // remaining length (excluding \0)
};