#include <curses.h> extern int LINES;
The external variable LINES indicates the number of lines on the terminal screen.
initscr(3XCURSES)