Previous Topic Next topic Print topic


Searching Portable and System Terminfo Databases

The COBOL system recognizes two types of terminfo database: the portable terminfo for COBOL and the system terminfo. When it requires details for a terminal it searches each database that is specified by the environment until it finds details for that terminal.

The COBOL system searches first for a COBOL-specific terminfo file and if that is not found it searches for a system terminfo file (see steps below). Non-COBOL utilities such as vi only search for a system terminfo file.

For a particular terminal, COBOL applications and non-COBOL applications such as vi can have different requirements for a terminfo file. Not only can different entries be required but also they can require different binary formats. COBOL might require a portable format and non-COBOL requires a system-specific format.

It is important to distinguish between general terminfo files and COBOL-specific terminfo files (examples provided with this system), to place them in separate locations and at run time to set up the environment variables COBTERMINFO (see the appendix Environment Variables) for the COBOL-specific files and TERMINFO for the system or general terminfo files as appropriate. The COBOL system then searches for a terminfo file using the following steps:

  1. If the COBTERMINFO environment variable is not set, it is considered set to $COBDIR/terminfo.
  2. If COBTERMINFO is set, it is read as a set of colon-separated paths to the terminfo database. If the required file is found on any of the paths (parsed from left to right), then it is used.
  3. If the TERMINFO environment variable is set, it is used as a path to the terminfo database. If the file is found, it is used.
  4. Use the default system terminfo database as the path to the terminfo database. If the file is found here, it is used.
  5. If the file is not found, an error is returned.
Previous Topic Next topic Print topic