CAPFILE(5)
πΎ CAPFILE(5) β capability database files Β· File Formats Manual β¨
π NAME π
capfile β capability database files. Short, iconic, periodt β no cap.
πΈ DESCRIPTION πΈ
Okay so capfile describes the format of capability database files, made popular by termcap. Big lore drop: termcap itself has been superseded by terminfo(5), which contains equivalent termcap capabilities, and this page exists solely to document the termcap format as it is still used by other programs such as rtadvd.conf(5). Legacy behavior ate, ngl.
Entries in capfile 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. That colon is not optional, bestie β it's the vibe check at the end of the record. Lowkey crucial.
π A Sample Entry π
The following entry describes the Teletype model 33:
T3|tty33|33|tty|Teletype model 33:\
:bl=^G:co#72:.cr=9^M:cr=^M:do=^J:hc:os:am@:
Entries may continue onto multiple lines by giving a \ 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 #.
β¨ Types of Capabilities β¨
Capabilities in capfile are of three types: Boolean capabilities, numeric capabilities, and string capabilities.
- Boolean capabilities are just the name, to indicate the ability is present.
- Numeric capabilities are followed by the character
#then the value. In the example abovecogives the value72. - <skyblue>String capabilities</skyblue> are followed by the character
=and then the string. In the example aboveblgives the value^G.
Sometimes individual capabilities must be commented out. To do this, put a period (.) before the capability name. For example, see the first cr in the example above.
Sometimes individual capabilities must be marked as absent. To do this, put a @ after the capability name. For example, see the last am in the example above. This is only useful when merging entries. See the tc=name discussion below for more details.
π’ Encoding π’
Numeric capability values may be given in one of three numeric bases. If the number starts with either 0x or 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 0 it is interpreted as an octal number. Otherwise the number is interpreted as a decimal number.
String capability values may contain any character. Non-printable ASCII codes, new lines, and colons may be conveniently represented by the use of escape sequences:
^Xβ ('X' & 037) β control-X\b,\Bβ (ASCII 010) β backspace\t,\Tβ (ASCII 011) β tab\n,\Nβ (ASCII 012) β line feed (newline)\f,\Fβ (ASCII 014) β form feed\r,\Rβ (ASCII 015) β carriage return\e,\Eβ (ASCII 027) β escape\c,\Cβ (:) β colon\\β (\) β back slash\^β (^) β caret\nnnβ (ASCII octalnnn)
A \ followed by up to three octal digits directly specifies the numeric code for a character. The use of ASCII NULs, while easily encoded, causes all sorts of problems and must be used with care since NULs are typically used to denote the end of strings; many applications use \200 to represent a NUL.
π¨ NUL warning unlocked: this is highkey a real βhandle with careβ situation. NULs are typically used to denote the end of strings, so yeah β not the moment for chaos energy.
A special capability, tc=name, is used to indicate that the record specified by name should be substituted for the tc capability. tc capabilities may interpolate records which also contain tc capabilities and more than one tc capability may be used in a record. A tc expansion scope (i.e. where the argument is searched for) contains the file in which the tc is declared and all subsequent files in the file array.
π SEE ALSO π
Go look at cgetcap(3), termcap(3), and terminfo(5). The whole cross-reference squad, slay.
π¦ HISTORY π¦
termcap described the capabilities of terminals, used by programs such as vi(1) and hack(6). These programs still use termcap today, but their capability requests are mapped onto terminfo(5) ones instead. As such, the termcap database file is no longer shipped with NetBSD. Periodt.
π AUTHORS π
Roy Marples <roy@NetBSD.org> β author credit, main character energy.
Debian Β· March 27, 2012 Β· CAPFILE(5) β that's the footer, bestie, mwah π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2012 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms