Annotation of 42BSD/lib/libc/stdio/ungetc.c, revision 1.1

1.1     ! root        1: /*     ungetc.c        4.2     83/09/25        */
        !             2: 
        !             3: #include <stdio.h>
        !             4: 
        !             5: ungetc(c, iop)
        !             6:        register FILE *iop;
        !             7: {
        !             8:        if (c == EOF)
        !             9:                return (-1);
        !            10:        if ((iop->_flag&_IOREAD) == 0 || iop->_ptr <= iop->_base)
        !            11:                if (iop->_ptr == iop->_base && iop->_cnt == 0)
        !            12:                        *iop->_ptr++;
        !            13:                else
        !            14:                        return (EOF);
        !            15:        iop->_cnt++;
        !            16:        *--iop->_ptr = c;
        !            17:        return (c);
        !            18: }

unix.superglobalmegacorp.com

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