@@ -55,11 +55,11 @@ #define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH struct CFWFile { CFWStream stream; int fd; - bool eof; + bool at_end; }; static int parse_mode(const char *mode) { @@ -96,11 +96,11 @@ { CFWFile *file = ptr; ssize_t ret; if ((ret = read(file->fd, buf, len)) == 0) - file->eof = true; + file->at_end = true; return ret; } static bool @@ -114,15 +114,15 @@ return true; } static bool -file_eof(void *ptr) +file_at_end(void *ptr) { CFWFile *file = ptr; - return file->eof; + return file->at_end; } static void file_close(void *ptr) { @@ -132,11 +132,11 @@ } static struct cfw_stream_ops stream_ops = { .read = file_read, .write = file_write, - .eof = file_eof, + .at_end = file_at_end, .close = file_close }; static bool ctor(void *ptr, va_list args) @@ -146,11 +146,11 @@ const char *mode = va_arg(args, const char*); int flags; /* Make sure we have a valid file in case we error out */ cfw_stream->ctor(ptr, args); - file->eof = false; + file->at_end = false; if ((flags = parse_mode(mode)) == -1) return false; if ((file->fd = open(path, flags, DEFAULT_MODE)) == -1) @@ -182,11 +182,11 @@ .ref_cnt = INT_MAX }, .ops = &stream_ops }, .fd = 0, - .eof = false + .at_end = false }; static CFWFile cfw_stdout_ = { .stream = { .obj = { .cls = &class, @@ -193,11 +193,11 @@ .ref_cnt = INT_MAX }, .ops = &stream_ops }, .fd = 1, - .eof = false + .at_end = false }; static CFWFile cfw_stderr_ = { .stream = { .obj = { .cls = &class, @@ -204,10 +204,10 @@ .ref_cnt = INT_MAX }, .ops = &stream_ops }, .fd = 2, - .eof = false + .at_end = false }; CFWFile *cfw_stdin = &cfw_stdin_; CFWFile *cfw_stdout = &cfw_stdout_; CFWFile *cfw_stderr = &cfw_stderr_;