|
|
1.1 ! root 1: /* @(#)ungetc.c 4.1 (Berkeley) 12/21/80 */ ! 2: #include <stdio.h> ! 3: ! 4: ungetc(c, iop) ! 5: register FILE *iop; ! 6: { ! 7: if (c == EOF) ! 8: return(-1); ! 9: if ((iop->_flag&_IOREAD)==0 || iop->_ptr <= iop->_base) ! 10: if (iop->_ptr == iop->_base && iop->_cnt==0) ! 11: iop->_ptr++; ! 12: else ! 13: return(-1); ! 14: iop->_cnt++; ! 15: *--iop->_ptr = c; ! 16: return(0); ! 17: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.