DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

tc_getent(S)


tc_getent: tgetent, tgetflag, tgetnum, tgetstr, tgoto, tputs -- termcap database emulation

Syntax

cc ... -ltermcap

#define M_TERMCAP
#include <curses.h>

OR #include <tcap.h>

char buffer[1024*3]; /* buffer [TCAP_BUFSIZ] */ char *bp = buffer;

int tgetent(char *bp, char *name); int tgetflag(char id[2]); int tgetnum(char id[2]); char *tgetstr(char id[2], char **area); char *tgoto(char *cap, int col, int row); int tputs(char *str, int affcnt, int (*pufunc)(int));

Description

These routines are included in the termcap library and read descriptions from the termcap(F) database.

The tgetent( ) routine looks up the termcap entry for name, loading it into the buffer referenced by the buffer pointer bp. The referenced buffer has historically been 1K but here should be at least 2K (2048) because some of the termcap entries are this large. See ``Future directions''.

The tgetflag( ) routine gets the boolean entry for termcap boolean capability id.

The tgetnum( ) routine gets the numeric entry for termcap numeric capability id.

The tgetstr( ) routine returns the string entry for termcap string capability id. Use tparm( ) to instantiate and tputs( ) to output the returned string.

The tgoto( ) routine instantiates the cursor positioning parameters into the given (assumed cursor positioning) termcap capability. The returned ptr is to an internal static buffer and will be overwritten at the next invocation. The output from this routine should be passed to tputs( ).

The tputs( ) routine puts the character string str out, with padding as specified by the string. The number of affected lines is affcnt (or 1 if not applicable). putfunc is a routine like putchar(S) to which the characters are passed, one at a time, for actually doing the output.

Return values

The return values are:

tgetent
1 on success, less than or equal to 0 on error.

tgetflag
0 if no id is found, 1 otherwise.

tgetnum
On success, the numeric value; -1 if id is not found.

tgetstr
Returns the entry string value or NULL if there is no matching capability.

tgoto
ptr to instatiated string on success, NULL on error.

tputs
None.

Warning

The curses.h header file automatically includes the header files stdio.h and unctrl.h.

Future directions

The TCAP_BUFSIZ variable is planned for future versions of the tcap.h or curses.h header file to provide an indication of a safe maximum size. The current value for this is 2048. It is not supported before SCO OpenServer Release 5.0.6.

Files


/usr/lib/libtermcap.a

/usr/lib/libtermlib.a

See also

curses(S), curs_termcap(S), curs_terminfo(S), putc(S)

Standards conformance

tgetent(S), tgetflag(S), tgetnum(S), tgetstr(S), tgoto(S), and tputs(S) are not part of any currently supported standard; they were developed by UNIX System Laboratories, Inc. and are maintained by The SCO Group.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003