diff options
Diffstat (limited to 'conio.h')
| -rw-r--r-- | conio.h | 18 |
1 files changed, 4 insertions, 14 deletions
@@ -1,14 +1,4 @@ -#include <termios.h> -#include <unistd.h> -#include <stdio.h> -int getch(void) { - struct termios oldattr, newattr; - int ch; - tcgetattr(STDIN_FILENO, &oldattr); - newattr = oldattr; - newattr.c_lflag &= ~(ICANON | ECHO); - tcsetattr(STDIN_FILENO, TCSANOW, &newattr); - ch = getchar(); - tcsetattr(STDIN_FILENO, TCSANOW, &oldattr); - return ch; -} +#ifndef CONIO_H +#define CONIO_H +int getch(void); +#endif |
