- return false;
-}
-
-/**
- * Get the mask for the given (virtual or core) modifier and set
- * val_rtrn.uval to the mask value.
- *
- * @param priv Pointer to xkb data structure.
- * @param val_rtrn Member uval is set to the mask returned.
- *
- * @return true on success, false otherwise. If false is returned, val_rtrn is
- * undefined.
- */
-bool
-LookupVModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
- enum expr_value_type type, xkb_mod_mask_t *val_rtrn)
-{
- xkb_mod_index_t ndx;
-
- if (LookupModMask(ctx, NULL, field, type, val_rtrn)) {
- return true;
- }
- else if (LookupVModIndex(priv, field, type, &ndx)) {
- *val_rtrn = (1 << (XkbNumModifiers + ndx));
- return true;
- }
-
- return false;
-}
-
-xkb_mod_index_t
-FindKeypadVMod(struct xkb_keymap *keymap)
-{
- xkb_atom_t name;
- xkb_mod_index_t ndx;
-
- name = xkb_atom_intern(keymap->ctx, "NumLock");
- if (LookupVModIndex(keymap, name, EXPR_TYPE_INT, &ndx))
- return ndx;
-
- return -1;
-}
-
-bool
-ResolveVirtualModifier(ExprDef *def, struct xkb_keymap *keymap,
- xkb_mod_index_t *ndx_rtrn, VModInfo *info)
-{
- int val;
-
- if (def->op == EXPR_IDENT) {
- xkb_mod_index_t i;
- xkb_mod_mask_t bit;
- const char *name = xkb_atom_text(keymap->ctx, def->value.str);
-
- for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) {
- if ((info->available & bit) && keymap->vmod_names[i] &&
- streq(keymap->vmod_names[i], name)) {
- *ndx_rtrn = i;
- return true;
- }
- }
- }
-
- if (!ExprResolveInteger(keymap->ctx, def, &val))
- return false;
-
- if (val < 0 || val >= XkbNumVirtualMods) {
- log_err(keymap->ctx,
- "Illegal virtual modifier %d (must be 0..%d inclusive)\n",
- val, XkbNumVirtualMods - 1);