Re: [PATCH 1/2 v3] xserver: Use constants for matching modes and make xf86MatchGroup a list

2011-12-03 Thread Oleh Nykyforchyn
ping Please Your comments and suggestions about the two patches submitted in November. http://lists.x.org/archives/xorg-devel/2011-November/027100.html http://lists.x.org/archives/xorg-devel/2011-November/027101.html Oleh Nykyforchyn - On Sat, 12 Nov 2011 17:24:45 +0200 Oleh R

[PATCH 1/2 v2] xserver: Use constants for matching modes and make xf86MatchGroup a list

2011-10-30 Thread Oleh Nykyforchyn
to join all match_* functions in InputClass.c into one multi-mode function. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 130 + hw/xfree86/parser/InputClass.c | 211 +--- hw/xfree86/parser

[PATCH 2/2 v2] xserver: Use extended regular expressions in Match entries

2011-10-30 Thread Oleh Nykyforchyn
]$/ is applied to a device only in layouts Seat0, Seat1, ..., Seat5. In particular, this can allow for path matching on systems without fnmatch(). A regular expression is compiled only before its first use. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 23

[PATCH 1/2] xserver: Use constants for matching modes and make xf86MatchGroup a list

2011-10-26 Thread Oleh Nykyforchyn
in a pattern together with a pattern string. This allows to join all match_* functions in InputClass.c into one multi-mode function. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 130 + hw/xfree86/parser/InputClass.c | 211

[PATCH 2/2] xserver: Use extended regular expressions in Match entries

2011-10-26 Thread Oleh Nykyforchyn
, an InputClass with MatchLayout regex:/^Seat[0-9]$/ is applied to a device only in layouts Seat0, Seat1, ..., Seat9. In particular, this can allow path matching on systems without fnmatch(). A regular expression is compiled only before its first use. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com

Re: Syntax enhancements for Match statements

2011-10-26 Thread Oleh Nykyforchyn
, but with char** changed to list of patterns, which allows to keep matching mode together with pattern strings. It seems to be in line with the latest changes in InputClass.c (nt_list_*...). No visible changes for users in the first patch at all. Best regards, Oleh Nykyforchyn oleh@gmail.com

[PATCH 1/2] xserver: Use constants for matching modes and make xf86MatchGroup a list

2011-10-26 Thread Oleh Nykyforchyn
-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 130 + hw/xfree86/parser/InputClass.c | 211 +--- hw/xfree86/parser/xf86Parser.h | 22 - 3 files changed, 221 insertions(+), 142 deletions(-) diff --git

Syntax enhancements for Match statements

2011-10-17 Thread Oleh Nykyforchyn
Seat0|Seat1 EndSection Comments, please. Best regards, Oleh Nykyforchyn oleh@gmail.com ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 2/3 v2'] xserver: Introduce negated conditions in Match patterns

2011-06-21 Thread Oleh Nykyforchyn
On Tue, 21 Jun 2011 06:05:51 -0700 Dan Nicholson dbn.li...@gmail.com wrote: On Sat, Jun 18, 2011 at 12:07 AM, Oleh Nykyforchyn oleh@gmail.com wrote: Well, if people are so accustomed to single arguments and | as or, what about: 1) adding logical '' to logical '|'; 2) regex:|pat

[PATCH 1/3 v3] xserver: Use constants for matching modes and logical AND in Match entries

2011-06-20 Thread Oleh Nykyforchyn
foobar|beehoney|anything Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 140 -- hw/xfree86/parser/InputClass.c | 247 +-- hw/xfree86/parser/xf86Parser.h | 23 - 3 files changed, 256 insertions

[PATCH 2/3 v3] xserver: Introduce negated conditions in Match patterns

2011-06-20 Thread Oleh Nykyforchyn
this pattern, then the respective device is rejected by this InputClass. Hence an entry can look as follows: MatchProduct good!bad|!beehoney which is in fact a disjunctive normal form. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c |5 +++-- hw/xfree86/parser

[PATCH 3/3 v3] xserver: Use extended regular expressions in Match entries

2011-06-20 Thread Oleh Nykyforchyn
, MatchProduct !regex:/^USB/regex:%Optical Mouse$% matches non-USB optical mice. Regex patterns can be arbitarily mixed with simple ones. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 23 +++-- hw/xfree86/parser/InputClass.c | 42

