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