Commit Graph

2 Commits

Author SHA1 Message Date
Oleh Nykyforchyn
7fb3e9cdab xserver: hw/xfree86/{common,parser}: use regular expressions for matching
It is patch 4/5 of a series that refactors matching input and output devices to classes and
extends possibilities to describe them, in particular, it allows use of regular expressions.

This patch introduces matching against a regular expression using regex library.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-04 12:02:19 +02:00
Oleh Nykyforchyn
f7a892d7d0 xserver: hw/xfree86/parser: create pattern group from a string and print it
It is patch 2/5 of a series that refactors matching input and output devices to classes and
extends possibilities to describe them, in particular, it allows use of regular expressions.

This patch adds a function xf86createMatchGroup to build a pattern group from a string in
MatchProduct, MatchDevice or similar directives. It implements rudimentary logic ("or",
"and", and "not") to construct complex conditions for a device to an input/output class
to be applied based on the device attributes. Also xf86printMatchPattern is defined, which
is necessary to save an actual config file. Pattern groups are not used for matching yet,
the original functionality is preserved.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-04 12:02:19 +02:00