/* * Screen setup and closedown. */ #include #include #include #include "screen.h" /* * Set up the screen and tty modes. * * We check the screen size (check COLS against 79, not 80, since I * think it sokmetimes is set to one less than the actual number of * columns). * * I _think_ cbreak() is redundant in the presence of raw(), but I'm * not sure. */ void initscreen(void) { initscr(); if ((LINES < 24) || (COLS < 79)) { cleanupscreen(); printf("Terminal must be at least 24x80\n"); exit(1); } noecho(); nonl(); cbreak(); raw(); clear(); } /* * Not much to say here. */ void cleanupscreen(void) { move(LINES-1,0); refresh(); endwin(); printf("\n"); }