11714Smckusick /* Copyright (c) 1979 Regents of the University of California */ 21714Smckusick 3*15303Smckusick static char sccsid[] = "@(#)UNSYNC.c 1.4 10/28/83"; 41714Smckusick 51714Smckusick #include "h00vars.h" 61714Smckusick 71714Smckusick /* 81714Smckusick * push back last char read to prepare for formatted read 91714Smckusick */ 101714Smckusick UNSYNC(curfile) 111714Smckusick 121714Smckusick register struct iorec *curfile; 131714Smckusick { 141714Smckusick if (curfile->funit & FWRITE) { 153869Smckusic ERROR("%s: Attempt to read, but open for writing\n", 163869Smckusic curfile->pfname); 171714Smckusick return; 181714Smckusick } 192224Smckusic if (curfile->funit & EOFF) { 203869Smckusic ERROR("%s: Tried to read past end of file\n", curfile->pfname); 212224Smckusic return; 222224Smckusic } 231714Smckusick if ((curfile->funit & SYNC) == 0) { 241714Smckusick ungetc(*curfile->fileptr, curfile->fbuf); 251714Smckusick } 26*15303Smckusick curfile->funit &= ~EOLN; 27*15303Smckusick curfile->funit |= SYNC; 281714Smckusick } 29