DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

tc_getent(S-osr5)


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-osr5) 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-osr5), curs_termcap(S-osr5), curs_terminfo(S-osr5), putc(S-osr5)

Standards conformance

tgetent(S-osr5), tgetflag(S-osr5), tgetnum(S-osr5), tgetstr(S-osr5), tgoto(S-osr5), and tputs(S-osr5) are not part of any currently supported standard; they were developed by UNIX System Laboratories, Inc. and are maintained by The SCO Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005