summaryrefslogtreecommitdiff
path: root/static/netbsd/man5/capfile.5
blob: f9778d6c933df5307f408e71a2d47953e15f13f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
.\"	$NetBSD: capfile.5,v 1.5 2020/08/23 20:23:56 tpaul Exp $
.\"
.\" Copyright (c) 2012 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Roy Marples.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd March 27, 2012
.Dt CAPFILE 5
.Os
.Sh NAME
.Nm capfile
.Nd capability database files
.Sh DESCRIPTION
.Nm
describes the format of capability database files,
made popular by
.Nm termcap .
.Nm termcap
itself has been superseded by
.Xr terminfo 5 ,
which contains equivalent
.Nm termcap
capabilities,
and this page exists solely to document the
.Nm termcap
format as it is still used by other programs such as
.Xr rtadvd.conf 5 .
.Pp
Entries in
.Nm
consist of a number of `:'-separated fields.
The first entry for each record gives the names that are known for the
record, separated by `|' characters.
By convention, the last name is usually a comment and is not intended as a
lookup tag.
The entry must be terminated by the `:' character.
.Ss A Sample Entry
The following entry describes the Teletype model 33.
.Pp
.Bd -literal
T3\||\|tty33\||\|33\||\|tty\||\|Teletype model 33:\e
	:bl=^G:co#72:.cr=9^M:cr=^M:do=^J:hc:os:am@:
.Ed
.Pp
Entries may continue onto multiple lines by giving a \e as the last
character of a line, and empty fields
may be included for readability (here between the last field on a line
and the first field on the next).
Comments may be included on lines beginning with
.Dq # .
.Ss Types of Capabilities
Capabilities in
.Nm
are of three types: Boolean capabilities,
numeric capabilities,
and string capabilities.
.Pp
Boolean capabilities are just the name, to indicate the ability is present.
.Pp
Numeric capabilities are followed by the character `#' then the value.
In the example above
.Sy \&co
gives the value `72'.
.Pp
String capabilities are followed by the character `=' and then the string.
In the example above
.Sy \&bl
gives the value `^G'.
.Pp
Sometimes individual capabilities must be commented out.
To do this, put a period (`.') before the capability name.
For example, see the first
.Sy \&cr
in the example above.
.Pp
Sometimes individual capabilities must be marked as absent.
To do this, put a @ after the capability name.
For example, see the last
.Sy \&am
in the example above.
This is only useful when merging entries.
See the tc=name discussion below for more details.
.Ss Encoding
Numeric capability values may be given in one of three numeric bases.
If the number starts with either
.Ql 0x
or
.Ql 0X
it is interpreted as a hexadecimal number (both upper and lower case a-f
may be used to denote the extended hexadecimal digits).
Otherwise, if the number starts with a
.Ql 0
it is interpreted as an octal number.
Otherwise the number is interpreted as a decimal number.
.Pp
String capability values may contain any character.
Non-printable
.Dv ASCII
codes, new lines, and colons may be conveniently represented by the use
of escape sequences:
.Bl -column "\eX,X\eX" "(ASCII octal nnn)"
.It ^X	('\fIX\fP' & 037)	control-\fIX\fP
.It \eb, \eB	(ASCII 010)	backspace
.It \et, \eT	(ASCII 011)	tab
.It \en, \eN	(ASCII 012)	line feed (newline)
.It \ef, \eF	(ASCII 014)	form feed
.It \er, \eR	(ASCII 015)	carriage return
.It \ee, \eE	(ASCII 027)	escape
.It \ec, \eC	(:)	colon
.It \e\e	(\e\|)	back slash
.It \e^	(^)	caret
.It \e\fInnn\fP	(ASCII octal \fInnn\fP)
.El
.Pp
A
.Sq \e
followed by up to three octal digits directly specifies
the numeric code for a character.
The use of
.Tn ASCII
.Dv NUL Ns s ,
while easily
encoded, causes all sorts of problems and must be used with care since
.Dv NUL Ns s
are typically used to denote the end of strings; many applications
use
.Sq \e200
to represent a
.Dv NUL .
.Pp
A special capability,
.Qq tc=name ,
is used to indicate that the record specified by
.Fa name
should be substituted for the
.Qq tc
capability.
.Qq tc
capabilities may interpolate records which also contain
.Qq tc
capabilities and more than one
.Qq tc
capability may be used in a record.
A
.Qq tc
expansion scope (i.e. where the argument is searched for) contains the
file in which the
.Qq tc
is declared and all subsequent files in the file array.
.Sh SEE ALSO
.Xr cgetcap 3 ,
.Xr termcap 3 ,
.Xr terminfo 5
.Sh HISTORY
.Nm termcap
described the capabilities of terminals, used by programs such as
.Xr vi 1
and
.Xr hack 6 .
These programs still use
.Nm termcap
today, but their capability requests are mapped onto
.Xr terminfo 5
ones instead.
As such, the termcap database file is no longer shipped with
.Nx .
.Sh AUTHORS
.An Roy Marples Aq Mt roy@NetBSD.org