#include /* Demonstation of the following functions: * * att() Attach terminal * getkey() Read a single keypress * echo() Turn on echo on terminal * noecho() Turn off echo on terminal * * This is free software. */ #ifdef decus /* For DECUS C */ int $$narg=1; int getkey(); void att(); void echo(); void noecho(); #endif #ifdef __RSX_HOST /* For DEC PDP-11 C */ int getkey(void); void att(int); void echo(void); void noecho(void); #define flun __flun #endif int main() { int c; att(flun(stdin)); printf("Hello world\n"); printf("Press a key\n"); c = getkey(); printf("You pressed %d\n", c); noecho(); printf("Press a key\n"); c = getkey(); printf("You pressed %d\n", c); echo(); printf("Press a key\n"); c = getkey(); printf("You pressed %d\n", c); }