Initial revision
This commit is contained in:
16
lang/cem/libcc/stdio/ungetc.c
Normal file
16
lang/cem/libcc/stdio/ungetc.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
ungetc(ch, iop)
|
||||
int ch;
|
||||
FILE *iop;
|
||||
{
|
||||
if ( ch < 0 || !io_testflag(iop,IO_READMODE))
|
||||
return EOF;
|
||||
if (iop->_ptr == iop->_buf) {
|
||||
if (iop->_count != 0) return EOF;
|
||||
iop->_ptr++;
|
||||
}
|
||||
iop->_count++;
|
||||
*--iop->_ptr = ch;
|
||||
return(ch);
|
||||
}
|
||||
Reference in New Issue
Block a user