Explicitly specify `all' as the default target(as it used to be), so as
[dragonfly.git] / lib / libncurses / man / term.5
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
3 .\"                                                                          *
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:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
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.                               *
22 .\"                                                                          *
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       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
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 $
31 .TH TERM 5
32 .ds n 5
33 .ds d /usr/share/terminfo
34 .SH NAME
35 term \- format of compiled term file.
36 .SH SYNOPSIS
37 .B term
38 .SH DESCRIPTION
39 .PP
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
43 where
44 .I name
45 is the name of the terminal, and
46 .I c
47 is the first character of
48 .IR name .
49 Thus,
50 .I act4
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.
54 .PP
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.
58 .PP
59 The compiled file is created with the
60 .I tic
61 program, and read by the routine
62 .IR setupterm .
63 The file is divided into six parts:
64 the header,
65 terminal names,
66 boolean flags,
67 numbers,
68 strings,
69 and
70 string table.
71 .PP
72 The header section begins the file.
73 This section contains six short integers in the format
74 described below.
75 These integers are
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.
82 .PP
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.
94 .PP
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.
100 .PP
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>.
104 .PP
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
110 odd byte boundary).
111 All short integers are aligned on a short word boundary.
112 .PP
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.
117 .PP
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
122 of the string table.
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.
127 .PP
128 The final section is the string table.
129 It contains all the values of string capabilities referenced in
130 the string section.
131 Each string is null terminated.
132 .PP
133 Note that it is possible for
134 .I setupterm
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
138 .I setupterm
139 has been recompiled
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).
144 The routine
145 .I setupterm
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.
150 .PP
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.
159 .PP
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:
162 .nf
163 .sp
164 adm3a|lsi adm3a,
165         am,
166         cols#80, lines#24,
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,
169         home=^^, ind=^J,
170 .sp
171 .ft CW
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
194 .ft R
195 .fi
196 .sp
197 .PP
198 Some limitations: total compiled entries cannot exceed 4096 bytes.
199 The name field cannot exceed 128 bytes.
200 .SH FILES
201 \*d/*/* compiled terminal capability data base
202 .SH SEE ALSO
203 \fBcurses\fR(3X), \fBterminfo\fR(\*n).
204 .\"#
205 .\"# The following sets edit modes for GNU EMACS
206 .\"# Local Variables:
207 .\"# mode:nroff
208 .\"# fill-column:79
209 .\"# End: