4 <!-- Manpage converted by man2html 3.0.1 -->
8 term - format of compiled term file.
12 <H2>SYNOPSIS</H2><PRE>
17 <H2>DESCRIPTION</H2><PRE>
18 Compiled terminfo descriptions are placed under the direc-
19 tory <B>@DATADIR@/terminfo</B>. In order to avoid a linear
20 search of a huge UNIX system directory, a two-level scheme
21 is used: <B>/c/name</B> where <I>name</I> is the name of the terminal,
22 and <I>c</I> is the first character of <I>name</I>. Thus, <I>act4</I> can be
23 found in the file <B>@DATADIR@/terminfo/a/act4</B>. Synonyms for
24 the same terminal are implemented by multiple links to the
27 The format has been chosen so that it will be the same on
28 all hardware. An 8 or more bit byte is assumed, but no
29 assumptions about byte ordering or sign extension are
32 The compiled file is created with the <I>tic</I> program, and
33 read by the routine <I>setupterm</I>. The file is divided into
34 six parts: the header, terminal names, boolean flags, num-
35 bers, strings, and string table.
37 The header section begins the file. This section contains
38 six short integers in the format described below. These
39 integers are (1) the magic number (octal 0432); (2) the
40 size, in bytes, of the names section; (3) the number of
41 bytes in the boolean section; (4) the number of short
42 integers in the numbers section; (5) the number of offsets
43 (short integers) in the strings section; (6) the size, in
44 bytes, of the string table.
46 Short integers are stored in two 8-bit bytes. The first
47 byte contains the least significant 8 bits of the value,
48 and the second byte contains the most significant 8 bits.
49 (Thus, the value represented is 256*second+first.) The
50 value -1 is represented by the two bytes 0377, 0377; other
51 negative values are illegal. This value generally means
52 that the corresponding capability is missing from this
53 terminal. Note that this format corresponds to the hard-
54 ware of the VAX and PDP-11 (that is, little-endian
55 machines). Machines where this does not correspond to the
56 hardware must read the integers as two bytes and compute
57 the little-endian value.
59 The terminal names section comes next. It contains the
60 first line of the terminfo description, listing the vari-
61 ous names for the terminal, separated by the `|' charac-
62 ter. The section is terminated with an ASCII NUL charac-
65 The boolean flags have one byte for each flag. This byte
66 is either 0 or 1 as the flag is present or absent. The
67 capabilities are in the same order as the file <term.h>.
69 Between the boolean section and the number section, a null
70 byte will be inserted, if necessary, to ensure that the
71 number section begins on an even byte (this is a relic of
72 the PDP-11's word-addressed architecture, originally
73 designed in to avoid IOT traps induced by addressing a
74 word on an odd byte boundary). All short integers are
75 aligned on a short word boundary.
77 The numbers section is similar to the flags section. Each
78 capability takes up two bytes, and is stored as a little-
79 endian short integer. If the value represented is -1, the
80 capability is taken to be missing.
82 The strings section is also similar. Each capability is
83 stored as a short integer, in the format above. A value
84 of -1 means the capability is missing. Otherwise, the
85 value is taken as an offset from the beginning of the
86 string table. Special characters in ^X or \c notation are
87 stored in their interpreted form, not the printing repre-
88 sentation. Padding information $<nn> and parameter infor-
89 mation %x are stored intact in uninterpreted form.
91 The final section is the string table. It contains all
92 the values of string capabilities referenced in the string
93 section. Each string is null terminated.
95 Note that it is possible for <I>setupterm</I> to expect a differ-
96 ent set of capabilities than are actually present in the
97 file. Either the database may have been updated since
98 <I>setupterm</I> has been recompiled (resulting in extra unrecog-
99 nized entries in the file) or the program may have been
100 recompiled more recently than the database was updated
101 (resulting in missing entries). The routine <I>setupterm</I>
102 must be prepared for both possibilities - this is why the
103 numbers and sizes are included. Also, new capabilities
104 must always be added at the end of the lists of boolean,
105 number, and string capabilities.
107 Despite the consistent use of little-endian for numbers
108 and the otherwise self-describing format, it is not wise
109 to count on portability of binary terminfo entries between
110 commercial UNIX versions. The problem is that there are
111 at least three versions of terminfo (under HP-UX, AIX, and
112 OSF/1) which diverged from System V terminfo after SVr1,
113 and have added extension capabilities to the string table
114 that (in the binary format) collide with System V and XSI
115 Curses extensions. See <B><A HREF="terminfo.5.html">terminfo(5)</A></B> for detailed discus-
116 sion of terminfo source compatibility issues.
118 As an example, here is a hex dump of the description for
119 the Lear-Siegler ADM-3, a popular though rather stupid
125 bel=^G, clear= 32$<1>, cr=^M, cub1=^H, cud1=^J,
126 cuf1=^L, cup==%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
129 0000 1a 01 10 00 02 00 03 00 82 00 31 00 61 64 6d 33 ........ ..1.adm3
130 0010 61 7c 6c 73 69 20 61 64 6d 33 61 00 00 01 50 00 a|lsi ad m3a...P.
131 0020 ff ff 18 00 ff ff 00 00 02 00 ff ff ff ff 04 00 ........ ........
132 0030 ff ff ff ff ff ff ff ff 0a 00 25 00 27 00 ff ff ........ ..%.'...
133 0040 29 00 ff ff ff ff 2b 00 ff ff 2d 00 ff ff ff ff ).....+. ..-.....
134 0050 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
135 0060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
136 0070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
137 0080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
138 0090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
139 00a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
140 00b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
141 00c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
142 00d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
143 00e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
144 00f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
145 0100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
146 0110 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........
147 0120 ff ff ff ff ff ff 2f 00 07 00 0d 00 1a 24 3c 31 ....../. .....$<1
148 0130 3e 00 1b 3d 25 70 31 25 7b 33 32 7d 25 2b 25 63 >..=%p1% {32}%+%c
149 0140 25 70 32 25 7b 33 32 7d 25 2b 25 63 00 0a 00 1e %p2%{32} %+%c....
150 0150 00 08 00 0c 00 0b 00 0a 00 ........ .
153 Some limitations: total compiled entries cannot exceed
154 4096 bytes. The name field cannot exceed 128 bytes.
159 @DATADIR@/terminfo/*/* compiled terminal capability data
164 <H2>SEE ALSO</H2><PRE>
165 <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="terminfo.5.html">terminfo(5)</A></B>.
180 Man(1) output converted with
181 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>