HP-UX Reference (11i v3 07/02) - 4 File Formats (vol 8)

t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
cr and lf it may still be possible to craft a working nel out of one or both of them.
These capabilities suffice to describe hardcopy and screen terminals. Thus the AT&T 5320 hardcopy termi-
nal is described as follows:
5320|att5320|AT&T 5320 hardcopy terminal,
am, hc, os,
cols#132,
bel=ˆG, cr=\r, cub1=\b, cnd1=\n,
dch1=\E[P, dl1=\E[M,
ind=\n,
while the Lear Siegler ADM-3 is described as
adm3|lsi adm3,
am, bel=ˆG, clear=ˆZ, cols#80, cr=ˆM, cub1=ˆH,
cud1=ˆJ, ind=ˆJ, lines#24,
Parameterized Strings
Cursor addressing and other strings requiring arguments are described by a argumentized string capability
with escapes in a form (%x) comparable to printf() (see printf(1)). For example, to address the cursor,
the cup capability is given, using two arguments: the row and column to address to. (Rows and columns
are numbered from zero and refer to the physical screen visible to the user, not to any unseen memory.) If
the terminal has memory relative cursor addressing, that can be indicated by mrcup.
The argument mechanism uses a stack and special "%" codes to manipulate the stack in the manner of
Reverse Polish Notation (postfix). Typically a sequence pushes one of the arguments onto the stack and
then prints it in some format. Often more complex operations are necessary. Operations are in postfix
form with the operands in the usual order. That is, to subtract 5 from the first argument, one would use
%p1%{5}%-.
The "%" encodings have the following meanings:
%% Outputs "%".
% [[: ]flags ][width[.precision ]][doxXs ]
As in printf(); flags are [-+#] and space.
%c Print pop() gives %c.
%p[1-9] Push the ith argument.
%P[a-z] Set dynamic variable [a-z] to pop().
%g[a-z] Get dynamic variable [a-z] and push it.
%P[A-Z] Set static variable [a-z] to pop().
%g[A-Z] Get static variable [a-z] and push it.
%’c Push char constant c.
%{nn} Push decimal constant nn.
%l Push strlen(pop()).
%+ %- %* %/ %m
Arithmetic (%m is mod): push(pop integer2 op pop integer1) where integer1 represents
the top of the stack
%& %| %ˆ Bit operations: push(pop integer2 op pop integer1)
%= %> %< Logical operations: push(pop integer2 op pop integer1)
%A %O Logical operations: and, or
%! %˜ Unary operations: push(op pop())
%i (For ANSI terminals) add 1 to the first argument (if one argument present), or first
two arguments (if more than one argument present).
%? expr %t thenpart %e elsepart %;
If-then-else; %e elsepart is optional; else-if’s are possible as in Algol 68:
HP-UX 11i Version 3: February 2007 17 Hewlett-Packard Company 501