hostcompat - #include #include #include #include #include...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <unistd.h> #include <termios.h> #include <signal.h> #include <stdlib.h> #include <stdio.h> #include "hostcompat.h" /* * The program name. * This is used in err.c. */ const char *hostcompat_progname = NULL; /* * Unix tty state, for when we're running and to put it back the way it was, * respectively. */ static struct termios hostcompat_runtios; static struct termios hostcompat_savetios; /* * Put the tty state back the way it was. */ static void hostcompat_ttyreset(void) { tcsetattr(STDIN_FILENO, TCSADRAIN, &hostcompat_savetios); } /* * Set the tty state back to the way we want it for running. */ static void hostcompat_ttyresume(void) { tcsetattr(STDIN_FILENO, TCSADRAIN, &hostcompat_runtios); } /* * Set up the tty state stuff. */ static int hostcompat_ttysetup(void) { struct termios tios; /* Get the current tty state. */ /* stdin is not a tty */ return -1; } hostcompat_savetios = tios; /* Turn off canonical ("cooked") input. */
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
tios.c_lflag &= ~ICANON; /* * With canonical input off, this says how many characters must be * typed before read() will return.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/10/2009 for the course CS 536 taught by Professor Lums during the Spring '09 term at Indiana.

Page1 / 4

hostcompat - #include #include #include #include #include...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online