Category : C Source Code
Archive   : CSRC2.ZIP
Filename : UNGETC.C

 
Output of file : UNGETC.C contained in archive : CSRC2.ZIP
/*
* u n g e t c . c
*/

/*)LIBRARY
*/

#ifdef DOCUMENTATION

title ungetc Push back a character onto an input file
index Push back onto an input file

synopsis
.s.nf
ungetc(c, iop);
char c;
FILE *iop;

description

Push one character back on the indicated stream.

bugs
#endif

#include

#ifndef decusc_stdio

ungetc(c, fd)
char c;
register FILE *fd;
/*
* Push the byte back on the input stream
*/
{

if ((fd->_flag & _IOREAD) == 0
|| fd->_ptr <= fd->_base) {
if (fd->_ptr == fd->_base && fd->_cnt == 0)
*fd->_ptr++;
else
_error("ungetc\n");
}
fd->_cnt++;
*--fd->_ptr = c;
}

#endif



  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : UNGETC.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/