#include #include #include #include #include "struct.h" #include "read.h" void file_istream_read( struct istream* super) { ENTER; struct file_istream* this = (void*) super; if (this->i < this->n) { super->c = this->buffer[this->i++]; dpvc(super->c); } else { ssize_t read_retval = read(this->fd, this->buffer, sizeof(this->buffer)); if (read_retval < 0) { TODO; } else if (!read_retval) { super->c = 0; } else { this->i = 0; this->n = (size_t) read_retval; super->c = this->buffer[this->i++]; dpvc(super->c); } } EXIT; }