Re: [PATCH 2/3 v2'] xserver: Introduce negated conditions in Match patterns

2011-06-18 Thread Oleh Nykyforchyn
Well, if people are so accustomed to single arguments and | as or, what about: 1) adding logical '' to logical '|'; 2) regex:|pat| = regex:/pat/ = regex:%pat% = (like sed); 3) single argument, with multiple conditions (probably regexes). This way we obtain the same (and even more)

[PATCH 1/3 v2'] xserver: Use lists and constants for matching modes in Match entries

2011-06-17 Thread Oleh Nykyforchyn
-by: Oleh Nykyforchyn oleh.nyk at gmail.com --- hw/xfree86/common/xf86Xinput.c | 122 --- hw/xfree86/man/xorg.conf.man | 31 +++- hw/xfree86/parser/InputClass.c | 319 +--- hw/xfree86/parser/xf86Parser.h | 22 +++- 4 files changed, 310 insertions

[PATCH 3/3 v2'] xserver: Use extended regular expressions in Match entries

2011-06-17 Thread Oleh Nykyforchyn
, MatchProduct !regex:^USB regex:Optical Mouse$ matches non-USB optical mice. Regex patterns can be arbitarily mixed with simple ones. Signed-off-by: Oleh Nykyforchyn oleh.nyk at gmail.com --- hw/xfree86/common/xf86Xinput.c | 23 --- hw/xfree86/man/xorg.conf.man | 17

[PATCH 1/3 v2] xserver: Use lists and constants for matching modes in Match entries

2011-06-11 Thread Oleh Nykyforchyn
-by: Oleh Nykyforchyn oleh.nyk at gmail.com --- hw/xfree86/common/xf86Xinput.c | 122 --- hw/xfree86/man/xorg.conf.man | 31 +++- hw/xfree86/parser/InputClass.c | 320 +--- hw/xfree86/parser/xf86Parser.h | 22 +++- 4 files changed, 311

[PATCH 2/3 v2] xserver: Introduce negated conditions in Match pattern

2011-06-11 Thread Oleh Nykyforchyn
after testing, incl. formatting and readability Signed-off-by: Oleh Nykyforchyn oleh.nyk at gmail.com --- hw/xfree86/common/xf86Xinput.c | 15 --- hw/xfree86/man/xorg.conf.man | 19 --- hw/xfree86/parser/InputClass.c | 10 ++ hw/xfree86/parser/xf86Parser.h

[PATCH 3/3 v2] xserver: Use extended regular expressions in Match entries

2011-06-11 Thread Oleh Nykyforchyn
, MatchProduct !regex:^USB regex:Optical Mouse$ matches non-USB optical mice. Regex patterns can be arbitarily mixed with simple ones. Version 2: small fixes after testing, incl. formatting and readability Signed-off-by: Oleh Nykyforchyn oleh.nyk at gmail.com --- hw/xfree86/common/xf86Xinput.c | 24

[PATCH 1/3 v2] xserver: Use lists and constants for matching modes in Match entries

2011-06-11 Thread Oleh Nykyforchyn
of regular expressions in these statements. Version 2: small fixes after testing, incl. formatting and readability Signed-off-by: Oleh Nykyforchyn oleh.nyk at gmail.com --- hw/xfree86/common/xf86Xinput.c | 122 --- hw/xfree86/man/xorg.conf.man | 31 +++- hw/xfree86/parser

[PATCH 1/3] xserver: Use lists and constants for matching modes in Match entries

2011-06-09 Thread Oleh Nykyforchyn
MatchProduct foo|bar|anything|else also in the forms MatchProduct foo bar anything else or MatchProduct foo|bar anything|else etc, which is useful for introduction of regular expressions in these statements. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common

[PATCH 2/3] xserver: Introduce negated conditions in Match patterns

2011-06-09 Thread Oleh Nykyforchyn
this pattern, then the respective device is rejected by this InputClass. To allow statements like MatchVendor !Asus|!Logitech (I did not want to offend any vendor), we also accept the rule of last pattern: if the end of an entry is reached, then the last pattern is decisive. Signed-off-by: Oleh

[PATCH 3/3] xserver: Use lists and constants for matching modes in Match entries

2011-06-09 Thread Oleh Nykyforchyn
, MatchProduct !regex:^USB regex:Optical Mouse$ matches non-USB optical mice. Regex patterns can be arbitarily mixed with simple ones. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 23 --- hw/xfree86/man/xorg.conf.man | 17

Re: [PATCH 1/4] xserver: Use lists and constants for matching modes in Match entries

2011-06-08 Thread Oleh Nykyforchyn
On Wed, 8 Jun 2011 10:39:40 -0700 Dan Nicholson dbn.li...@gmail.com wrote: On Sat, Jun 4, 2011 at 10:48 PM, Oleh Nykyforchyn oleh@gmail.com wrote: Use lists and constants for matching modes in Match entries You're leaving out some critical information here. Particularly that each Match

Re: [PATCH 1/4] xserver: Use lists and constants for matching modes in Match entries

2011-06-08 Thread Oleh Nykyforchyn
On Wed, 8 Jun 2011 10:39:40 -0700 Dan Nicholson dbn.li...@gmail.com wrote: Why did you change all the breaks to continues? If there was code below the switch you'd be skipping it. Sorry, You are right, it does not matter here. Oleh ___

Re: [PATCH xserver] Multiple matching modes (incl. regex) selection support in Match* statements

2011-06-05 Thread Oleh Nykyforchyn
argument similar to .B Option Oleh Nykyforchyn oleh@gmail.com ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 1/4] xserver: Use lists and constants for matching modes in Match entries

2011-06-05 Thread Oleh Nykyforchyn
Use lists and constants for matching modes in Match entries Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 117 +++--- hw/xfree86/parser/InputClass.c | 336 +--- hw/xfree86/parser/xf86Parser.h | 23 +++- 3

[PATCH 2/4] xserver: Add negation operator to Match entries

2011-06-05 Thread Oleh Nykyforchyn
Add negation operator to Match entries Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 15 --- hw/xfree86/parser/InputClass.c | 10 ++ hw/xfree86/parser/xf86Parser.h |1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff

[PATCH 3/4] xserver: Use regular expressions in Match entries

2011-06-05 Thread Oleh Nykyforchyn
Use regular expressions in Match entries Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 22 -- hw/xfree86/parser/InputClass.c | 17 - hw/xfree86/parser/xf86Parser.h |7 ++- 3 files changed, 42 insertions

[PATCH 4/4] xserver: Add negation and regexes in Match entries to man page

2011-06-05 Thread Oleh Nykyforchyn
Add negation and regexes in Match entries to man page Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/man/xorg.conf.man | 49 -- 1 files changed, 42 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86

Re: [PATCH xserver] Multiple matching modes (incl. regex) selection support in Match* statements

2011-06-03 Thread Oleh Nykyforchyn
On Fri, 3 Jun 2011 16:30:26 +1000 Peter Hutterer peter.hutte...@who-t.net wrote: a few high-level comments, the patch itself looks sane on a first glance. - let's just use regex:, not either of regex: or re:. one is enough. OK - I'm not a big fan of allowing a mix of multiple arguments and |.

Re: [PATCH xserver] Multiple matching modes (incl. regex) selection support in Match* statements

2011-06-03 Thread Oleh Nykyforchyn
On Fri, 3 Jun 2011 09:22:42 -0500 Dan Nicholson dbn.li...@gmail.com wrote: Even though I've argued repeatedly that having an additional argument is the way to go, I would agree that an arbitrary amount of arguments doesn't make this easier to understand. If we propose the syntax

[PATCH xserver] Multiple matching modes (incl. regex) selection support in Match* statements

2011-06-02 Thread Oleh Nykyforchyn
conditions are prefixed by !, which can be combined with each other prefix. Different modes, as well as usual and negated patterns, can be mixed in one line. Signed-off-by: Oleh Nykyforchyn oleh.nyk at gmail.com --- hw/xfree86/common/xf86Xinput.c | 147 +-- hw/xfree86/parser/InputClass.c

Re: [RFC] regular expression support in config files (try 2)

2011-06-01 Thread Oleh Nykyforchyn
in one line. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 147 +-- hw/xfree86/parser/InputClass.c | 407 +++- hw/xfree86/parser/xf86Parser.h | 30 +++- 3 files changed, 396 insertions(+), 188 deletions

[RFC] regular expression support in config files (try 2)

2011-05-31 Thread Oleh Nykyforchyn
on the idea and style are welcome. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 131 -- hw/xfree86/parser/InputClass.c | 404 +--- hw/xfree86/parser/xf86Parser.h | 29 +++- 3 files changed, 398

Re: [RFC] regular expression support in config files (try 2), help needed

2011-05-31 Thread Oleh Nykyforchyn
On Tue, 31 May 2011 16:06:02 +0300 Oleh Nykyforchyn oleh@gmail.com wrote: Add extended regexes support to InputClass Match* statements (try 2) Any number of patterns can be written in one line either as MatchProduct foo|!bar something|re:^else$ you !regex:n..d

Re: [RFC] regular expression support in config files (try 2)

2011-05-31 Thread Oleh Nykyforchyn
. Tested (not so heavy, but no obvious errors found). Comments, please. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 131 +++-- hw/xfree86/parser/InputClass.c | 418 +--- hw/xfree86/parser/xf86Parser.h | 30

Re: [PATCH] regular expression support (was Re: [PATCH xfree86] Signed-off-by: Oleh Nykyforchyn)

2011-05-29 Thread Oleh Nykyforchyn
for an optional argument to EACH peace of code for Match{Product,Layout,Vendor,...}? Oleh Nykyforchyn oleh@gmail.com ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman

Re: [PATCH xfree86] Signed-off-by: Oleh Nykyforchyn oleh....@gmail.com

2011-05-25 Thread Oleh Nykyforchyn
each match is repeated twice, but it works. The patch itself: --- Add option to use extended regex expresssions in Match* statements If a pattern list is of the form re:str, then str is treated as a single extended regular expression Signed-off-by: Oleh

Re: [PATCH xfree86] Signed-off-by: Oleh Nykyforchyn oleh....@gmail.com

2011-05-24 Thread Oleh Nykyforchyn
for me on Linux, over the three my previous patches). Add option to use extended regex expresssions in Match* statements If a pattern list is of the form |str|, then str is treated as a single extended regular expression (with two |-s dropped) Signed-off-by: Oleh Nykyforchyn oleh@gmail.com

