From af2a8b3a3745078aba3534fb554eea125817f827 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 2 Sep 2012 21:45:42 +0300 Subject: Unify some string tables from xkbcomp, text and keymap-dump We move the LookupEntry struct from expr.h to text.h, along with most of the lookup tables. This makes them available everywhere. Looking up a value in the LookupEntry format is slower than direct index mapping, but it allows multiple names per value (with the canonical one being first) and "all"- and "none"-type masks. These functions are not used anywhere efficiency matters. Signed-off-by: Ran Benita --- src/text.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/text.h') diff --git a/src/text.h b/src/text.h index 7991b88..098936f 100644 --- a/src/text.h +++ b/src/text.h @@ -29,6 +29,29 @@ #include "xkb-priv.h" +typedef struct { + const char *name; + unsigned int value; +} LookupEntry; + +bool +LookupString(const LookupEntry tab[], const char *string, + unsigned int *value_rtrn); + +const char * +LookupValue(const LookupEntry tab[], unsigned int value); + +extern const LookupEntry ctrlMaskNames[]; +extern const LookupEntry modComponentMaskNames[]; +extern const LookupEntry groupComponentMaskNames[]; +extern const LookupEntry groupMaskNames[]; +extern const LookupEntry groupNames[]; +extern const LookupEntry levelNames[]; +extern const LookupEntry buttonNames[]; +extern const LookupEntry useModMapValueNames[]; +extern const LookupEntry actionTypeNames[]; +extern const LookupEntry symInterpretMatchMaskNames[]; + const char * VModMaskText(struct xkb_keymap *keymap, xkb_mod_mask_t cmask); -- cgit v1.2.1