.TH setupterm() "" "" "terminfo Function"
.PC "Initialize a terminal"
.B "#include <curses.h>"
\fBsetupterm(\fIterm\^\fB,\fIfd\^\fB,\fIerrret\^\fB)\fR
\fBchar *\fIterm\^\fB;\fR
\fBint \fIfd\^\fB, *\fIerrret\^\fB;\fR
.PP
\*(CO comes with a set of
functions that let you use \fBterminfo\fR descriptions
to manipulate a terminal.
.B setupterm()
initializes terminal capabilities for terminal type \fIterm\fR,
which is accessed via file-descriptor \fIfd\fR.
It inhales all capabilities at once, and performs
all other system-dependent initialization \(em which is one reason why
.B terminfo
is much faster than
.BR termcap .
.PP
If
.I term
is initialized to NULL,
\fBsetupterm()\fR uses the contents of the environmental variable
.B TERM
as a default.
.PP
\fIerrret\fR points to an integer into which \fBsetupterm()\fR writes the
terminal's status:
zero if there is no such terminal type,
one if all went well, or \-1 if something has gone wrong.
If
.I erret
is NULL, \fBsetupterm()\fR prints
an error message and exits if the terminal cannot be found.
.SH "See Also"
.Xr "terminfo" terminfo
