TTYCAP(VII) − PWB/UNIX 11/16/77
NAME
ttycap − routines to easily deal with ttycap data base
DESCRIPTION
This set of routines allows easy use of the ttycap (V) data base and insulates programs from changes to its structure. The entry points defined are:
tgetent(buf, name)
char buf[], *name;
Get the entry for the teletype whose name is name into the buffer buf. Returns −1 if an error occurs opening ttycap in which case the character variable ttycap may be used with perror (III) to produce an appropriate diagnostic. Returns 0 if the ttycap file is available, but no entry for the given name could be found. Returns 1 if the entry was found. It is placed in buf and the address of buf is remembered for use by the rest of the routines here.
tgetmodes(mdvec)
int mdvec[];
Get the modes from the current buffer and place them in positions 0 and 1 of the array mdvec.
tgetnum(id);
char *id;
Get the value of the numeric option id and return it as value. Returns −1 if there is no such option.
tgetflag(id);
char *id;
Return the value of the flag id. Zero means the flag does not appear, 1 means it does.
tgetstr(id, area)
char *id, **area;
Get the string value of id and return a pointer to it. All decoding is done for escapes. The string is placed in area which is updated to point to the next location after the end of the string. A 0 (NIL) pointer is returned if there is no such string value defined for this terminal type entry.
LIMITATIONS
To insure no buffer overflow, buf should be 512 characters large. Actually, the maximum length of any entry in /etc/ttycap is large enough.
FILES
/etc/ttycapcapability data base
SEE ALSO
ttycap (V), ttytype (V), ttytype (VI), typeof (VII)
AUTHOR
William Joy
BUGS