1
1
.\"***************************************************************************
2
.\" Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
2
.\" Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
4
4
.\" Permission is hereby granted, free of charge, to any person obtaining a *
5
5
.\" copy of this software and associated documentation files (the *
39
39
Compiled terminfo descriptions are placed under the directory \fB\*d\fP.
40
In order to avoid a linear search of a huge \s-1UNIX\s+1 system directory, a
41
two-level scheme is used: \fB\*d/c/name\fP
40
Two configurations are supported (when building the ncurses libraries):
43
A two-level scheme is used to avoid a linear search
44
of a huge \s-1UNIX\s+1 system directory: \fB\*d/c/name\fP where
44
46
is the name of the terminal, and
50
52
can be found in the file \fB\*d/a/act4\fP.
51
53
Synonyms for the same terminal are implemented by multiple
52
54
links to the same compiled file.
57
Using Berkeley database, two types of records are stored:
58
the terminfo data in the same format as stored in a directory tree with
59
the terminfo's primary name as a key,
60
and records containing only aliases pointing to the primary name.
62
If built to write hashed databases,
63
ncurses can still read terminfo databases organized as a directory tree,
64
but cannot write entries into the directory tree.
65
It can write (or rewrite) entries in the hashed database.
67
ncurses distinguishes the two cases in the TERMINFO and TERMINFO_DIRS
68
environment variable by assuming a directory tree for entries that
69
correspond to an existing directory,
70
and hashed database otherwise.
54
72
The format has been chosen so that it will be the same on all hardware.
55
73
An 8 or more bit byte is assumed, but no assumptions about byte ordering
56
74
or sign extension are made.
58
76
The compiled file is created with the
60
78
program, and read by the routine
62
80
The file is divided into six parts:
72
90
This section contains six short integers in the format
75
95
(1) the magic number (octal 0432);
76
97
(2) the size, in bytes, of the names section;
77
99
(3) the number of bytes in the boolean section;
78
101
(4) the number of short integers in the numbers section;
79
103
(5) the number of offsets (short integers) in the strings section;
80
105
(6) the size, in bytes, of the string table.
82
108
Short integers are stored in two 8-bit bytes.
83
109
The first byte contains the least significant 8 bits of the value,
128
154
It contains all the values of string capabilities referenced in
129
155
the string section.
130
156
Each string is null terminated.
157
.SS EXTENDED STORAGE FORMAT
158
The previous section describes the conventional terminfo binary format.
159
With some minor variations of the offsets (see PORTABILITY),
160
the same binary format is used in all modern UNIX systems.
161
Each system uses a predefined set of boolean, number or string capabilities.
163
The ncurses libraries and applications support extended terminfo binary format,
164
allowing users to define capabilities which are loaded at runtime. This
165
extension is made possible by using the fact that the other implementations
166
stop reading the terminfo data when they have reached the end of the size given
168
ncurses checks the size, and if it exceeds that due to the predefined data,
169
continues to parse according to its own scheme.
171
First, it reads the extended header (5 short integers):
175
count of extended boolean capabilities
178
count of extended numeric capabilities
181
count of extended string capabilities
184
size of the extended string table in bytes.
187
last offset of the extended string table in bytes.
190
Using the counts and sizes, ncurses allocates arrays and reads data
191
for the extended capabilties in the same order as the header information.
193
The extended string table contains values for string capabilities.
194
After the end of these values, it contains the names for each of
195
the extended capabilities in order, e.g., booleans, then numbers and
132
199
Note that it is possible for
134
201
to expect a different set of capabilities
155
222
capabilities to the string table that (in the binary format) collide with
156
223
System V and XSI Curses extensions. See \fBterminfo\fR(\*n) for detailed
157
224
discussion of terminfo source compatibility issues.
159
226
As an example, here is a hex dump of the description for the Lear-Siegler
160
227
ADM-3, a popular though rather stupid early terminal:
197
264
Some limitations: total compiled entries cannot exceed 4096 bytes.
198
265
The name field cannot exceed 128 bytes.
200
267
\*d/*/* compiled terminal capability data base
202
269
\fBcurses\fR(3X), \fBterminfo\fR(\*n).
273
extended terminfo format for ncurses 5.0
275
hashed database support for ncurses 5.6
204
279
.\"# The following sets edit modes for GNU EMACS
205
280
.\"# Local Variables: