The attribute string retrieved by the piocmdout, piogetstr, and piogetvals subroutines can contain embedded references to other attribute strings or integers. The attribute string can also contain embedded logic that dynamically determines the content of the constructed string. This allows the constructed string to reflect the state of the formatter environment when one of these subroutines is called.
Embedded references and logic are defined with escape sequences that are placed at appropriate locations in the attribute string. The first character of each escape sequence is always the % character. This character indicates the beginning of an escape sequence. The second character (and sometimes subsequent characters) define the operation to be performed. The remainder of the characters (if any) in the escape sequence are operands to be used in performing the specified operation.
The escape sequences that can be specified in an attribute string are based on the terminfo parameterized string escape sequences for terminals. These escape sequences have been modified and extended for printers.
The attribute names that can be referenced by attribute strings are:
Any attribute value (integer variable, string variable, or string constant) can be referenced by any attribute string. Consequently, it is important that the formatter ensures that the values for all the integer variables and string variables defined to the piogetvals subroutine are kept current.
The formatter must not assume that the particular attribute string whose name it specifies to the piogetstr or piocmdout subroutine does not reference certain variables. The attribute string is retrieved from the database that is external to the formatter. The values in the database represented by the string can be changed to reference additional variables without the formatter's knowledge.