From beb073813e56b527cf9a5cfb591664ea5100c39a Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 5 Apr 2024 15:30:44 +0200 Subject: [PATCH] xkb: drop ununsed XkbNameMatchesPattern() Not used anywhere, also not in drivers, so we can drop it. Probably never been used, just added accidentially back in 2008. Fixes: 68bd7ac1930b5cffb6657b8d5f5bf8ae58eae8d9 Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- include/xkbfile.h | 4 ---- xkb/xkbfmisc.c | 34 ---------------------------------- 2 files changed, 38 deletions(-) diff --git a/include/xkbfile.h b/include/xkbfile.h index 8a2fec40c..2bd43683a 100644 --- a/include/xkbfile.h +++ b/include/xkbfile.h @@ -207,10 +207,6 @@ extern _X_EXPORT unsigned XkbConvertGetByNameComponents(Bool /* toXkm */ , unsigned /* orig */ ); -extern _X_EXPORT Bool XkbNameMatchesPattern(char * /* name */ , - char * /* pattern */ - ); - /***====================================================================***/ extern _X_EXPORT Bool XkbWriteXKBKeycodes(FILE * /* file */ , diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index 2f3ec5e4b..47da228ca 100644 --- a/xkb/xkbfmisc.c +++ b/xkb/xkbfmisc.c @@ -431,37 +431,3 @@ XkbConvertGetByNameComponents(Bool toXkm, unsigned orig) } return rtrn; } - -/***====================================================================***/ - -#define UNMATCHABLE(c) (((c)=='(')||((c)==')')||((c)=='/')) - -Bool -XkbNameMatchesPattern(char *name, char *ptrn) -{ - while (ptrn[0] != '\0') { - if (name[0] == '\0') { - if (ptrn[0] == '*') { - ptrn++; - continue; - } - return FALSE; - } - if (ptrn[0] == '?') { - if (UNMATCHABLE(name[0])) - return FALSE; - } - else if (ptrn[0] == '*') { - if ((!UNMATCHABLE(name[0])) && - XkbNameMatchesPattern(name + 1, ptrn)) - return TRUE; - return XkbNameMatchesPattern(name, ptrn + 1); - } - else if (ptrn[0] != name[0]) - return FALSE; - name++; - ptrn++; - } - /* if we get here, the pattern is exhausted (-:just like me:-) */ - return name[0] == '\0'; -}