NAME

termcap - access terminal capabilities database

SYNOPSIS

int terment()

int termflag(id)
char *id;

int termnum(id)
char *id;

char *termstr(id)
char *id;

char *termgoto(cm, row, col, pn)
char *cm;
int row, col, *pn;

char *termpad(s, pn)
char *s;
int *pn;

DESCRIPTION

These functions access the systemís terminal capabilities database.  For a description of this database refer to termcap(5) or terminfo(4), depending on the ancestry of the system.  These functions allocate space with malloc(3). 

Terment uses the environment variable TERM to obtain and store the terminalís entry from the database for subsequent use by termnum and termstr.  This function normally returns zero. 

Termflag returns non-zero if the boolean terminal capability given by the termcap i.code id is set. 

Termnum returns the value of the terminal capability given by the termcap i.code id

Termstr allocates and returns a pointer to the null-terminated string terminal capability given by the termcap i.code id

Termgoto allocates and returns a pointer to a character sequence which will move the cursor to the location row, col.  Rows and columns are numbered starting with zero.  Cm is the general cursor motion command obtained previously using termstr.  This function interprets padding information.  *Pn is assigned the length of the sequence. 

Termpad interprets padding information.  This function allocates and returns a pointer to a character sequence for the string terminal capability s obtained previously using termstr*Pn is assigned the length of the sequence. 

These functions support cls(misc). 

SEE ALSO

cls(misc)
malloc(3), terminfo(4) or termcap(5) in the UNIX Programmerís Manual

DIAGNOSTICS

Terment returns non-zero in case of trouble. 

Termflag returns zero, termnum returns -1 and termstr returns the null string if the capability can not be obtained. 

Termstr, termgoto and termpad return zero if malloc(3) fails. 

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber