2 .\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TERM 4 "Jul 3, 1996"
8 term \- format of compiled term file
12 \fB/usr/share/lib/terminfo/?/*\fR
18 The \fBterm\fR file is compiled from \fBterminfo\fR(4) source files using
19 \fBtic\fR(1M). Compiled files are organized in a directory hierarchy under the
20 first letter of each terminal name. For example, the \fBvt100\fR file would
21 have the pathname \fB/usr/lib/terminfo/v/vt100\fR. The default directory is
22 \fB/usr/share/lib/terminfo\fR. Synonyms for the same terminal are implemented
23 by multiple links to the same compiled file.
26 The format has been chosen so that it is the same on all hardware. An 8-bit
27 byte is assumed, but no assumptions about byte ordering or sign extension are
28 made. Thus, these binary \fBterminfo\fR files can be transported to other
29 hardware with 8-bit bytes.
32 Short integers are stored in two 8-bit bytes. The first byte contains the least
33 significant 8 bits of the value, and the second byte contains the most
34 significant 8 bits. (Thus, the value represented is
35 256*\fIsecond\fR+\fIfirst\fR.) The value \fB\(mi1\fR is represented by
36 \fB0377,0377\fR, and the value \fB\(mi2\fR is represented by \fB0376,0377\fR;
37 other negative values are illegal. The \fB\(mi1\fR generally means that a
38 capability is missing from this terminal. The \fB\(mi2\fR means that the
39 capability has been cancelled in the \fBterminfo\fR source and also is to be
43 The compiled file is created from the source file descriptions of the terminals
44 (see the \fB-I\fR option of \fBinfocmp\fR) by using the \fBterminfo\fR
45 compiler, \fBtic\fR, and read by the routine \fBsetupterm\fR (see
46 \fBcurses\fR(3CURSES)). The file is divided into six parts in the following
47 order: the header, terminal names, boolean flags, numbers, strings, and string
51 The header section begins the file six short integers in the format described
52 below. These integers are:
56 the magic number (octal \fB0432\fR);
61 the size, in bytes, of the names section;
66 the number of bytes in the boolean section
71 the number of short integers in the numbers section;
76 the number of offsets (short integers) in the strings section;
81 the size, in bytes, of the string table.
85 The terminal name section comes next. It contains the first line of the
86 \fBterminfo\fR description, listing the various names for the terminal,
87 separated by the bar ( | ) character (see \fBterm\fR(5)). The section is
88 terminated with an \fBASCII NUL\fR character.
91 The terminal name section is followed by the Boolean section, number section,
92 string section, and string table.
95 The boolean flags section consists of one byte for each flag. This byte is
96 either \fB0\fR or \fB1\fR as the flag is present or absent. The value of
97 \fB2\fR means that the flag has been cancelled. The capabilities are in the
98 same order as the file <\fBterm.h\fR>.
101 Between the boolean flags section and the number section, a null byte is
102 inserted, if necessary, to ensure that the number section begins on an even
103 byte offset. All short integers are aligned on a short word boundary.
106 The numbers section is similar to the boolean flags section. Each capability
107 takes up two bytes, and is stored as a short integer. If the value represented
108 is \fB\(mi1\fR or \fB\(mi2\fR, the capability is taken to be missing.
111 The strings section is also similar. Each capability is stored as a short
112 integer, in the format above. A value of \fB\(mi1\fR or \fB\(mi2\fR means the
113 capability is missing. Otherwise, the value is taken as an offset from the
114 beginning of the string table. Special characters in ^X or \ec notation are
115 stored in their interpreted form, not the printing representation. Padding
116 information ($<nn>) and parameter information (%x) are stored intact in
120 The final section is the string table. It contains all the values of string
121 capabilities referenced in the string section. Each string is null terminated.
124 Note that it is possible for \fBsetupterm\fR to expect a different set of
125 capabilities than are actually present in the file. Either the database may
126 have been updated since \fBsetupterm\fR has been recompiled (resulting in extra
127 unrecognized entries in the file) or the program may have been recompiled more
128 recently than the database was updated (resulting in missing entries). The
129 routine \fBsetupterm\fR must be prepared for both possibilities\(emthis is why
130 the numbers and sizes are included. Also, new capabilities must always be added
131 at the end of the lists of boolean, number, and string capabilities.
134 As an example, here is terminal information on the AT&T Model 37 KSR terminal
135 as output by the \fBinfocmp \fR\fB-I\fR\fB tty37\fR command:
139 37|tty37|AT&T model 37 teletype,
141 bel=^G, cr=\er, cub1=\eb, cud1=\en, cuu1=\eE7, hd=\eE9,
149 The following is an octal dump of the corresponding \fBterm\fR file, produced
150 by the \fBod -c /usr/share/lib/terminfo/t/tty37\fR command:
154 0000000 032 001 \e0 032 \e0 013 \e0 021 001 3 \e0 3 7 | t
155 0000020 t y 3 7 | A T & T m o d e l
156 0000040 3 7 t e l e t y p e \e0 \e0 \e0 \e0 \e0
157 0000060 \e0 \e0 \e0 001 \e0 \e0 \e0 \e0 \e0 \e0 \e0 001 \e0 \e0 \e0 \e0
158 0000100 001 \e0 \e0 \e0 \e0 \e0 377 377 377 377 377 377 377 377 377 377
159 0000120 377 377 377 377 377 377 377 377 377 377 377 377 377 377 & \e0
160 0000140 \e0 377 377 377 377 377 377 377 377 377 377 377 377 377 377
161 0000160 377 377 " \e0 377 377 377 377 ( \e0 377 377 377 377 377 377
162 0000200 377 377 0 \e0 377 377 377 377 377 377 377 377 - \e0 377 377
163 0000220 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
165 0000520 377 377 377 377 377 377 377 377 377 377 377 377 377 377 $ \e0
166 0000540 377 377 377 377 377 377 377 377 377 377 377 377 377 377 * \e0
167 0000560 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
169 0001160 377 377 377 377 377 377 377 377 377 377 377 377 377 377 3 7
170 0001200 | t t y 3 7 | A T & T m o d e
171 0001220 l 3 7 t e l e t y p e \e0 \er \e0
172 0001240 \en \e0 \en \e0 007 \e0 \eb \e0 033 8 \e0 033 9 \e0 033 7
181 Some limitations: total compiled entries cannot exceed 4096 bytes; all entries
182 in the name field cannot exceed 128 bytes.
187 \fB\fB/usr/share/lib/terminfo/?/*\fR\fR
191 compiled terminal description database
197 \fB\fB/usr/include/term.h\fR\fR
201 \fBterminfo\fR header
207 \fB\fB/usr/xpg4/include/term.h\fR\fR
211 X/Open Curses \fBterminfo\fR header
217 \fBinfocmp\fR(1M), \fBcurses\fR(3CURSES), \fBcurses\fR(3XCURSES),
218 \fBterminfo\fR(4), \fBterm\fR(5)