source: trunk/minix/man/man3/termcap.3@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 3.8 KB
RevLine 
[9]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.
4.\"
5.\" @(#)termcap.3x 6.1 (Berkeley) 5/15/85
6.\"
7.TH TERMCAP 3 "May 15, 1985"
8.UC 4
9.SH NAME
10termcap, tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs \- terminal independent operation routines
11.SH SYNOPSIS
12.nf
13.ft B
14#include <termcap.h>
15
16int tgetent(char *\fIbp\fP, char *\fIname\fP)
17int tgetflag(char *\fIid\fP)
18int tgetnum(char *\fIid\fP)
19char *tgetstr(char *\fIid\fP, char **\fIarea\fP)
20char *tgoto(char *\fIcm\fP, int \fIdestcol\fP, int \fIdestline\fP)
21int tputs(char *\fIcp\fP, int \fIaffcnt\fP, void (*\fIoutc\fP)(int))
22.ft R
23.fi
24.SH DESCRIPTION
25These functions extract and use capabilities from the terminal capability data
26base
27.BR termcap (5).
28These are low level routines;
29see
30.BR curses (3)
31for a higher level package.
32.PP
33.B Tgetent
34extracts the entry for terminal
35.I name
36into the buffer at
37.IR bp .
38.I Bp
39should be a character buffer of size
401024 and must be retained through all subsequent calls
41to
42.BR tgetnum ,
43.BR tgetflag ,
44and
45.BR tgetstr .
46.B Tgetent
47returns \-1 if it cannot find a termcap
48file, 0 if the terminal name given does not have an entry,
49and 1 if all goes well.
50.PP
51.B Tgetent
52uses the following recipe to find the termcap file and entry
53.IR name :
54.PP
55.in +5n
56if $TERMCAP is itself a termcap entry for
57.I name
58.br
59then
60.in +5n
61use $TERMCAP
62.in -5n
63elif $TERMCAP names a file
64.br
65then
66.in +5n
67use entry
68.I name
69found in that file
70.in -5n
71elif this is Minix-vmd
72.br
73then
74.in +5n
75if $TERMPATH is defined
76.br
77then
78.in +5n
79search the termcap files named in $TERMPATH for the first occurance of a
80.I name
81entry and use that entry
82.in -5n
83else
84.in +5n
85the path
86.B $HOME/.termcap:/etc/termcap:/usr/etc/termcap"
87is searched for entry
88.I name
89.in -5n
90fi
91.in -5n
92fi
93.in -5n
94.RE
95.PP
96.B Tgetnum
97gets the numeric value of capability
98.IR id ,
99returning \-1 if is not given for the terminal.
100.B Tgetflag
101returns 1 if the specified capability is present in
102the terminal's entry, 0 if it is not.
103.B Tgetstr
104returns the string value of the capability
105.IR id ,
106places it in the buffer at
107.IR area ,
108and advances the
109.I area
110pointer.
111It decodes the abbreviations for this field described in
112.BR termcap (5),
113except for cursor addressing and padding information.
114.B Tgetstr
115returns NULL if the capability was not found.
116.PP
117.B Tgoto
118returns a cursor addressing string decoded from
119.I cm
120to go to column
121.I destcol
122in line
123.IR destline .
124It uses the external variables
125.B UP
126(from the \fBup\fR capability)
127and
128.B BC
129(if \fBbc\fR is given rather than \fBbs\fR)
130if necessary to avoid placing \fB\en\fR, \fB^D\fR or \fB^@\fR in
131the returned string.
132(Programs which call tgoto should be sure to turn off the XTABS bit(s),
133since
134.B tgoto
135may now output a tab.
136Note that programs using termcap should in general turn off XTABS
137anyway since some terminals use CTRL-I for other functions,
138such as nondestructive space.)
139If a \fB%\fR sequence is given which is not understood, then
140.B tgoto
141returns \*(lqOOPS\*(rq.
142.PP
143.B Tputs
144decodes the leading padding information of the string
145.IR cp ;
146.I affcnt
147gives the number of lines affected by the operation, or 1 if this is
148not applicable,
149.I outc
150is a routine which is called with each character in turn.
151The external variable
152.B ospeed
153should contain the output speed of the terminal as encoded by
154.BR stty (3).
155The external variable
156.B PC
157should contain a pad character to be used (from the \fBpc\fR capability)
158if a null (\fB^@\fR) is inappropriate.
159.SH SEE ALSO
160.BR curses (3),
161.BR termcap (5).
162.SH AUTHOR
163William Joy
164.SH NOTES
165The MINIX 3 implementation does not support any of the external variables,
166only the functions calls. The Minix-vmd termcap does support it all,
167although noone in his right mind meddles with those variables.
Note: See TracBrowser for help on using the repository browser.