+ The initscr code determines the terminal type and initializes all <STRONG>curs-</STRONG>
+ <STRONG>es</STRONG> data structures. <STRONG>initscr</STRONG> also causes the first call to <STRONG><A HREF="curscurs_refresh.3x.html">refresh(3x)</A></STRONG>
+ to clear the screen. If errors occur, <STRONG>initscr</STRONG> writes an appropriate
+ error message to standard error and exits; otherwise, a pointer is re-
+ turned to <STRONG>stdscr</STRONG>.
+
+
+</PRE><H3><a name="h3-newterm">newterm</a></H3><PRE>
+ A program that outputs to more than one terminal should use the <STRONG>newterm</STRONG>
+ routine for each terminal instead of <STRONG>initscr</STRONG>. A program that needs to
+ inspect capabilities, so it can continue to run in a line-oriented mode
+ if the terminal cannot support a screen-oriented program, would also
+ use <STRONG>newterm</STRONG>. The routine <STRONG>newterm</STRONG> should be called once for each termi-
+ nal. It returns a variable of type <STRONG>SCREEN</STRONG> <STRONG>*</STRONG> which should be saved as a
+ reference to that terminal. <STRONG>newterm</STRONG>'s arguments are
+
+ <STRONG>o</STRONG> the <EM>type</EM> of the terminal to be used in place of <STRONG>$TERM</STRONG>,
+
+ <STRONG>o</STRONG> a file pointer for output to the terminal, and
+
+ <STRONG>o</STRONG> another file pointer for input from the terminal
+
+ If the <EM>type</EM> parameter is <STRONG>NULL</STRONG>, <STRONG>$TERM</STRONG> will be used.
+
+
+</PRE><H3><a name="h3-endwin">endwin</a></H3><PRE>
+ The program must also call <STRONG>endwin</STRONG> for each terminal being used before
+ exiting from <STRONG>curses</STRONG>. If <STRONG>newterm</STRONG> is called more than once for the same
+ terminal, the first terminal referred to must be the last one for which
+ <STRONG>endwin</STRONG> is called.
+
+ A program should always call <STRONG>endwin</STRONG> before exiting or escaping from
+ <STRONG>curses</STRONG> mode temporarily. This routine
+
+ <STRONG>o</STRONG> resets colors to correspond with the default color pair 0,
+
+ <STRONG>o</STRONG> moves the cursor to the lower left-hand corner of the screen,
+
+ <STRONG>o</STRONG> clears the remainder of the line so that it uses the default col-
+ ors,
+
+ <STRONG>o</STRONG> sets the cursor to normal visibility (see <STRONG><A HREF="curs_kernel.3x.html">curs_set(3x)</A></STRONG>),
+
+ <STRONG>o</STRONG> stops cursor-addressing mode using the <EM>exit</EM><STRONG>_</STRONG><EM>ca</EM><STRONG>_</STRONG><EM>mode</EM> terminal capa-
+ bility,
+
+ <STRONG>o</STRONG> restores tty modes (see <STRONG><A HREF="curs_kernel.3x.html">reset_shell_mode(3x)</A></STRONG>).
+
+ Calling <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> or <STRONG><A HREF="curs_refresh.3x.html">doupdate(3x)</A></STRONG> after a temporary escape causes the
+ program to resume visual mode.
+
+
+</PRE><H3><a name="h3-isendwin">isendwin</a></H3><PRE>
+ The <STRONG>isendwin</STRONG> routine returns <STRONG>TRUE</STRONG> if <STRONG>endwin</STRONG> has been called without any
+ subsequent calls to <STRONG>wrefresh</STRONG>, and <STRONG>FALSE</STRONG> otherwise.
+
+
+</PRE><H3><a name="h3-set_term">set_term</a></H3><PRE>
+ The <STRONG>set_term</STRONG> routine is used to switch between different terminals.
+ The screen reference <STRONG>new</STRONG> becomes the new current terminal. The previ-
+ ous terminal is returned by the routine. This is the only routine
+ which manipulates <STRONG>SCREEN</STRONG> pointers; all other routines affect only the
+ current terminal.
+
+
+</PRE><H3><a name="h3-delscreen">delscreen</a></H3><PRE>
+ The <STRONG>delscreen</STRONG> routine frees storage associated with the <STRONG>SCREEN</STRONG> data
+ structure. The <STRONG>endwin</STRONG> routine does not do this, so <STRONG>delscreen</STRONG> should be
+ called after <STRONG>endwin</STRONG> if a particular <STRONG>SCREEN</STRONG> is no longer needed.
+
+
+</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
+ <STRONG>endwin</STRONG> returns the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon successful com-
+ pletion.