Fix PROCDURE -> PROCEDURE.
[dragonfly.git] / contrib / ncurses-5.4 / doc / html / man / term.5.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <!-- 
3   ****************************************************************************
4   * Copyright (c) 1998-2002,2003 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.15 2003/05/10 20:33:49 jmc 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 <STRONG><A HREF="TERM.5.html">TERM(5)</A></STRONG>                                                   <STRONG><A HREF="TERM.5.html">TERM(5)</A></STRONG>
44
45
46
47
48 </PRE>
49 <H2>NAME</H2><PRE>
50        term - format of compiled term file.
51
52
53 </PRE>
54 <H2>SYNOPSIS</H2><PRE>
55        <STRONG>term</STRONG>
56
57
58 </PRE>
59 <H2>DESCRIPTION</H2><PRE>
60        Compiled terminfo descriptions are placed under the direc-
61        tory <STRONG>/usr/share/terminfo</STRONG>.  In  order  to  avoid  a  linear
62        search of a huge UNIX system directory, a two-level scheme
63        is used: <STRONG>/usr/share/terminfo/c/name</STRONG> where <EM>name</EM> is the name
64        of  the  terminal,  and  <EM>c</EM> is the first character of <EM>name</EM>.
65        Thus, <EM>act4</EM>  can  be  found  in  the  file  <STRONG>/usr/share/ter-</STRONG>
66        <STRONG>minfo/a/act4</STRONG>.   Synonyms  for the same terminal are imple-
67        mented by multiple links to the same compiled file.
68
69        The format has been chosen so that it will be the same  on
70        all  hardware.   An  8 or more bit byte is assumed, but no
71        assumptions about byte  ordering  or  sign  extension  are
72        made.
73
74        The  compiled  file  is  created with the <EM>tic</EM> program, and
75        read by the routine <EM>setupterm</EM>.  The file is  divided  into
76        six parts: the header, terminal names, boolean flags, num-
77        bers, strings, and string table.
78
79        The header section begins the file.  This section contains
80        six  short  integers in the format described below.  These
81        integers are (1) the magic number (octal  0432);  (2)  the
82        size,  in  bytes,  of the names section; (3) the number of
83        bytes in the boolean section;  (4)  the  number  of  short
84        integers in the numbers section; (5) the number of offsets
85        (short integers) in the strings section; (6) the size,  in
86        bytes, of the string table.
87
88        Short  integers  are stored in two 8-bit bytes.  The first
89        byte contains the least significant 8 bits of  the  value,
90        and  the second byte contains the most significant 8 bits.
91        (Thus, the value represented  is  256*second+first.)   The
92        value -1 is represented by the two bytes 0377, 0377; other
93        negative values are illegal. This  value  generally  means
94        that  the  corresponding  capability  is missing from this
95        terminal.  Note that this format corresponds to the  hard-
96        ware  of  the  VAX  and  PDP-11  (that  is,  little-endian
97        machines).  Machines where this does not correspond to the
98        hardware  must  read the integers as two bytes and compute
99        the little-endian value.
100
101        The terminal names section comes next.   It  contains  the
102        first  line of the terminfo description, listing the vari-
103        ous names for the terminal, separated by the  `|'  charac-
104        ter.   The section is terminated with an ASCII NUL charac-
105        ter.
106
107        The boolean flags have one byte for each flag.  This  byte
108        is  either  0  or 1 as the flag is present or absent.  The
109        capabilities are in the same order as the file &lt;term.h&gt;.
110
111        Between the boolean section and the number section, a null
112        byte  will  be  inserted, if necessary, to ensure that the
113        number section begins on an even byte (this is a relic  of
114        the   PDP-11's   word-addressed  architecture,  originally
115        designed in to avoid IOT traps  induced  by  addressing  a
116        word  on  an  odd  byte boundary).  All short integers are
117        aligned on a short word boundary.
118
119        The numbers section is similar to the flags section.  Each
120        capability  takes up two bytes, and is stored as a little-
121        endian short integer.  If the value represented is -1, the
122        capability is taken to be missing.
123
124        The  strings  section is also similar.  Each capability is
125        stored as a short integer, in the format above.   A  value
126        of  -1  means  the  capability is missing.  Otherwise, the
127        value is taken as an offset  from  the  beginning  of  the
128        string table.  Special characters in ^X or \c notation are
129        stored in their interpreted form, not the printing  repre-
130        sentation.  Padding information $&lt;nn&gt; and parameter infor-
131        mation %x are stored intact in uninterpreted form.
132
133        The final section is the string table.   It  contains  all
134        the values of string capabilities referenced in the string
135        section.  Each string is null terminated.
136
137        Note that it is possible for <EM>setupterm</EM> to expect a differ-
138        ent  set  of capabilities than are actually present in the
139        file.  Either the database may  have  been  updated  since
140        <EM>setupterm</EM> has been recompiled (resulting in extra unrecog-
141        nized entries in the file) or the program  may  have  been
142        recompiled  more  recently  than  the database was updated
143        (resulting in missing  entries).   The  routine  <EM>setupterm</EM>
144        must  be prepared for both possibilities - this is why the
145        numbers and sizes are included.   Also,  new  capabilities
146        must  always  be added at the end of the lists of boolean,
147        number, and string capabilities.
148
149        Despite the consistent use of  little-endian  for  numbers
150        and  the  otherwise self-describing format, it is not wise
151        to count on portability of binary terminfo entries between
152        commercial  UNIX  versions.  The problem is that there are
153        at least three versions of terminfo (under HP-UX, AIX, and
154        OSF/1)  which  diverged from System V terminfo after SVr1,
155        and have added extension capabilities to the string  table
156        that  (in the binary format) collide with System V and XSI
157        Curses extensions.  See <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for  detailed  discus-
158        sion of terminfo source compatibility issues.
159
160        As  an  example, here is a hex dump of the description for
161        the Lear-Siegler ADM-3, a  popular  though  rather  stupid
162        early terminal:
163
164        adm3a|lsi adm3a,
165                am,
166                cols#80, lines#24,
167                bel=^G, clear= 32$&lt;1&gt;, cr=^M, cub1=^H, cud1=^J,
168                cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
169                home=^^, ind=^J,
170
171        0000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
172        0010  61 7c 6c 73 69 20 61 64  6d 33 61 00 00 01 50 00  a|lsi ad m3a...P.
173        0020  ff ff 18 00 ff ff 00 00  02 00 ff ff ff ff 04 00  ........ ........
174        0030  ff ff ff ff ff ff ff ff  0a 00 25 00 27 00 ff ff  ........ ..%.'...
175        0040  29 00 ff ff ff ff 2b 00  ff ff 2d 00 ff ff ff ff  ).....+. ..-.....
176        0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
177        0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
178        0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
179        0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
180        0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
181        00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
182        00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
183        00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
184        00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
185        00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
186        00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
187        0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
188        0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
189        0120  ff ff ff ff ff ff 2f 00  07 00 0d 00 1a 24 3c 31  ....../. .....$&lt;1
190        0130  3e 00 1b 3d 25 70 31 25  7b 33 32 7d 25 2b 25 63  &gt;..=%p1% {32}%+%c
191        0140  25 70 32 25 7b 33 32 7d  25 2b 25 63 00 0a 00 1e  %p2%{32} %+%c....
192        0150  00 08 00 0c 00 0b 00 0a  00                       ........ .
193
194
195        Some  limitations:  total  compiled  entries cannot exceed
196        4096 bytes.  The name field cannot exceed 128 bytes.
197
198
199 </PRE>
200 <H2>FILES</H2><PRE>
201        /usr/share/terminfo/*/*  compiled terminal capability data
202        base
203
204
205 </PRE>
206 <H2>SEE ALSO</H2><PRE>
207        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
208
209
210
211                                                           <STRONG><A HREF="TERM.5.html">TERM(5)</A></STRONG>
212 </PRE>
213 <HR>
214 <ADDRESS>
215 Man(1) output converted with
216 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
217 </ADDRESS>
218 </BODY>
219 </HTML>