display.cc
/*
 * unsetraw - Restore a terminal\'s mode to whatever it was on the most
 *            recent call to the setraw\(\) function above.
 *            Exits with EXIT_FAILURE on failure.
 */
Restore a terminal\'s mode to whatever it was on the most
recent call to the setraw\(\) function above.
Exits with EXIT_FAILURE on failure.
Restore a terminal \ ' s mode to whatever it was on the most recent call to the setraw \ ( \ ) function above . Exits with EXIT_FAILURE on failure .
void unsetraw()
{
#ifdef TERMIOS
    if (tcsetattr(0, TCSAFLUSH, &tty_mode) < 0)
    {
        perror("tcsetattr");
        exit(EXIT_FAILURE);
    }
#elif TERMIO
    if (ioctl(0, TCSETA, (char *)&tty_mode) < 0)
    {
        perror("ioctl - TCSETA");
        exit(EXIT_FAILURE);
    }
#else
    if (ioctl(fileno(stdin), TIOCSETN, (char *)&oarg) < 0)
    {
        perror("ioctl - TIOSETN");
        exit(EXIT_FAILURE);
    }
    if (ioctl(fileno(stdin), TIOCSETC, (char *)&otarg) < 0)
    {
        perror("ioctl - TIOSETC");
        exit(EXIT_FAILURE);
    }
    if (ioctl(fileno(stdin), TIOCSLTC, (char *)&oltarg) < 0)
    {
        perror("ioctl - TIOSLTC");
        exit(EXIT_FAILURE);
    }
#endif
}
void unsetraw ( ) { #ifdef TERMIOS if ( tcsetattr ( 0 , TCSAFLUSH , & tty_mode ) < 0 ) { perror ( " " ) ; exit ( EXIT_FAILURE ) ; } #elif TERMIO if ( ioctl ( 0 , TCSETA , ( char * ) & tty_mode ) < 0 ) { perror ( " " ) ; exit ( EXIT_FAILURE ) ; } #else if ( ioctl ( fileno ( stdin ) , TIOCSETN , ( char * ) & oarg ) < 0 ) { perror ( " " ) ; exit ( EXIT_FAILURE ) ; } if ( ioctl ( fileno ( stdin ) , TIOCSETC , ( char * ) & otarg ) < 0 ) { perror ( " " ) ; exit ( EXIT_FAILURE ) ; } if ( ioctl ( fileno ( stdin ) , TIOCSLTC , ( char * ) & oltarg ) < 0 ) { perror ( " " ) ; exit ( EXIT_FAILURE ) ; } #endif }
unsetraw - Restore a terminal\'s mode to whatever it was on the most
            recent call to the setraw\(\) function above.
unsetraw - Restore a terminal \ ' s mode to whatever it was on the most recent call to the setraw \ ( \ ) function above .