Update documentation for placeholders.

This commit is contained in:
CismonX 2021-03-15 09:40:38 +08:00
parent 53aaa97014
commit 6de4255e40
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
2 changed files with 43 additions and 22 deletions

View File

@ -303,30 +303,23 @@ can be specified as a valid pattern. The terminating @code{NUL} character does
not count into the pattern.
@cindex List of supported placeholders
A placeholder can only take place in the @code{param}, @code{intmd},
@code{cmdstr} or @code{chrstr} fields, and can be one of the following values:
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 @code{param}, @code{intmd}, @code{cmdstr} or
@code{chrstr} fields, and can be one of the following values:
@itemize @bullet
@item @code{CTLSEQS_PH_NUM}: A single unsigned integer.
@item @code{CTLSEQS_PH_NUMS}: An unsigned integer indicating the number of
extracted values, followed by unsigned integers of that many.
@item @code{CTLSEQS_PH_STR}: An unsigned integer indicating the number of
characters of the extracted string, followed by a string of printable
characters.
@item @code{CTLSEQS_PH_CMDSTR}: An unsigned integer indicating the number of
characters of the extracted string, followed by a string containing only
printable characters and characters of range @code{0x08} to @code{0x0d}.
@item @code{CTLSEQS_PH_CSI_PARAM}: An unsigned integer indicating the number of
characters of the extracted string, followed by a string of CSI parameter
bytes.
@item @code{CTLSEQS_PH_CSI_INTMD}: An unsigned integer indicating the number of
characters of the extracted string, followed by a string of CSI intermediate
bytes.
@item @code{CTLSEQS_PH_HEXNUM}: A single unsigned integer, which is the integer
value of extracted hexadecimal string.
@item @code{CTLSEQS_PH_CHRSTR}: An unsigned integer indicating the number of
characters of the extracted string, followed by a string of any bit combination
which does not represent @code{SOS} or @code{ST}.
@item @code{CTLSEQS_PH_NUM}: An unsigned integer.
@item @code{CTLSEQS_PH_NUMS}: Multiple unsigned integers separated with the
semicolon ASCII character (value @code{0x3b}).
@item @code{CTLSEQS_PH_STR}: A string of printable characters.
@item @code{CTLSEQS_PH_CMDSTR}: A string containing only printable characters
and characters of range @code{0x08} to @code{0x0d}.
@item @code{CTLSEQS_PH_CSI_PARAM}: A string of CSI parameter bytes.
@item @code{CTLSEQS_PH_CSI_INTMD}: A string of CSI intermediate bytes.
@item @code{CTLSEQS_PH_HEXNUM}: A string representing a hexadecimal number.
@item @code{CTLSEQS_PH_CHRSTR}: A string of any bit combination which does not
represent @code{SOS} or @code{ST}.
@end itemize
@cindex Control sequence matcher pattern example

View File

@ -44,6 +44,34 @@ is the number of strings provided in
Multiple calls on the same
.I matcher
will discard all data from previous calls.
.SS Placeholders
A pattern may contain zero to multiple placeholders, where a placeholder indicates that when matching a string against the pattern, the value at the placeholder's location should conform to its rules.
.PP
Currently supported placeholders:
.TP
.B CTLSEQS_PH_NUM
An unsigned integer.
.TP
.B CTLSEQS_PH_NUMS
Multiple unsigned integers separated with the semicolon ASCII character (value 0x3b).
.TP
.B CTLSEQS_PH_STR
A string of printable characters.
.TP
.B CTLSEQS_PH_CMDSTR
A string containing printable characters and characters of range 0x08\(ti0x0d.
.TP
.B CTLSEQS_PH_CSI_PARAM
A string of CSI parameter bytes (range 0x30\(ti0x3f).
.TP
.B CTLSEQS_PH_CSI_INTMD
A string of CSI intermediate bytes (range 0x20\(ti0x2f).
.TP
.B CTLSEQS_PH_HEXNUM
A string representing a hexadecimal number.
.TP
.B CTLSEQS_PH_CHRSTR
A string of any bit combination which does not represent SOS or ST.
.
.SH RETURN VALUE
.TP