1
0
Files
irix-657m-src/eoe/man/man4/term.4
2022-09-29 17:59:04 +03:00

216 lines
6.8 KiB
Groff

'\"! tbl | mmdoc
'\"macro stdmacro
.if n .pH g4.term @(#)term 40.12 of 5/1/91
.\" Copyright 1991 UNIX System Laboratories, Inc.
.\" Copyright 1989, 1990 AT&T
.nr X
.if \nX=0 .ds x} term 4 "" "\&"
.if \nX=1 .ds x} term 4 ""
.if \nX=2 .ds x} term 4 "" "\&"
.if \nX=3 .ds x} term "" "" "\&"
.TH \*(x}
.SH NAME
\f4term\f1 \- format of compiled \f4term\fP file
.SH SYNOPSIS
\f4/usr/share/lib/terminfo/?/\(**\f1
.SH DESCRIPTION
.PP
Compiled \f4terminfo\fP(4) descriptions are placed under the directory
\f4/usr/share/lib/terminfo\f1.
In order to avoid a linear search of a huge \s-1UNIX\s+1 system directory, a
two-level scheme is used:
\f4/usr/share/lib/terminfo/\f2c\fP/\f2name\f1
where
.I name
is the name of the terminal, and
.I c
is the first character of
.IR name .
Thus,
\f4att4425\f1
can be found in the file \f4/usr/share/lib/terminfo/a/att4425\f1.
Synonyms for the same terminal are implemented by multiple
links to the same compiled file.
.PP
The format has been chosen so that it is the same on all hardware.
An 8-bit byte is assumed, but no assumptions about byte ordering
or sign extension are made.
Thus, these binary \f4terminfo\fP files can be
transported to other hardware with 8-bit bytes.
.PP
Short integers are stored in two 8-bit bytes.
The first byte contains the least significant 8 bits of the value,
and the second byte contains the most significant 8 bits.
(Thus, the value represented is 256\(**\f2second\fP+\f2first\fP.)
The value \f4\-1\f1 is represented by \f40377,0377\f1, and
the value \f4\-2\f1 is represented by \f40376,0377\f1; other negative
values are illegal.
The \f4\-1\f1 generally means that a capability is missing from this terminal.
The \f4\-2\f1 means that the capability
has been cancelled in the
\f4terminfo\fP
source
and also is to be considered missing.
.PP
The compiled file is created
from the source file descriptions of the
terminals (see
the
\f4\-I\f1
option of
\f4infocmp\fP)
by using the
\f4terminfo\fP
compiler,
\f4tic\fP,
and read by the routine
\f4setupterm\f1
[see
\f4curses\fP(3X).]
The file is divided into six parts in the following order:
the header,
terminal names,
boolean flags,
numbers,
strings,
and
string table.
.PP
The header section begins the file.
This section contains six short integers in the format
described below.
These integers are
(1) the magic number (octal \f40432\f1);
(2) the size, in bytes, of the names section;
(3) the number of bytes in the boolean section;
(4) the number of short integers in the numbers section;
(5) the number of offsets (short integers) in the strings section;
(6) the size, in bytes, of the string table.
.PP
The terminal names section comes next.
It contains the first line of the
\f4terminfo\fP
description,
listing the various names for the terminal,
separated by the bar ( | ) character (see
\f4term\fP(5)).
The section is terminated with an
.SM "ASCII NUL"
character.
.PP
The boolean flags have one byte for each flag.
This byte is either
\f40\f1
or
\f41\f1
as the flag is present or absent.
The value of \f42\f1 means that the flag has been cancelled.
The capabilities are in the same order as the file
\f1<\f4term.h\f1>.
.PP
Between the boolean section and the number section,
a null byte is inserted, if necessary,
to ensure that the number section begins on an even byte offset.
All short integers are aligned on a short word boundary.
.PP
The numbers section is similar to the boolean flags section.
Each capability takes up two bytes,
and is stored as a short integer.
If the value represented is \f4\-1\f1 or \f4\-2\f1,
the capability is taken to be missing.
.PP
The strings section is also similar.
Each capability is stored as a short integer, in the format above.
A value of \f4\-1\f1 or \f4\-2\f1 means the capability is missing.
Otherwise, the value is taken as an offset from the beginning
of the string table.
Special characters in ^\s-1X\s0 or \ec notation are stored in their
interpreted form, not the printing representation.
Padding information ($<nn>) and parameter information (%x) are
stored intact in uninterpreted form.
.PP
The final section is the string table.
It contains all the values of string capabilities referenced in
the string section.
Each string is null terminated.
.PP
Note that it is possible for
\f4setupterm\f1
to expect a different set of capabilities
than are actually present in the file.
Either the database may have been updated since
\f4setupterm\f1
has been recompiled
(resulting in extra unrecognized entries in the file)
or the program may have been recompiled more recently
than the database was updated
(resulting in missing entries).
The routine
\f4setupterm\f1
must be prepared for both possibilities\(emthis is why the numbers and sizes are included.
Also, new capabilities must always be added at the end of the lists
of boolean, number, and string capabilities.
.PP
As an example, here is terminal information on the \s-1AT&T\s0 Model 37 \s-1KSR\s0
terminal as output by the \f4infocmp \-I tty37\fP command:
.PP
.RS
.ft4
.cs 4 18
.ta .25i
.nf
37|tty37|AT&T model 37 teletype,
hc, os, xon,
bel=^G, cr=\er, cub1=\eb, cud1=\en, cuu1=\eE7, hd=\eE9,
hu=\eE8, ind=\en,
.fi
.ft 1
.RE
.P
And here is an octal dump of the \f4term\fP file, produced by the
\f4od -c /usr/share/lib/terminfo/t/tty37\fP command:
.P
.ps -1
.ft 4
.nf
0000000 032 001 \e0 032 \e0 013 \e0 021 001 3 \e0 3 7 | t
0000020 t y 3 7 | A T & T m o d e l
0000040 3 7 t e l e t y p e \e0 \e0 \e0 \e0 \e0
0000060 \e0 \e0 \e0 001 \e0 \e0 \e0 \e0 \e0 \e0 \e0 001 \e0 \e0 \e0 \e0
0000100 001 \e0 \e0 \e0 \e0 \e0 377 377 377 377 377 377 377 377 377 377
0000120 377 377 377 377 377 377 377 377 377 377 377 377 377 377 & \e0
0000140 \e0 377 377 377 377 377 377 377 377 377 377 377 377 377 377
0000160 377 377 " \e0 377 377 377 377 ( \e0 377 377 377 377 377 377
0000200 377 377 0 \e0 377 377 377 377 377 377 377 377 - \e0 377 377
0000220 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
*
0000520 377 377 377 377 377 377 377 377 377 377 377 377 377 377 $ \e0
0000540 377 377 377 377 377 377 377 377 377 377 377 377 377 377 * \e0
0000560 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
*
.br
.ne1i
0001160 377 377 377 377 377 377 377 377 377 377 377 377 377 377 3 7
0001200 | t t y 3 7 | A T & T m o d e
0001220 l 3 7 t e l e t y p e \e0 \er \e0
0001240 \en \e0 \en \e0 007 \e0 \eb \e0 033 8 \e0 033 9 \e0 033 7
0001260 \e0 \e0
0001261
.ft1
.fi
.ps
.PP
Some limitations: total compiled entries cannot exceed 4096 bytes;
all entries in the name field cannot exceed 128 bytes.
.SH FILES
.ta 1.5i
\f4/usr/share/lib/terminfo/?/\(**\fP - compiled terminal description database
.br
\f4/usr/include/term.h\fP - \f4terminfo\fP header file
.SH "SEE ALSO"
\f4curses\fP(3X)
.sp .2
\f4infocmp\fP(1M),
\f4terminfo\fP(4),
\f4term\fP(5)