- Note that it is possible for <STRONG>setupterm</STRONG> to expect a different set of
- capabilities than are actually present in the file. Either the data-
- base may have been updated since <STRONG>setupterm</STRONG> has been recompiled (result-
- ing 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 <STRONG>setupterm</STRONG> must be prepared for both
- possibilities - this is why the numbers and sizes are included. Also,
- new capabilities must always be added at the end of the lists of bool-
- ean, number, and string capabilities.
-
- Despite the consistent use of little-endian for numbers and the other-
- wise self-describing format, it is not wise to count on portability of
- binary terminfo entries between commercial UNIX versions. The problem
- is that there are at least three versions of terminfo (under HP-UX,
- AIX, and OSF/1) which diverged from System V terminfo after SVr1, and
- have added extension capabilities to the string table that (in the
- binary format) collide with System V and XSI Curses extensions. See
- <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for detailed discussion of terminfo source compatibility
- issues.
-
-
-</PRE><H2><a name="h2-EXAMPLE">EXAMPLE</a></H2><PRE>
- As an example, here is a hex dump of the description for the Lear-
- Siegler ADM-3, a popular though rather stupid early terminal:
+
+</PRE><H3><a name="h3-setupterm">setupterm</a></H3><PRE>
+ Note that it is possible for <STRONG>setupterm</STRONG> to expect a different set of
+ capabilities than are actually present in the file. Either the
+ database may have been updated since <STRONG>setupterm</STRONG> was 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 <STRONG>setupterm</STRONG> must be prepared
+ for both possibilities - this 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.
+
+
+</PRE><H3><a name="h3-Binary-Format">Binary Format</a></H3><PRE>
+ X/Open Curses does not specify a format for the terminfo database.
+ System V curses used a directory-tree of binary files, one per terminal
+ description.
+
+ Despite the consistent use of little-endian for numbers and the
+ otherwise self-describing format, it is not wise to count on
+ portability of binary terminfo entries between commercial Unix
+ versions. The problem is that there are at least three versions of
+ terminfo (under HP-UX, AIX, and OSF/1) which diverged from System V
+ terminfo after SVr1, and have added extension capabilities to the
+ string table that (in the binary format) collide with System V and
+ X/Open Curses extensions. See <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for detailed discussion of
+ terminfo source compatibility issues.
+
+ This implementation is by default compatible with the binary terminfo
+ format used by Solaris curses, except in a few less-used details where
+ it was found that the latter did not match X/Open Curses. The format
+ used by the other Unix versions can be matched by building <EM>ncurses</EM> with
+ different configuration options.
+
+
+</PRE><H3><a name="h3-Magic-Codes">Magic Codes</a></H3><PRE>
+ The magic number in a binary terminfo file is the first 16-bits (two
+ bytes). Besides making it more reliable for the library to check that
+ a file is terminfo, utilities such as <STRONG>file(1)</STRONG> also use that to tell
+ what the file-format is. System V defined more than one magic number,
+ with 0433, 0435 as screen-dumps (see <STRONG><A HREF="scr_dump.5.html">scr_dump(5)</A></STRONG>). This implementation
+ uses 01036 as a continuation of that sequence, but with a different
+ high-order byte to avoid confusion.
+
+ <STRONG>The</STRONG> <EM>TERMTYPE</EM> <STRONG>Structure</STRONG>
+ Direct access to the <STRONG>TERMTYPE</STRONG> structure is provided for legacy
+ applications. Portable applications should use the <STRONG>tigetflag</STRONG> and
+ related functions described in <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> for reading terminal
+ capabilities.
+
+
+</PRE><H3><a name="h3-Mixed-case-Terminal-Names">Mixed-case Terminal Names</a></H3><PRE>
+ A small number of terminal descriptions use uppercase characters in
+ their names. If the underlying filesystem ignores the difference
+ between uppercase and lowercase, <EM>ncurses</EM> represents the "first
+ character" of the terminal name used as the intermediate level of a
+ directory tree in (two-character) hexadecimal form.
+
+
+</PRE><H3><a name="h3-Limits">Limits</a></H3><PRE>
+ <EM>ncurses</EM> stores compiled terminal descriptions in three related formats,
+ described in the sections
+
+ <STRONG>o</STRONG> <STRONG>LEGACY</STRONG> <STRONG>STORAGE</STRONG> <STRONG>FORMAT</STRONG>, and
+
+ <STRONG>o</STRONG> <STRONG>EXTENDED</STRONG> <STRONG>STORAGE</STRONG> <STRONG>FORMAT</STRONG>, and
+
+ <STRONG>o</STRONG> <STRONG>EXTENDED</STRONG> <STRONG>NUMBER</STRONG> <STRONG>FORMAT</STRONG>.
+
+ The legacy storage format and the extended number format differ by the
+ types of numeric capability which they can store (i.e., 16-bit versus
+ 32-bit integers). The extended storage format introduced by <EM>ncurses</EM>
+ 5.0 adds data to either of these formats.
+
+ Some limitations apply:
+
+ <STRONG>o</STRONG> total compiled entries cannot exceed 4096 bytes in the legacy
+ format.
+
+ <STRONG>o</STRONG> total compiled entries cannot exceed 32768 bytes in the extended
+ format.
+
+ <STRONG>o</STRONG> the name field cannot exceed 128 bytes.
+
+ Compiled entries are limited to 32768 bytes because offsets into the
+ <EM>strings</EM> <EM>table</EM> use two-byte integers. The legacy format could have
+ supported 32768-byte entries, but was limited to a virtual memory
+ page's 4096 bytes.
+
+
+</PRE><H2><a name="h2-EXAMPLES">EXAMPLES</a></H2><PRE>
+ As an example, here is a description for the Lear-Siegler ADM-3, a
+ popular though rather stupid early terminal: