#define NOCCARGC #include stdio.h #include clib.def /* ** Close fd. ** Entry: fd = File descriptor for file to be closed. ** Returns NULL for success, otherwise ERR. ** Modified to guarantee that an EOF character appears ** after the last data character in the file. */ extern int _fcbptr[], _status[], _device[]; fclose(fd) int fd; { if(!_mode(fd)) return (ERR); if(!isatty(fd)) { fputc('\32',fd); /*make sure there is an EOF (DDJ anomaly)*/ if(fflush(fd) || _bdos(CLOFIL,_fcbptr[fd])==255) return (ERR); } return (_status[fd]=_device[fd]=NULL); }