xfree86: Match devices based on PnP ID

Serial input devices lack properties such as product or vendor name. This
makes matching InputClass sections difficult. Add a MatchPnPID entry to
test against the PnP ID of the device. The entry supports a shell pattern
match on platforms that support fnmatch(3). For example:

	MatchPnPID "WACf*"

A match type for non-path pattern matching, match_pattern, has been added.
The difference between this and match_path_pattern is the FNM_PATHNAME
flag in fnmatch(3).

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Dan Nicholson
2010-06-10 06:11:10 -07:00
committed by Peter Hutterer
parent d1b4beecbc
commit 645679c152
10 changed files with 68 additions and 1 deletions

View File

@@ -357,6 +357,8 @@ DuplicateInputAttributes(InputAttributes *attrs)
goto unwind;
if (attrs->device && !(new_attr->device = strdup(attrs->device)))
goto unwind;
if (attrs->pnp_id && !(new_attr->pnp_id = strdup(attrs->pnp_id)))
goto unwind;
new_attr->flags = attrs->flags;
@@ -401,6 +403,7 @@ FreeInputAttributes(InputAttributes *attrs)
free(attrs->product);
free(attrs->vendor);
free(attrs->device);
free(attrs->pnp_id);
if ((tags = attrs->tags))
while(*tags)