HP 3000 Manuals

TERMINFO Source File [ MPE/iX Developer's Kit Reference Manual Volume II ] MPE/iX 5.0 Documentation


MPE/iX Developer's Kit Reference Manual Volume II

TERMINFO Source File 

One or more devices are described in a TERMINFO source file.  This
section describes the contents of the source file.

Syntax of Device Descriptions 

Each device entry in the TERMINFO source file has the following format:

      alias1 | alias2 | ... | aliasn | fullname,
           capability1, capability2,
           .
           .
           .
           capabilityn,

The first line in the device description is called the header; it must
start in column one of the file.  The header contains the commonly-used
aliases for the device being described and the full name, which by
convention appears last on the line.  The environmental variable TERM can
be set to any one of the terminal aliases.  Each name is separated by a
vertical bar, (|).  The aliases must be unique in the database.  They
must follow normal MPE/iX HFS naming conventions (avoid a hyphen in the
alias name as it is used to append a suffix as described below).  All
lines in the file must end with a comma (,).

A sample header of the model 33 teletype follows:

     33|tty33|tty|model 33 teletype

A special convention exists for naming terminals that have special
hardware modes or user preferences (for example, a VT-100 with 132
columns).  Attach a suffix to the alias name with a hyphen, as shown in
the following example.

     vt100-w|vt100 132 column,

More than one suffix can be used by concatenating them together.  When
using multiple suffixes, repeat the alias with the suffixes in the
opposite order so the user does not have to remember which is the correct
order.  The following example shows a terminal in wide mode with no
automatic margins:

     vt100-w-nam|vt100-nam-w|vt100 132 column,

The suffix conventions used are shown in Table 3-1 .

          Table 3-1.  Suffixes for Mode and User Preferences 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                   Suffix                    |                   Meaning                   |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -am                                         | Auto margins (usually the default)          |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -na                                         | No arrow keys (leave in local mode)         |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -nam                                        | No auto margins                             |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -w                                          | Wide mode (more than 80 columns)            |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -rv                                         | Reverse video                               |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -n                                          | Number of lines on the screen               |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -np                                         | Number of pages of memory                   |
|                                             |                                             |
---------------------------------------------------------------------------------------------

After the header come the descriptions of the capabilities, separated by
commas (white space after the comma is ignored).  Each line after the
header is indented one or more spaces or tabs.  An example that shows the
syntax of the capabilities segment of the file follows:

     dumb|Dumb terminal,
     am, xon,
     cols#80, it#8,
     bel=^G, cr=\r, cudl=\n, ind=\n$<15>,

There are three types of capabilities:  Boolean, numeric, and string.
The first line in the example shows Boolean capabilities; the second line
shows numeric capabilities; and the third shows string capabilities.

The Boolean capabilities indicate the presence or absence of a
capability.  They take no arguments.  The terminal in the example has
automatic margins (am) and uses the XON/XOFF handshaking protocols (xon).

The numeric capabilities show size, spacing, or some other measurement.
The capability is followed immediately by a pound sign (#) character and
a positive integer.  The terminal in the example has a screen with 80
columns (cols#80) and tab stops initially set to every 8 characters
(it#8).

The string capabilities describe a terminal operation.  The capability is
followed immediately by an equals sign (=), and the string that performs
the operation.  The terminal in the previous example beeps the terminal
when sent a ^G sequence, performs a carriage return when sent a return
character, moves the cursor down a line when sent a newline character,
and scrolls forward from the bottom line of the screen when sent a
newline character.  (Control characters are entered in the device
description as a caret (^), followed by a letter, as opposed to entered
as the actual control character.)

Padding 

Padding is used to delay further output to terminals that need extra time
to process the current command.  Some terminals use the XON/XOFF protocol
instead of padding to tell the sending computer not to send the next
command until the terminal is ready to receive it.  Padding can still be
used with the XON/OFF protocol so that programs can calculate the speed
of functions.  Padding can be specified for all string capabilities with
the exception of input capabilities (names preceded with key_).

Padding is specified by a dollar sign ($) followed by a number enclosed
within angle brackets (for example, $<15>).  A forward slash (/) after
the number specifies that padding is mandatory; that is, it should be
applied regardless of the XON/XOFF setting.  An asterisk (*) after the
number specifies proportional padding; that is, it is applied to each
line affected.

The syntax of padding specifications is summarized in Table 3-2 . 

          Table 3-2.  Syntax of Padding Specifications 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|               Padding Syntax                |                   Meaning                   |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| $<|n                                        | Indicates a delay in n milliseconds         |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| $<|n/                                       | Indicates the delay is mandatory            |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| $<|n*                                       | Indicates the padding to be applied for     |
|                                             | each line affected                          |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| $<|n/*                                      | Indicates the mandatory padding to be       |
|                                             | applied for each line affected              |
|                                             |                                             |
---------------------------------------------------------------------------------------------


NOTE The tputs() routine performs the necessary padding for output.
Parameterized Strings Strings that require run-time parameters are described using printf-like escapes (%x). Calculations are done on a stack using Reverse Polish Notation. Parameters are pushed onto the stack, manipulated in some way, and a result is output. The left-most operators are pushed first; for example, to subtract 10 from the first parameter, you would use: %p1%{10}%-. A complex example that describes cursor movement for the Wyse-50 follows: cup=\E=%p1%'\s'%+%c%p2%'\s'%+%c, This parameterized string is described in Table 3-3 . Table 3-3. Explanation of Parameter Description --------------------------------------------------------------------------------------------- | | | | Expression | Meaning | | | | --------------------------------------------------------------------------------------------- | | | | \E= | Send cursor addressing command ^[= | | | | --------------------------------------------------------------------------------------------- | | | | %p1 | Push the first parameter onto stack | | | | --------------------------------------------------------------------------------------------- | | | | %'\s' | Push a space onto stack | | | | --------------------------------------------------------------------------------------------- | | | | %+ | Pop the first two values on stack, add | | | them, and push sum back on stack | | | | --------------------------------------------------------------------------------------------- | | | | %c | Pop the value on top of stack as an ASCII | | | character; send to terminal | | | | --------------------------------------------------------------------------------------------- | | | | %p2 | Push the second parameter onto stack | | | | --------------------------------------------------------------------------------------------- | | | | %'\s' | Push a space onto stack | | | | --------------------------------------------------------------------------------------------- | | | | %+ | Pop the first two values on stack, add | | | them, and push sum back on stack | | | | --------------------------------------------------------------------------------------------- | | | | %c | Pop the value on top of stack as ASCII | | | character; send to terminal | | | | --------------------------------------------------------------------------------------------- Stack Operators The stack operators are defined as follows: %% Outputs the % character. %char Pop and print character on top of stack. %[ [:]flags] Pop the topmost value and output as [field_width[.precision] ] specified by the printf-like format. [doxXs] Flags are [- + #] and space.
NOTE When using the- flag with %[doxXs], a colon (:), must be put between the % and- to distinguish the flag from the binary %- operator, for example, %:-16.16s.
%pn Push nth parameter onto stack where n is a number from 1 to 9. %`c' Push character constant c onto stack. %{nn} Push decimal constant nn onto the stack. %l Pop a pointer to a string and push the length of the string onto the stack. %+ %- %* %/ %m Pop the top two values; add (int2 + int1), subtract (int2 - int1), multiply (int2 * int1), divide (int2 / int1), or modulo (int2 mod int1), and push the result. %& %| %^ Pop the top two values, perform bitwise AND (int2 & int1), bitwise OR (int2 | int1), or bitwise XOR (int2 ^ int1) %= %> < %A %O Pop the top two values, push TRUE or FALSE depending on whether operators are equal, second is greater than first, second is less than first, both are true, either are true, respectively. %! Pop the top value and push its logical NOT. %~ Pop the top value and push its bitwise NOT. %i For ANSI terminals, increment first parameter by one, if one parameter present, or increment first two parameters by one, if more than one parameter present. %? expr %t Execute thenpart if expr is TRUE; otherwise execute thenpart %e elsepart (elsepart is optional). Else-if's are elsepart %; possible: %? c1 %t b1 %e c2 %t b2 %e c3 %t b3, %e c4 %t b4 %e b5 %; where ci are conditions and bi are bodies. The following example describes more complex cursor movements using some of the stack operators described previously. For example, the hp2392a terminal needs to be sent the column before the row for cursor addressing. See Table 3-4 following the example for a complete explanation. cup=\E&a%p2%dc%p1%dY, Table 3-4. hp2392a Terminal Cursor Movement --------------------------------------------------------------------------------------------- | | | | Expression | Meaning | | | | --------------------------------------------------------------------------------------------- | | | | \E&a | Send ^[&a | | | | --------------------------------------------------------------------------------------------- | | | | %p2\ | Push the second parameter onto the stack | | | | --------------------------------------------------------------------------------------------- | | | | %d | Print top of stack as decimal number | | | | --------------------------------------------------------------------------------------------- | | | | c | Send character c | | | | --------------------------------------------------------------------------------------------- | | | | %p1 | Push the first parameter onto the stack | | | | --------------------------------------------------------------------------------------------- | | | | %d | Print top of stack as decimal number | | | | --------------------------------------------------------------------------------------------- | | | | Y | Send character Y | | | | --------------------------------------------------------------------------------------------- The following is an example of a cursor movement string for the ANSI terminal. The explanation of each argument is shown in Table 3-5 . cup=\E[%i%p1%d;%p2%dH, Table 3-5. ANSI Terminal Cursor Movement --------------------------------------------------------------------------------------------- | | | | Expression | Meaning | | | | --------------------------------------------------------------------------------------------- | | | | \E[ | Send ^[[ | | | | --------------------------------------------------------------------------------------------- | | | | %i | Increment the first and second parameter by | | | one | | | | --------------------------------------------------------------------------------------------- | | | | %p1 | Push the first parameter onto the stack | | | | --------------------------------------------------------------------------------------------- | | | | %d | Print top of stack as a decimal number | | | | --------------------------------------------------------------------------------------------- | | | | ; | Send character ; | | | | --------------------------------------------------------------------------------------------- | | | | %p2 | Push the second parameter onto the stack | | | | --------------------------------------------------------------------------------------------- | | | | %d | Print top of stack as decimal number | | | | --------------------------------------------------------------------------------------------- | | | | H | Send character H | | | | ---------------------------------------------------------------------------------------------


MPE/iX 5.0 Documentation