Go to the first, previous, next, last section, table of contents.

Filling In Parameters

Some terminal control strings require numeric parameters. For example, when you move the cursor, you need to say what horizontal and vertical positions to move it to. The value of the terminal's `cm' capability, which says how to move the cursor, cannot simply be a string of characters; it must say how to express the cursor position numbers and where to put them within the command.

The specifications of termcap include conventions as to which string-valued capabilities require parameters, how many parameters, and what the parameters mean; for example, it defines the `cm' string to take two parameters, the vertical and horizontal positions, with 0,0 being the upper left corner. These conventions are described where the individual commands are documented.

Termcap also defines a language used within the capability definition for specifying how and where to encode the parameters for output. This language uses character sequences starting with `%'. (This is the same idea as printf, but the details are different.) The language for parameter encoding is described in this section.

A program that is doing display output calls the functions tparam or tgoto to encode parameters according to the specifications. These functions produce a string containing the actual commands to be output (as well a padding spec which must be processed with tputs; see section Padding).

Go to the first, previous, next, last section, table of contents.