reactos/reactos/lib/msvcrt/conio/getche.c
Eric Kohl eed177f191 Added conio functions
svn path=/trunk/; revision=2034
2001-07-04 16:39:37 +00:00

31 lines
883 B
C

/*
* COPYRIGHT: See COPYING in the top level directory
* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details
* PROJECT: ReactOS system libraries
* FILE: lib/crtdll/conio/getche.c
* PURPOSE: Reads a character from stdin
* PROGRAMER: DJ Delorie
Boudewijn Dekker
* UPDATE HISTORY:
* 28/12/98: Created
*/
#include <msvcrt/conio.h>
#include <msvcrt/internal/console.h>
int getche(void)
{
if (char_avail)
/*
* We don't know, wether the ungot char was already echoed
* we assume yes (for example in cscanf, probably the only
* place where ungetch is ever called.
* There is no way to check for this really, because
* ungetch could have been called with a character that
* hasn't been got by a conio function.
* We don't echo again.
*/
return(getch());
return (_putch(getch()));
}