Manual Page Result
0
Command: set_term | Section: 3 | Source: Digital UNIX | File: set_term.3.gz
curs_initscr(3) Library Functions Manual curs_initscr(3)
NAME
curs_initscr, initscr, newterm, endwin, isendwin, set_term, delscreen -
Curses routines for screen initialization and manipulation
LIBRARY
Curses Library (libcurses.a, libcurses.so)
SYNOPSIS
#include <curses.h>
WINDOW *initscr(void); int endwin(void); int isendwin(void); SCREEN
*newterm(char *type, FILE *outfd,
FILE *infd); SCREEN *set_term(SCREEN *new); void
delscreen(SCREEN *sp);
STANDARDS
Interfaces documented on this reference page conform to industry stan-
dards as follows:
initscr, endwin, newterm, set_term: XPG4, XPG4-UNIX
isendwin, delscreen: XPG4-UNIX
Refer to the standards(5) reference page for more information about in-
dustry standards and associated tags.
DESCRIPTION
The initscr routine is almost always the first routine that applica-
tions call. (The exceptions are slk_init, filter, ripoffline, use_env
and, for multiple-terminal applications, newterm). The initscr routine
determines the terminal type and initializes all Curses data struc-
tures. The routine also causes the first call to refresh to clear the
screen. If errors occur, initscr writes an appropriate error message
to standard error and then exits; otherwise, the routine returns a
pointer to stdscr. If the program needs an indication of error condi-
tions, newterm should be used instead of initscr; initscr should only
be called once per application.
A program that outputs to more than one terminal should use the newterm
routine for each terminal instead of initscr. A program that needs an
indication of error conditions, so it can continue to run in a line-
oriented mode if the terminal cannot support a screen-oriented program,
would also use newterm. An application calls newterm once for each
terminal. The routine returns a variable of type SCREEN * that should
be saved as a reference to that terminal. The routine's arguments are
the type of the terminal to be used in place of $TERM, a file pointer
for output to the terminal, and another file pointer for input from the
terminal. (If type is NULL, $TERM is used). Before exiting Curses, the
program must also call endwin for each terminal being used. If the
program calls newterm more than once for the same terminal, the first
terminal referred to must be the last one for which endwin is called.
A program should always call endwin before exiting or escaping from
Curses mode temporarily. This routine restores tty modes, moves the
cursor to the lower left-hand corner of the screen, and resets the ter-
minal into the proper nonvisual mode. Calling refresh or doupdate af-
ter a temporary escape causes the program to resume visual mode.
The isendwin routine returns TRUE if endwin has been called without any
subsequent calls to wrefresh; otherwise, the routine returns FALSE.
The set_term routine switches between different terminals. The screen
reference new becomes the new current terminal. The routine returns
the previous terminal. This is the only routine that manipulates
SCREEN pointers; all other routines affect only the current terminal.
The delscreen routine frees storage associated with the SCREEN data
structure. The endwin routine does not perform this operation, so ap-
plications should call delscreen after endwin if a particular SCREEN is
no longer needed. Applications must also close file pointers passed to
newterm.
NOTES
The header file curses.h automatically includes the header file
stdio.h.
RETURN VALUES
The endwin routine returns the integer ERR upon failure and OK upon
successful completion.
Routines that return pointers always return NULL on error.
RELATED INFORMATION
Functions: curses(3), curs_kernel(3), curs_refresh(3), curs_slk(3),
curs_util(3)
Others: standards(5) delim off
curs_initscr(3)