2021-11-11 07:24:50 +00:00
|
|
|
.TH CTLSEQS_MATCHER_CONFIG 3 "Sep 01, 2020" 0.1.0 ctlseqs
|
2020-11-17 06:24:43 +00:00
|
|
|
.
|
|
|
|
.SH NAME
|
2020-12-11 04:47:14 +00:00
|
|
|
ctlseqs_matcher_config - configure control sequence matcher
|
2020-11-17 06:24:43 +00:00
|
|
|
.
|
|
|
|
.SH SYNOPSYS
|
|
|
|
.nf
|
|
|
|
.B #include <ctlseqs.h>
|
|
|
|
.PP
|
2021-11-11 07:24:50 +00:00
|
|
|
.B int ctlseqs_matcher_config(
|
|
|
|
.BI " struct ctlseqs_matcher *" matcher ,
|
|
|
|
.BI " struct ctlseqs_matcher_options const *" options
|
|
|
|
.B );
|
2020-11-17 06:24:43 +00:00
|
|
|
.fi
|
|
|
|
.
|
|
|
|
.SH DESCRIPTION
|
|
|
|
Changes the properties of the given
|
|
|
|
.IR matcher .
|
|
|
|
.PP
|
|
|
|
The
|
|
|
|
.I options
|
|
|
|
argument is a pointer to a
|
2020-12-11 04:47:14 +00:00
|
|
|
.BR "struct ctlseqs_matcher_options" ,
|
2020-11-17 06:24:43 +00:00
|
|
|
whose definition is shown below:
|
|
|
|
.PP
|
|
|
|
.nf
|
|
|
|
.in +4n
|
|
|
|
.EX
|
2020-12-11 04:47:14 +00:00
|
|
|
struct ctlseqs_matcher_options {
|
2020-11-17 06:24:43 +00:00
|
|
|
char const *const *patterns;
|
|
|
|
size_t npatterns;
|
|
|
|
};
|
|
|
|
.EE
|
|
|
|
.in
|
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
Field
|
|
|
|
.I patterns
|
2022-02-14 16:43:29 +00:00
|
|
|
is an array of pointers to NUL-terminated strings, each of which represents a
|
|
|
|
pattern of control sequences.
|
2020-11-17 06:24:43 +00:00
|
|
|
.PP
|
|
|
|
Field
|
|
|
|
.I npatterns
|
|
|
|
is the number of strings provided in
|
|
|
|
.IR patterns .
|
|
|
|
.PP
|
|
|
|
Multiple calls on the same
|
|
|
|
.I matcher
|
|
|
|
will discard all data from previous calls.
|
2021-03-15 01:40:38 +00:00
|
|
|
.SS Placeholders
|
2022-02-14 16:43:29 +00:00
|
|
|
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.
|
2021-03-15 01:40:38 +00:00
|
|
|
.PP
|
|
|
|
Currently supported placeholders:
|
|
|
|
.TP
|
|
|
|
.B CTLSEQS_PH_NUM
|
|
|
|
An unsigned integer.
|
|
|
|
.TP
|
|
|
|
.B CTLSEQS_PH_NUMS
|
2022-02-14 16:43:29 +00:00
|
|
|
Multiple unsigned integers separated with the semicolon ASCII character
|
|
|
|
(value 0x3b).
|
2021-03-15 01:40:38 +00:00
|
|
|
.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.
|
2020-11-17 06:24:43 +00:00
|
|
|
.
|
|
|
|
.SH RETURN VALUE
|
|
|
|
.TP
|
|
|
|
.B CTLSEQS_OK
|
|
|
|
Success.
|
|
|
|
.TP
|
|
|
|
.B CTLSEQS_NOMEM
|
|
|
|
Fails to allocate sufficient memory.
|
|
|
|
.
|
2020-12-14 13:12:09 +00:00
|
|
|
.SH NOTES
|
|
|
|
Any value in
|
|
|
|
.I patterns
|
2022-02-14 16:43:29 +00:00
|
|
|
must correspond to an ECMA-35/ECMA-48 conformant escape sequence, and should
|
|
|
|
also be supported by the matcher. Otherwise, function behaviour is undefined.
|
2020-12-14 13:12:09 +00:00
|
|
|
.PP
|
|
|
|
Currently supported escape sequences:
|
|
|
|
.TP
|
|
|
|
.B CSI [param...] [intmd...] final
|
2022-02-14 16:43:29 +00:00
|
|
|
Parameter bytes are of range 0x30\(ti0x3f, intermediate bytes 0x20\(ti0x2f, and
|
|
|
|
final byte 0x40\(ti0x7e.
|
2020-12-14 13:12:09 +00:00
|
|
|
.TP
|
|
|
|
.B (APC|DCS|OSC|PM) [cmdstr] ST
|
2022-02-14 16:43:29 +00:00
|
|
|
Command string consists of bytes of printable characters and characters of
|
|
|
|
range 0x08\(ti0x0d.
|
2020-12-14 13:12:09 +00:00
|
|
|
.TP
|
|
|
|
.B (SS2|SS3) ch
|
|
|
|
The byte following a single-shift should be a printable character.
|
|
|
|
.TP
|
|
|
|
.B SOS [chrstr] ST
|
|
|
|
Character string can be any bit combination which does not represent SOS or ST.
|
|
|
|
.
|
2020-11-17 06:24:43 +00:00
|
|
|
.SH COPYRIGHT
|
2021-02-26 09:43:53 +00:00
|
|
|
Copyright (c) 2020,2021 CismonX <admin@cismon.net>
|
2020-11-17 06:24:43 +00:00
|
|
|
.PP
|
2022-02-14 16:43:29 +00:00
|
|
|
Copying and distribution of this file, with or without modification, are
|
|
|
|
permitted in any medium without royalty, provided the copyright notice and
|
|
|
|
this notice are preserved. This file is offered as-is, without any warranty.
|
2020-12-21 12:56:27 +00:00
|
|
|
.
|
|
|
|
.SH SEE ALSO
|
2021-02-26 09:43:53 +00:00
|
|
|
.BR ctlseqs_match (3),
|
|
|
|
.BR ctlseqs_read (3)
|