Up: Matcher Configuration [Contents][Index]
The patterns
field in struct ctlseqs_matcher_options
is an array
of NUL-terminated strings which indicates the desired patterns of control
functions for the current matcher.
The following types of control functions are recognizable by the matcher:
CSI [param...] [intmd...] final
(APC|DCS|OSC|PM) [cmdstr] ST
(SS2|SS3) ch
SOS [chrstr] ST
According to ECMA-48, CSI parameter bytes are of range 0x30
to
0x3f
, intermediate bytes 0x20
to 0x2f
, and final byte
0x40
to 0x7e
.
Command string consists of printable characters and characters of range
0x08
and 0x0e
.
Character string can be any bit combination which does not represent
SOS
or ST
.
A supported control function, either verbatim or combined with placeholders,
can be specified as a valid pattern.
The terminating NUL
character does not count into the pattern.
A placeholder indicates that when matching a string against the pattern,
the value at the placeholder’s location should conform to its rules.
A placeholder can only take place in the param
, intmd
,
cmdstr
or chrstr
fields, and can be one of the following values:
CTLSEQS_PH_NUM
: An unsigned integer.
CTLSEQS_PH_NUMS
: Multiple unsigned integers separated with the
semicolon ASCII character (value 0x3b
).
CTLSEQS_PH_STR
: A string of printable characters.
CTLSEQS_PH_CMDSTR
: A string containing only printable characters
and characters of range 0x08
to 0x0d
.
CTLSEQS_PH_CSI_PARAM
: A string of CSI parameter bytes.
CTLSEQS_PH_CSI_INTMD
: A string of CSI intermediate bytes.
CTLSEQS_PH_HEXNUM
: A string representing a hexadecimal number.
CTLSEQS_PH_CHRSTR
: A string of any bit combination which does not
represent SOS
or ST
.
The following code is a valid example of patterns:
const char *patterns[] = { CTLSEQS_CUP(CTLSEQS_PH_NUM, CTLSEQS_PH_NUM), CTLSEQS_XTVERSION(), CTLSEQS_DECRQM("1000"), // ... };
Up: Matcher Configuration [Contents][Index]