2007-03-14 20:24:57 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details
|
|
|
|
* PROJECT: ReactOS system libraries
|
2015-09-19 13:50:57 +00:00
|
|
|
* FILE: lib/sdk/crt/conio/ungetch.c
|
2007-03-14 20:24:57 +00:00
|
|
|
* PURPOSE: Ungets a character from stdin
|
|
|
|
* PROGRAMER: DJ Delorie
|
|
|
|
Ariadne [ Adapted from djgpp libc ]
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 28/12/98: Created
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <precomp.h>
|
|
|
|
|
|
|
|
int char_avail = 0;
|
|
|
|
int ungot_char = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
int _ungetch(int c)
|
|
|
|
{
|
|
|
|
if (char_avail)
|
|
|
|
return(EOF);
|
|
|
|
ungot_char = c;
|
|
|
|
char_avail = 1;
|
|
|
|
return(c);
|
|
|
|
}
|