return SimpleLookup((char *) modIndexNames, field, type, val_rtrn);
}
-static int
+int
LookupModMask(char * priv, uint32_t field, unsigned type,
ExprResult * val_rtrn)
{
ExprResolveModMask(ExprDef * expr,
ExprResult * val_rtrn)
{
- LookupPriv priv;
-
- priv.chain = NULL;
- priv.chainPriv = NULL;
- return ExprResolveMaskLookup(expr, val_rtrn, LookupModMask,
- (char *) & priv);
+ return ExprResolveMaskLookup(expr, val_rtrn, LookupModMask, NULL);
}
int
ExprResult * val_rtrn,
struct xkb_desc *xkb)
{
- LookupPriv priv;
-
- priv.chain = LookupVModMask;
- priv.chainPriv = (char *) xkb;
- return ExprResolveMaskLookup(expr, val_rtrn, LookupModMask,
- (char *) & priv);
+ return ExprResolveMaskLookup(expr, val_rtrn, LookupVModMask,
+ (char *) xkb);
}
int
extern char *exprOpText(unsigned /* type */
);
+extern int LookupModMask(char * /* priv */ ,
+ uint32_t /* field */ ,
+ unsigned /* type */ ,
+ ExprResult * /* val_rtrn */
+ );
+
+extern int LookupVModMask(char * /* priv */ ,
+ uint32_t /* field */ ,
+ unsigned /* type */ ,
+ ExprResult * /* val_rtrn */
+ );
+
extern int LookupModIndex(char * /* priv */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
}
/**
- * Get the mask for the given modifier and set val_rtrn.uval to the mask.
- * Note that the mask returned is always > 512.
+ * 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 Set to the mask returned.
+ * @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.
*/
int
-LookupVModMask(char * priv, uint32_t field, unsigned type, ExprResult * val_rtrn)
+LookupVModMask(char * priv, uint32_t field, unsigned type,
+ ExprResult * val_rtrn)
{
- if (LookupVModIndex(priv, field, type, val_rtrn))
+ if (LookupModMask(NULL, field, type, val_rtrn))
+ {
+ return True;
+ }
+ else if (LookupVModIndex(priv, field, type, val_rtrn))
{
register unsigned ndx = val_rtrn->uval;
val_rtrn->uval = (1 << (XkbNumModifiers + ndx));