Re: [PATCH xfree86] Signed-off-by: Oleh Nykyforchyn oleh....@gmail.com

2011-05-23 Thread Oleh Nykyforchyn
functions, as it is now, and single regex per statement, which covers all special cases? -- Oleh Nykyforchyn oleh@gmail.com ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman

Re: [PATCH xfree86] Signed-off-by: Oleh Nykyforchyn oleh....@gmail.com

2011-05-23 Thread Oleh Nykyforchyn
On Mon, 23 May 2011 12:55:20 +1000 Peter Hutterer peter.hutte...@who-t.net wrote: On Fri, May 20, 2011 at 04:30:20PM -0700, Dan Nicholson wrote: We had this conversation before. I had a patch where you specified an optional third argument stating what type of match you wanted. It was then

Re: [PATCH xfree86] Signed-off-by: Oleh Nykyforchyn oleh....@gmail.com

2011-05-23 Thread Oleh Nykyforchyn
On Mon, 23 May 2011 05:54:55 -0700 Dan Nicholson dbn.li...@gmail.com wrote: The whole reason why the current setup is weird is that it's completely implicit what type of matching happens in each statement. MatchProduct is string comparison (case sensitive) while MatchDevicePath is a path

Re: [PATCH xfree86] Allow negative conditions in Match* statements

2011-05-19 Thread Oleh Nykyforchyn
: xfree86: Allow negative conditions in Match* statements Match statement syntax is extended to allow strings like: aaa,!a,bbb,!b,ccc,!c Match succeedes if an attribute matches aaa, bbb, or ccc, or does not match neither a, b, or c. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86

Re: [PATCH xfree86] Allow MatchLayout statements in config files

2011-05-19 Thread Oleh Nykyforchyn
means no Layout sections found, e.g. MatchLayout GeForce| is in layout GeForce or without explicit layout at all. Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/common/xf86Xinput.c | 21 + hw/xfree86/parser/InputClass.c | 21

[PATCH xfree86] Add MatchLayout and negative patterns in Match* statements and to man page

2011-05-18 Thread Oleh Nykyforchyn
Add MatchLayout and negative patterns in Match* statements and to man page Signed-off-by: Oleh Nykyforchyn oleh@gmail.com --- hw/xfree86/man/xorg.conf.man | 31 ++- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/man/xorg.conf.man b