summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-08-15 22:07:37 +0300
committerRan Benita <ran234@gmail.com>2012-09-02 19:17:09 +0300
commitf410622b4bcbe79d0c51e98e058a3bffee0b7a66 (patch)
treed58c99f20cf5192c46d31b3273e93d170058af67 /src/utils.h
parentd3ddcf70e82b70e2a306d4678946a5fecd8d240b (diff)
downloadxorg-lib-libxkbcommon-f410622b4bcbe79d0c51e98e058a3bffee0b7a66.tar.gz
vmod: remove support for resolving integer to virtual modifier
This is only relevant to the virtualModifier= statement in interpret statements in xkb_compat. The current code allows to write e.g. virtualModifier = 4 to get the virtual modifier whose index happens to be 4 (possibly declared in other files or sections, i.e. xkb_types). Doing this is undeterministic, will break without notice, and not used anywhere. Don't allow it. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
index 0f7a384..3fda939 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -44,6 +44,14 @@ streq(const char *s1, const char *s2)
}
static inline bool
+streq_not_null(const char *s1, const char *s2)
+{
+ if (!s1 || !s2)
+ return false;
+ return streq(s1, s2);
+}
+
+static inline bool
istreq(const char *s1, const char *s2)
{
return strcasecmp(s1, s2) == 0;