Up: Matcher Configuration   [Contents][Index]


3.1.1 Patterns

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:

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:

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]