- (1) the magic number (octal 0432);
-
- (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.
-
- 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*sec-
- ond+first.) The value -1 is represented by the two bytes 0377, 0377;
- other negative values are illegal. This value generally means that the
- corresponding capability is missing from this terminal. Note that this
- format corresponds to the hardware of the VAX and PDP-11 (that is, lit-
- tle-endian machines). Machines where this does not correspond to the
- hardware must read the integers as two bytes and compute the little-
- endian value.
-
- The terminal names section comes next. It contains the first line of
- the terminfo description, listing the various names for the terminal,
- separated by the "|" character. The section is terminated with an
- ASCII NUL character.
-
- The boolean flags have one byte for each flag. This byte is either 0
- or 1 as the flag is present or absent. The capabilities are in the
- same order as the file <term.h>.
-
- Between the boolean section and the number section, a null byte will be
- inserted, if necessary, to ensure that the number section begins on an
- even byte (this is a relic of the PDP-11's word-addressed architecture,
- originally designed in to avoid IOT traps induced by addressing a word
- on an odd byte boundary). All short integers are aligned on a short
- word boundary.
-
- The numbers section is similar to the flags section. Each capability
- takes up two bytes, and is stored as a little-endian short integer. If
- the value represented is -1, the capability is taken to be missing.
-
- The strings section is also similar. Each capability is stored as a
- short integer, in the format above. A value of -1 means the capability
- is missing. Otherwise, the value is taken as an offset from the begin-
- ning of the string table. Special characters in ^X or \c notation are
- stored in their interpreted form, not the printing representation.
- Padding information $<nn> and parameter information %x are stored
- intact in uninterpreted form.
-
- 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.
-
-
-</PRE><H3><a name="h3-EXTENDED-STORAGE-FORMAT">EXTENDED STORAGE FORMAT</a></H3><PRE>
- The previous section describes the conventional terminfo binary format.
- With some minor variations of the offsets (see PORTABILITY), the same
- binary format is used in all modern UNIX systems. Each system uses a
- predefined set of boolean, number or string capabilities.
-
- The <STRONG>ncurses</STRONG> libraries and applications support extended terminfo binary
- format, allowing users to define capabilities which are loaded at run-
- time. This extension is made possible by using the fact that the other
- implementations stop reading the terminfo data when they have reached
- the end of the size given in the header. <STRONG>ncurses</STRONG> checks the size, and
- if it exceeds that due to the predefined data, continues to parse
+ (1) the <EM>magic</EM> <EM>number</EM>
+ (octal 0432);
+
+ (2) the size,
+ in bytes, of the <EM>terminal</EM> <EM>names</EM> section;
+
+ (3) the number of bytes in the <EM>Boolean</EM> <EM>flags</EM> section;
+
+ (4) the number of short integers in the <EM>numbers</EM> section;
+
+ (5) the number of offsets
+ (short integers) in the <EM>strings</EM> section;
+
+ (6) the size,
+ in bytes, of the <EM>string</EM> <EM>table</EM>.
+
+ The capabilities in the <EM>Boolean</EM> <EM>flags</EM>, <EM>numbers</EM>, and <EM>strings</EM> sections
+ are in the same order as in the header file <EM>term.h</EM>.
+
+ Short integers are signed, in the range -32768 to 32767, and stored in
+ little-endian format.
+
+ Numbers in a terminal description, whether they are entries in the
+ <EM>numbers</EM> or <EM>strings</EM> table, are positive integers. Boolean flags are
+ treated as positive one-byte integers. In each case, those positive
+ integers represent a terminal capability. The terminal compiler <EM>tic</EM>
+ uses negative integers to handle the cases where a capability is not
+ available:
+
+ <STRONG>o</STRONG> If a capability is absent from this terminal, <EM>tic</EM> stores a -1 in
+ the corresponding table.
+
+ The integer value -1 is represented by two bytes 0377, 0377.
+ Absent Boolean values are represented by the byte 0 (false).
+
+ <STRONG>o</STRONG> If a capability has been canceled from this terminal, <EM>tic</EM> stores a
+ -2 in the corresponding table.
+
+ The integer value -2 is represented by two bytes 0377, 0376.
+ The Boolean value -2 is represented by the byte 0376.
+
+ <STRONG>o</STRONG> Other negative values are illegal.
+
+ The <EM>terminal</EM> <EM>names</EM> section comes after the <EM>header</EM>. It contains the
+ first line of the <EM>terminfo</EM> description, listing the various names for
+ the terminal, separated by the "|" character. The <EM>terminal</EM> <EM>names</EM>
+ section is terminated with an ASCII NUL character.
+
+ The <EM>Boolean</EM> <EM>flags</EM> section has one byte for each flag. Boolean
+ capabilities are either 1 or 0 (true or false) according to whether the
+ terminal supports the given capability or not.
+
+ Between the <EM>Boolean</EM> <EM>flags</EM> section and the <EM>number</EM> section, a null byte
+ will be inserted, if necessary, to ensure that the <EM>number</EM> section
+ begins on an even byte This is a relic of the PDP-11's word-addressed
+ architecture, originally designed to avoid traps induced by addressing
+ a word on an odd byte boundary. All short integers are aligned on a
+ short word boundary.
+
+ The <EM>numbers</EM> section is similar to the <EM>Boolean</EM> <EM>flags</EM> section. Each
+ capability takes up two bytes, and is stored as a little-endian short
+ integer.
+
+ The <EM>strings</EM> section is also similar. Each capability is stored as a
+ short integer. The capability value is an index into the <EM>string</EM> <EM>table</EM>.
+
+ The <EM>string</EM> <EM>table</EM> is the last section. It contains all of the values of
+ string capabilities referenced in the <EM>strings</EM> section. Each string is
+ null-terminated. Special characters in ^X or \c notation are stored in
+ their interpreted form, not the printing representation. Padding
+ information <STRONG>$<</STRONG><EM>nn</EM><STRONG>></STRONG> and parameter information <STRONG>%x</STRONG> are stored intact in
+ uninterpreted form.
+
+
+</PRE><H3><a name="h3-Extended-Storage-Format">Extended Storage Format</a></H3><PRE>
+ The previous section describes the conventional <EM>terminfo</EM> binary format.
+ With some minor variations of the offsets (see PORTABILITY), the same
+ binary format is used in all modern Unix systems. Each system uses a
+ predefined set of Boolean, number or string capabilities.
+
+ The <EM>ncurses</EM> libraries and applications support extended <EM>terminfo</EM> binary
+ format, allowing users to define capabilities that are loaded at
+ runtime. This extension is made possible by using the fact that the
+ other implementations stop reading the <EM>terminfo</EM> data when they reach
+ the end of the size given in the header. <EM>ncurses</EM> checks the size, and
+ if it exceeds that due to the predefined data, continues to parse