Annotation of 43BSD/usr.lib/libpc/UNSYNC.c, revision 1.1.1.1

1.1       root        1: /* Copyright (c) 1979 Regents of the University of California */
                      2: 
                      3: static char sccsid[] = "@(#)UNSYNC.c 1.4 10/28/83";
                      4: 
                      5: #include "h00vars.h"
                      6: 
                      7: /*
                      8:  * push back last char read to prepare for formatted read
                      9:  */
                     10: UNSYNC(curfile)
                     11: 
                     12:        register struct iorec   *curfile;
                     13: {
                     14:        if (curfile->funit & FWRITE) {
                     15:                ERROR("%s: Attempt to read, but open for writing\n",
                     16:                        curfile->pfname);
                     17:                return;
                     18:        }
                     19:        if (curfile->funit & EOFF) {
                     20:                ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                     21:                return;
                     22:        }
                     23:        if ((curfile->funit & SYNC) == 0) {
                     24:                ungetc(*curfile->fileptr, curfile->fbuf);
                     25:        }
                     26:        curfile->funit &= ~EOLN;
                     27:        curfile->funit |= SYNC;
                     28: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.