1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)termcap.3x 6.1 (Berkeley) 5/15/85
7 .TH TERMCAP 3 "May 15, 1985"
10 termcap, tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs \- terminal independent operation routines
16 int tgetent(char *\fIbp\fP, char *\fIname\fP)
17 int tgetflag(char *\fIid\fP)
18 int tgetnum(char *\fIid\fP)
19 char *tgetstr(char *\fIid\fP, char **\fIarea\fP)
20 char *tgoto(char *\fIcm\fP, int \fIdestcol\fP, int \fIdestline\fP)
21 int tputs(char *\fIcp\fP, int \fIaffcnt\fP, void (*\fIoutc\fP)(int))
25 These functions extract and use capabilities from the terminal capability data
28 These are low level routines;
31 for a higher level package.
34 extracts the entry for terminal
39 should be a character buffer of size
40 1024 and must be retained through all subsequent calls
47 returns \-1 if it cannot find a termcap
48 file, 0 if the terminal name given does not have an entry,
49 and 1 if all goes well.
52 uses the following recipe to find the termcap file and entry
56 if $TERMCAP is itself a termcap entry for
63 elif $TERMCAP names a file
71 elif this is Minix-vmd
75 if $TERMPATH is defined
79 search the termcap files named in $TERMPATH for the first occurance of a
81 entry and use that entry
86 .B $HOME/.termcap:/etc/termcap:/usr/etc/termcap"
97 gets the numeric value of capability
99 returning \-1 if is not given for the terminal.
101 returns 1 if the specified capability is present in
102 the terminal's entry, 0 if it is not.
104 returns the string value of the capability
106 places it in the buffer at
111 It decodes the abbreviations for this field described in
113 except for cursor addressing and padding information.
115 returns NULL if the capability was not found.
118 returns a cursor addressing string decoded from
124 It uses the external variables
126 (from the \fBup\fR capability)
129 (if \fBbc\fR is given rather than \fBbs\fR)
130 if necessary to avoid placing \fB\en\fR, \fB^D\fR or \fB^@\fR in
132 (Programs which call tgoto should be sure to turn off the XTABS bit(s),
135 may now output a tab.
136 Note that programs using termcap should in general turn off XTABS
137 anyway since some terminals use CTRL-I for other functions,
138 such as nondestructive space.)
139 If a \fB%\fR sequence is given which is not understood, then
141 returns \*(lqOOPS\*(rq.
144 decodes the leading padding information of the string
147 gives the number of lines affected by the operation, or 1 if this is
150 is a routine which is called with each character in turn.
151 The external variable
153 should contain the output speed of the terminal as encoded by
155 The external variable
157 should contain a pad character to be used (from the \fBpc\fR capability)
158 if a null (\fB^@\fR) is inappropriate.
165 The MINIX 3 implementation does not support any of the external variables,
166 only the functions calls. The Minix-vmd termcap does support it all,
167 although noone in his right mind meddles with those variables.