]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/term.5.html
ncurses 5.3
[ncurses.git] / doc / html / man / term.5.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <!-- 
3   ****************************************************************************
4   * Copyright (c) 1998,2002 Free Software Foundation, Inc.                   *
5   *                                                                          *
6   * Permission is hereby granted, free of charge, to any person obtaining a  *
7   * copy of this software and associated documentation files (the            *
8   * "Software"), to deal in the Software without restriction, including      *
9   * without limitation the rights to use, copy, modify, merge, publish,      *
10   * distribute, distribute with modifications, sublicense, and/or sell       *
11   * copies of the Software, and to permit persons to whom the Software is    *
12   * furnished to do so, subject to the following conditions:                 *
13   *                                                                          *
14   * The above copyright notice and this permission notice shall be included  *
15   * in all copies or substantial portions of the Software.                   *
16   *                                                                          *
17   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24   *                                                                          *
25   * Except as contained in this notice, the name(s) of the above copyright   *
26   * holders shall not be used in advertising or otherwise to promote the     *
27   * sale, use or other dealings in this Software without prior written       *
28   * authorization.                                                           *
29   ****************************************************************************
30   * @Id: term.5,v 1.14 2002/08/10 21:59:37 tom Exp @
31 -->
32 <HTML>
33 <HEAD>
34 <TITLE>TERM 5</TITLE>
35 <link rev=made href="mailto:bug-ncurses@gnu.org">
36 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
37 </HEAD>
38 <BODY>
39 <H1>TERM 5</H1>
40 <HR>
41 <PRE>
42 <!-- Manpage converted by man2html 3.0.1 -->
43
44 </PRE>
45 <H2>NAME</H2><PRE>
46        term - format of compiled term file.
47
48
49 </PRE>
50 <H2>SYNOPSIS</H2><PRE>
51        <STRONG>term</STRONG>
52
53
54 </PRE>
55 <H2>DESCRIPTION</H2><PRE>
56        Compiled terminfo descriptions are placed under the direc-
57        tory <STRONG>/usr/share/terminfo</STRONG>.  In  order  to  avoid  a  linear
58        search of a huge UNIX system directory, a two-level scheme
59        is used: <STRONG>/usr/share/terminfo/c/name</STRONG> where <EM>name</EM> is the name
60        of  the  terminal,  and  <EM>c</EM> is the first character of <EM>name</EM>.
61        Thus, <EM>act4</EM>  can  be  found  in  the  file  <STRONG>/usr/share/ter-</STRONG>
62        <STRONG>minfo/a/act4</STRONG>.   Synonyms  for the same terminal are imple-
63        mented by multiple links to the same compiled file.
64
65        The format has been chosen so that it will be the same  on
66        all  hardware.   An  8 or more bit byte is assumed, but no
67        assumptions about byte  ordering  or  sign  extension  are
68        made.
69
70        The  compiled  file  is  created with the <EM>tic</EM> program, and
71        read by the routine <EM>setupterm</EM>.  The file is  divided  into
72        six parts: the header, terminal names, boolean flags, num-
73        bers, strings, and string table.
74
75        The header section begins the file.  This section contains
76        six  short  integers in the format described below.  These
77        integers are (1) the magic number (octal  0432);  (2)  the
78        size,  in  bytes,  of the names section; (3) the number of
79        bytes in the boolean section;  (4)  the  number  of  short
80        integers in the numbers section; (5) the number of offsets
81        (short integers) in the strings section; (6) the size,  in
82        bytes, of the string table.
83
84        Short  integers  are stored in two 8-bit bytes.  The first
85        byte contains the least significant 8 bits of  the  value,
86        and  the second byte contains the most significant 8 bits.
87        (Thus, the value represented  is  256*second+first.)   The
88        value -1 is represented by the two bytes 0377, 0377; other
89        negative values are illegal. This  value  generally  means
90        that  the  corresponding  capability  is missing from this
91        terminal.  Note that this format corresponds to the  hard-
92        ware  of  the  VAX  and  PDP-11  (that  is,  little-endian
93        machines).  Machines where this does not correspond to the
94        hardware  must  read the integers as two bytes and compute
95        the little-endian value.
96
97        The terminal names section comes next.   It  contains  the
98        first  line of the terminfo description, listing the vari-
99        ous names for the terminal, separated by the  `|'  charac-
100        ter.   The section is terminated with an ASCII NUL charac-
101        ter.
102
103        The boolean flags have one byte for each flag.  This  byte
104        is  either  0  or 1 as the flag is present or absent.  The
105        capabilities are in the same order as the file &lt;term.h&gt;.
106
107        Between the boolean section and the number section, a null
108        byte  will  be  inserted, if necessary, to ensure that the
109        number section begins on an even byte (this is a relic  of
110        the   PDP-11's   word-addressed  architecture,  originally
111        designed in to avoid IOT traps  induced  by  addressing  a
112        word  on  an  odd  byte boundary).  All short integers are
113        aligned on a short word boundary.
114
115        The numbers section is similar to the flags section.  Each
116        capability  takes up two bytes, and is stored as a little-
117        endian short integer.  If the value represented is -1, the
118        capability is taken to be missing.
119
120        The  strings  section is also similar.  Each capability is
121        stored as a short integer, in the format above.   A  value
122        of  -1  means  the  capability is missing.  Otherwise, the
123        value is taken as an offset  from  the  beginning  of  the
124        string table.  Special characters in ^X or \c notation are
125        stored in their interpreted form, not the printing  repre-
126        sentation.  Padding information $&lt;nn&gt; and parameter infor-
127        mation %x are stored intact in uninterpreted form.
128
129        The final section is the string table.   It  contains  all
130        the values of string capabilities referenced in the string
131        section.  Each string is null terminated.
132
133        Note that it is possible for <EM>setupterm</EM> to expect a differ-
134        ent  set  of capabilities than are actually present in the
135        file.  Either the database may  have  been  updated  since
136        <EM>setupterm</EM> has been recompiled (resulting in extra unrecog-
137        nized entries in the file) or the program  may  have  been
138        recompiled  more  recently  than  the database was updated
139        (resulting in missing  entries).   The  routine  <EM>setupterm</EM>
140        must  be prepared for both possibilities - this is why the
141        numbers and sizes are included.   Also,  new  capabilities
142        must  always  be added at the end of the lists of boolean,
143        number, and string capabilities.
144
145        Despite the consistent use of  little-endian  for  numbers
146        and  the  otherwise self-describing format, it is not wise
147        to count on portability of binary terminfo entries between
148        commercial  UNIX  versions.  The problem is that there are
149        at least three versions of terminfo (under HP-UX, AIX, and
150        OSF/1)  which  diverged from System V terminfo after SVr1,
151        and have added extension capabilities to the string  table
152        that  (in the binary format) collide with System V and XSI
153        Curses extensions.  See <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for  detailed  discus-
154        sion of terminfo source compatibility issues.
155
156        As  an  example, here is a hex dump of the description for
157        the Lear-Siegler ADM-3, a  popular  though  rather  stupid
158        early terminal:
159
160        adm3a|lsi adm3a,
161                am,
162                cols#80, lines#24,
163                bel=^G, clear= 32$&lt;1&gt;, cr=^M, cub1=^H, cud1=^J,
164                cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
165                home=^^, ind=^J,
166
167        0000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
168        0010  61 7c 6c 73 69 20 61 64  6d 33 61 00 00 01 50 00  a|lsi ad m3a...P.
169        0020  ff ff 18 00 ff ff 00 00  02 00 ff ff ff ff 04 00  ........ ........
170        0030  ff ff ff ff ff ff ff ff  0a 00 25 00 27 00 ff ff  ........ ..%.'...
171        0040  29 00 ff ff ff ff 2b 00  ff ff 2d 00 ff ff ff ff  ).....+. ..-.....
172        0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
173        0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
174        0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
175        0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
176        0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
177        00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
178        00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
179        00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
180        00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
181        00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
182        00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
183        0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
184        0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
185        0120  ff ff ff ff ff ff 2f 00  07 00 0d 00 1a 24 3c 31  ....../. .....$&lt;1
186        0130  3e 00 1b 3d 25 70 31 25  7b 33 32 7d 25 2b 25 63  &gt;..=%p1% {32}%+%c
187        0140  25 70 32 25 7b 33 32 7d  25 2b 25 63 00 0a 00 1e  %p2%{32} %+%c....
188        0150  00 08 00 0c 00 0b 00 0a  00                       ........ .
189
190
191        Some  limitations:  total  compiled  entries cannot exceed
192        4096 bytes.  The name field cannot exceed 128 bytes.
193
194
195 </PRE>
196 <H2>FILES</H2><PRE>
197        /usr/share/terminfo/*/*  compiled terminal capability data
198        base
199
200
201 </PRE>
202 <H2>SEE ALSO</H2><PRE>
203        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
204
205
206
207
208
209
210
211
212
213
214
215 </PRE>
216 <HR>
217 <ADDRESS>
218 Man(1) output converted with
219 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
220 </ADDRESS>
221 </BODY>
222 </HTML>