1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a *
5 .\" copy of this software and associated documentation files (the *
6 .\" "Software"), to deal in the Software without restriction, including *
7 .\" without limitation the rights to use, copy, modify, merge, publish, *
8 .\" distribute, distribute with modifications, sublicense, and/or sell *
9 .\" copies of the Software, and to permit persons to whom the Software is *
10 .\" furnished to do so, subject to the following conditions: *
12 .\" The above copyright notice and this permission notice shall be included *
13 .\" in all copies or substantial portions of the Software. *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 .\" Except as contained in this notice, the name(s) of the above copyright *
24 .\" holders shall not be used in advertising or otherwise to promote the *
25 .\" sale, use or other dealings in this Software without prior written *
27 .\"***************************************************************************
29 .\" $Id: term.5,v 1.15 2003/05/10 20:33:49 jmc Exp $
30 .\" $DragonFly: src/lib/libncurses/man/term.5,v 1.1 2005/03/12 19:13:54 eirikn Exp $
33 .ds d /usr/share/terminfo
35 term \- format of compiled term file.
40 Compiled terminfo descriptions are placed under the directory \fB\*d\fP.
41 In order to avoid a linear search of a huge \s-1UNIX\s+1 system directory, a
42 two-level scheme is used: \fB\*d/c/name\fP
45 is the name of the terminal, and
47 is the first character of
51 can be found in the file \fB\*d/a/act4\fP.
52 Synonyms for the same terminal are implemented by multiple
53 links to the same compiled file.
55 The format has been chosen so that it will be the same on all hardware.
56 An 8 or more bit byte is assumed, but no assumptions about byte ordering
57 or sign extension are made.
59 The compiled file is created with the
61 program, and read by the routine
63 The file is divided into six parts:
72 The header section begins the file.
73 This section contains six short integers in the format
76 (1) the magic number (octal 0432);
77 (2) the size, in bytes, of the names section;
78 (3) the number of bytes in the boolean section;
79 (4) the number of short integers in the numbers section;
80 (5) the number of offsets (short integers) in the strings section;
81 (6) the size, in bytes, of the string table.
83 Short integers are stored in two 8-bit bytes.
84 The first byte contains the least significant 8 bits of the value,
85 and the second byte contains the most significant 8 bits.
86 (Thus, the value represented is 256*second+first.)
87 The value \-1 is represented by the two bytes 0377, 0377; other negative
88 values are illegal. This value generally
89 means that the corresponding capability is missing from this terminal.
90 Note that this format corresponds to the hardware of the \s-1VAX\s+1
91 and \s-1PDP\s+1-11 (that is, little-endian machines).
92 Machines where this does not correspond to the hardware must read the
93 integers as two bytes and compute the little-endian value.
95 The terminal names section comes next.
96 It contains the first line of the terminfo description,
97 listing the various names for the terminal,
98 separated by the `|' character.
99 The section is terminated with an \s-1ASCII NUL\s+1 character.
101 The boolean flags have one byte for each flag.
102 This byte is either 0 or 1 as the flag is present or absent.
103 The capabilities are in the same order as the file <term.h>.
105 Between the boolean section and the number section,
106 a null byte will be inserted, if necessary,
107 to ensure that the number section begins on an even byte (this is a
108 relic of the PDP-11's word-addressed architecture, originally
109 designed in to avoid IOT traps induced by addressing a word on an
111 All short integers are aligned on a short word boundary.
113 The numbers section is similar to the flags section.
114 Each capability takes up two bytes,
115 and is stored as a little-endian short integer.
116 If the value represented is \-1, the capability is taken to be missing.
118 The strings section is also similar.
119 Each capability is stored as a short integer, in the format above.
120 A value of \-1 means the capability is missing.
121 Otherwise, the value is taken as an offset from the beginning
123 Special characters in ^X or \ec notation are stored in their
124 interpreted form, not the printing representation.
125 Padding information $<nn> and parameter information %x are
126 stored intact in uninterpreted form.
128 The final section is the string table.
129 It contains all the values of string capabilities referenced in
131 Each string is null terminated.
133 Note that it is possible for
135 to expect a different set of capabilities
136 than are actually present in the file.
137 Either the database may have been updated since
140 (resulting in extra unrecognized entries in the file)
141 or the program may have been recompiled more recently
142 than the database was updated
143 (resulting in missing entries).
146 must be prepared for both possibilities \-
147 this is why the numbers and sizes are included.
148 Also, new capabilities must always be added at the end of the lists
149 of boolean, number, and string capabilities.
151 Despite the consistent use of little-endian for numbers and the otherwise
152 self-describing format, it is not wise to count on portability of binary
153 terminfo entries between commercial UNIX versions. The problem is that there
154 are at least three versions of terminfo (under HP-UX, AIX, and OSF/1) which
155 diverged from System V terminfo after SVr1, and have added extension
156 capabilities to the string table that (in the binary format) collide with
157 System V and XSI Curses extensions. See \fBterminfo\fR(\*n) for detailed
158 discussion of terminfo source compatibility issues.
160 As an example, here is a hex dump of the description for the Lear-Siegler
161 ADM-3, a popular though rather stupid early terminal:
167 bel=^G, clear=\032$<1>, cr=^M, cub1=^H, cud1=^J,
168 cuf1=^L, cup=\\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
172 \s-20000 1a 01 10 00 02 00 03 00 82 00 31 00 61 64 6d 33 ........ ..1.adm3
173 0010 61 7c 6c 73 69 20 61 64 6d 33 61 00 00 01 50 00 a|lsi ad m3a...P.
174 0020 ff ff 18 00 ff ff 00 00 02 00 ff ff ff ff 04 00 ........ ........
175 0030 ff ff ff ff ff ff ff ff 0a 00 25 00 27 00 ff ff ........ ..%.'...
176 0040 29 00 ff ff ff ff 2b 00 ff ff 2d 00 ff ff ff ff ).....+. ..-.....
177 0050 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
178 0060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
179 0070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
180 0080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
181 0090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
182 00a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
183 00b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
184 00c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
185 00d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
186 00e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
187 00f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
188 0100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
189 0110 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
190 0120 ff ff ff ff ff ff 2f 00 07 00 0d 00 1a 24 3c 31 ....../. .....$<1
191 0130 3e 00 1b 3d 25 70 31 25 7b 33 32 7d 25 2b 25 63 >..=%p1% {32}%+%c
192 0140 25 70 32 25 7b 33 32 7d 25 2b 25 63 00 0a 00 1e %p2%{32} %+%c....
193 0150 00 08 00 0c 00 0b 00 0a 00 ........ .\s+2
198 Some limitations: total compiled entries cannot exceed 4096 bytes.
199 The name field cannot exceed 128 bytes.
201 \*d/*/* compiled terminal capability data base
203 \fBcurses\fR(3X), \fBterminfo\fR(\*n).
205 .\"# The following sets edit modes for GNU EMACS
206 .\"# Local Variables: