/************************************************************* * File: lib/feof.c * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 970304 Start of revision history */ #include #undef feof /************************************************************* * feof(fp) * Test a file to see if it's at EOF */ feof(fp) FILE *fp; { int fd; Ramfile *p; #if 0 /* old */ fd = fp->fd; if (fd < FILEOFFSET) return(0); fd -= FILEOFFSET; if (_mfile[fd].open != 1) return(0); p = &_mfile[fd]; if (p->posn >= p->size) return(1); return(0); #else /* new */ return (fp->eof); #endif }