From 6de4255e406e4673291cca1a8a6ab6e60b0ab6ba Mon Sep 17 00:00:00 2001 From: CismonX Date: Mon, 15 Mar 2021 09:40:38 +0800 Subject: [PATCH] Update documentation for placeholders. --- doc/ctlseqs.texi | 37 +++++++++++++++--------------------- man/ctlseqs_matcher_config.3 | 28 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/doc/ctlseqs.texi b/doc/ctlseqs.texi index bd58d12..f91350e 100644 --- a/doc/ctlseqs.texi +++ b/doc/ctlseqs.texi @@ -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 diff --git a/man/ctlseqs_matcher_config.3 b/man/ctlseqs_matcher_config.3 index 5ea9193..3b246e2 100644 --- a/man/ctlseqs_matcher_config.3 +++ b/man/ctlseqs_matcher_config.3 @@ -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