Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ex(1)

termio(4)

terminfo(5)

TERMCAP(3X)

NAME

tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs − emulate /etc/termcap access routines

SYNOPSIS

tgetent(bp, name)
char *bp, *name;

tgetnum(id)
char *id;

tgetflag(id)
char *id;

char *
tgetstr(id, area)
char *id, **area;

char *
tgoto(cm, destcol, destline)
char *cm;

tputs(cp, affcnt, outc)
register char *cp;
int affcnt;
int (*outc)();

HP-UX COMPATIBILITY

Level: HP-UX/STANDARD

Origin: System V

DESCRIPTION

Termcap(3) functions extract and use capabilities from the compiled terminal capability data bases (see terminfo(5)).  They are emulation routines that are provided as a part of the curses(3X) library. 

Tgetent extracts the compiled entry for terminal name into buffers accessible by the programmer.  Unlike previous termcap routines, all capability strings (except cursor addressing and padding information) are already compiled and stored internally upon return from tgetent.  The buffer pointer bp is redundant in the emulation, and is ignored.  It should not be relied upon to point to meaningful information.  Tgetent returns −1 if it cannot access the terminfo directory, 0 if there is no capability file for name, and 1 if all goes well.  If a TERMINFO environment variable is set, tgetent first looks for TERMINFO/?/name (where ? is the first character of name), and if that file is not accessible, it looks for /usr/lib/terminfo/?/name. 

Tgetnum gets the numeric value of capability id, returning −1 if it is not given for the terminal.  Tgetnum is useful only with capabilities having numeric values. 

Tgetflag returns 1 if the specified capability is present in the terminal’s entry, and 0 if it is not.  Tgetflag is useful only with capabilities that are boolean in nature (i.e. either present or missing in terminfo(5)). 

Tgetstr returns a pointer to the string value of capability id. In addition, if area is not a NULL pointer, tgetstr will place the capability in the buffer at area and advance the area pointer.  The returned string capability is compiled except for cursor addressing and padding information.  Tgetstr is useful only with capabilities having string values.  Tgetstr returns a NULL pointer if the capability is not available on the terminal or id is not a string capability. 

Tgoto returns a cursor addressing string decoded from cm to go to column destcol in line destline. (Programs which call tgoto should be sure to turn off the TAB3 bit(s), since tgoto may now output a tab.  See termio(4).  Note that programs using termcap should in general turn off TAB3 anyway since some terminals use control−I for other functions, such as nondestructive space.)  If a % sequence is given which is not understood, then tgoto returns “OOPS”. 

Tputs decodes the padding information of the string cp.  Affcnt gives the number of lines affected by the operation, or 1 if this is not applicable.  Outc is a routine which is called with each character in turn.  The terminfo variable pad_char should contain a pad character to be used (from the pc capability) if a null (^@) is inappropriate. 

FILES

/usr/lib/libcurses.a−lcurses library
/usr/lib/terminfo/?/*data bases

SEE ALSO

ex(1), termio(4), terminfo(5). 
 
 
 
 
 

Hewlett-Packard  —  last mod. May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026