HPlogo MPE/iX Developer's Kit Reference Manual Volume 2: HP 3000 MPE/iX Computer Systems > Chapter 3 TERMINFO Database

TERMINFO Compiled File

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The TERM file is the compiled terminfo source file.

Description

The TERM file is compiled from terminfo source files using the tic utility. Compiled files are organized in a directory hierarchy under the first letter of each terminal name. For example, the vt100 file would have the following pathname.

     /usr/lib/terminfo/v/vt100

The compiled files are read by the CURSES routine setupterm().

The following illustration shows the content and order of the compiled file:

<magic number><name section size><Boolean section

size><number section size>



<string section size><string table size><name 

section><Boolean section>[0]



<number section><string section><string table>

The first six items in the file make up the header.

The header consists of six short integers, stored using VAX/PDP style byte swapping (least-significant byte first). The integers are as follows:

  1. 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

Following the header is the terminal name section that consists of the first line of the terminfo definition terminated with an ASCII NUL character.

The terminal name section is followed by the Boolean section, number section, string section, and string table.

The Boolean section consists of a byte for each flag, showing whether the flag is absent, present, or cancelled (a value of 0, 1, or 2 respectively). If necessary, a null byte is inserted between the Boolean and number sections so that the number section begins on an even byte boundary. All short integers are aligned on a short word boundary.

Each capability in the number section is made up of two bytes and stored as a short integer. A value of -1 or -2 indicates a missing or cancelled capability. Similarly, each capability in the string section is made up of two bytes and stored as a short integer. The value is an offset from the string table. A value of -1 or -2 indicates a missing or cancelled capability. Parameter and padding information is stored in its uninterpreted form. Control or other characters using special notation (^x, \c) are stored in their interpreted form.

The final section of the file is the string table that contains the values of each string in the string section, followed by a null character.

NOTE: The setupterm() routine may expect a different set of capabilities than appears in the file. Unexpected or missing entries may result when the database has been updated since the CURSES library was last compiled, or when the program is recompiled more recently than the database.

The first of the following two examples shows a terminfo file for a dumb terminal; the second example shows an octal dump of the TERM file.

000000  032 001 005  \0   %  \0.036  \0   c 001  \r  \0   d   u   m   b

000020   \0  \0 001  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0

000040   \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0   e  \0  \0

000060   \0  \0  \0  \0  \0  \0   P  \0 377 377 377 377 377 377 377 377

000100  377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377

*

000160  377 377 377 377 005  \0  \a  \0 377 377 377 377 377 377 377 377

000200  377 377 377 377 377 377 377 377  \t  \0 377 377 377 377 377 377

000220  377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377

*

000560  377 377 377 377  \v  \0 377 377 377 377 377 377 377 377 377 377

000600  377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377

*

001460  377 377 377 377 377 377 377 377   d   u   m    b \0  \a  \0  \r

001500   \0  \n  \0  \n  \0

001505

Related Information

tic utility, untic utility

MPE/iX Reference Supplement (32650-90353)

Implementation Considerations

Identical to UNIX System V

Portability

UNIX System V

Feedback to webmaster