COHERENT manpages

This page displays the COHERENT manpage for tgetent() [Read termcap entry].

List of available manpages
Index


tgetent() -- termcap Function (libterm)

Read termcap entry
#include <curses.h>
#include <term.h>
int tgetent(bp, name)
char *bp, *name;

tgetent()  is one  of  a set  of  functions that  read  a termcap  terminal
description.  It extracts the entry from file /etc/termcap for the terminal
name and  writes it into a  buffer at address bp. bp  should be a character
buffer of 1,024 bytes and must  be retained through all subsequent calls to
the other functions.  It returns -1 if it cannot open /etc/termcap, zero if
the terminal name  given does not have an entry,  and one upon a successful
search.

tgetent() first looks in the environment to see if the termcap variable had
already been set.  If it finds that the variable termcap has been set, that
the value does  not begin with a slash, and  that the terminal type name in
the termcap variable is the same  as that in the environment variable TERM,
then  tgetent()  uses  the  termcap  string  instead of  reading  the  file
/etc/termcap. However, if the termcap  string does begin with a slash, then
it is  used as  the path  name of a  terminal-capabilities file  other than
/etc/termcap. This  can speed entry into programs  that call tgetent(), and
can be used to help debug new terminal descriptions.

Files

/etc/termcap -- Terminal capabilities data base
/usr/lib/libterm.a -- Function library

See Also

termcap