+
+</PRE><H3><a name="h3-Extended-Number-Format">Extended Number Format</a></H3><PRE>
+ On occasion, 16-bit signed integers are not large enough. <EM>ncurses</EM> 6.1
+ introduced a new format by making a few changes to the legacy format:
+
+ <STRONG>o</STRONG> a different magic number (octal 01036)
+
+ <STRONG>o</STRONG> changing the type for the <EM>number</EM> array from signed 16-bit integers
+ to signed 32-bit integers.
+
+ To maintain compatibility, the library presents the same data
+ structures to direct users of the <EM>TERMTYPE</EM> structure as in previous
+ formats. However, that cannot provide callers with the extended
+ numbers. The library uses a similar but hidden data structure
+ <EM>TERMTYPE2</EM> to provide data for the <EM>terminfo</EM> functions.
+
+
+</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
+ <EM>/usr/share/terminfo</EM>
+ compiled terminal description database
+
+
+</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
+
+</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 <EM>terminfo</EM> database.
+ System V <EM>curses</EM> used a directory-tree of binary files, one per terminal
+ description.
+
+ Despite the consistent use of little-endian numbers and the otherwise
+ self-describing format, it is not wise to count on portability of
+ binary <EM>terminfo</EM> entries between commercial Unix versions. The problem
+ is that there are at least three versions of <EM>terminfo</EM> (under HP-UX,
+ AIX, and OSF/1) each of which diverged from System V <EM>terminfo</EM> after
+ SVr1, and 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 <EM>terminfo</EM> source compatibility
+ issues.
+
+ This implementation is by default compatible with the binary <EM>terminfo</EM>
+ format used by Solaris <EM>curses</EM>, 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 <EM>terminfo</EM> file is the first 16 bits (two
+ bytes). Besides making it more reliable for the library to check that
+ a file is <EM>terminfo</EM>, 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 <EM>TERMTYPE</EM> structure is provided for legacy
+ applications. Portable applications should use <STRONG><A HREF="curs_terminfo.3x.html">tigetflag(3x)</A></STRONG> and
+ related functions to read 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 file system 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 subsections
+
+ <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 that they can store (for example, 16-
+ 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>
+ Here is a <EM>terminfo</EM> description of the Lear-Siegler ADM-3, a popular
+ though rather stupid early terminal.