Note that setupterm is automatically called by initscr and newterm . If these environment variables do not exist and the program is running in a window, the current window size is used. Otherwise, if the environment variables do not exist, the values for lines and columns specified in the terminfo database are used. Parameterized strings should be passed through tparm to instantiate them. The setupterm routine reads in the terminfo database, initializing the terminfo structures, but does not set up the output virtualization structures used by curses .
All output is to file descriptor fildes which is initialized for output.
If errret is not null, then setupterm returns OK or ERR and stores a status value in the integer pointed to by errret . If errret is null, setupterm prints an error message upon finding an error and exits. The setterm routine is being replaced by setupterm . The setterm routine is included here for BSD compatibility, and is not recommended for new programs. It assumes that the windows and the input and output options are the same as when memory was saved, but the terminal type and baud rate may be different.