コード例 #1
0
void
init_terminal(void)
{
    if (ring_init(&ttyoring, ttyobuf, sizeof ttyobuf) != 1) {
	exit(1);
    }
    if (ring_init(&ttyiring, ttyibuf, sizeof ttyibuf) != 1) {
	exit(1);
    }
    autoflush = TerminalAutoFlush();
}
コード例 #2
0
ファイル: terminal.cpp プロジェクト: gordonchaffee/expectnt
/*
 * initialize the terminal data structures.
 */
void init_terminal(void) {
    if (ttyoring.init(2*BUFSIZ, ttysink, NULL) != 1) {
	exit(1);
    }
    if (ttyiring.init(BUFSIZ, NULL, ttysrc) != 1) {
	exit(1);
    }
    autoflush = TerminalAutoFlush();
#ifdef __WIN32__
    /*
     * Set the console mode.  This will only have an effect if the
     * handle is a console handle
     */
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
#if 0
    printf("1. Calling SetConsoleMode(0x%08x, 0x%08x)\n",
	   hOut, ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT);
#endif
    SetConsoleMode(hOut, ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT);
#endif
}