From 9b877d83947708259252275e14f6995dcf7c29ce Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 11 Aug 2008 16:20:22 +0930 Subject: If we're not using XkbDesc, don't require it as a parameter. --- keycodes.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'keycodes.c') diff --git a/keycodes.c b/keycodes.c index 1fe5e87..792a263 100644 --- a/keycodes.c +++ b/keycodes.c @@ -312,6 +312,10 @@ FindKeyByLong(KeyNamesInfo * info, unsigned long name) return 0; } +/** + * Store the name of the key as a long in the info struct under the given + * keycode. If the same keys is referred to twice, print a warning. + */ static Bool AddKeyName(KeyNamesInfo * info, int kc, @@ -562,9 +566,12 @@ HandleIncludeKeycodes(IncludeStmt * stmt, return (info->errorCount == 0); } +/** + * Parse the given statement and store the output in the info struct. + * e.g. = 9 + */ static int -HandleKeycodeDef(KeycodeDef * stmt, - XkbDescPtr xkb, unsigned merge, KeyNamesInfo * info) +HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info) { int code; ExprResult result; @@ -596,8 +603,7 @@ HandleKeycodeDef(KeycodeDef * stmt, #define MAX_KEYCODE_DEF 1 static int -HandleKeyNameVar(VarDef * stmt, XkbDescPtr xkb, unsigned merge, - KeyNamesInfo * info) +HandleKeyNameVar(VarDef * stmt, unsigned merge, KeyNamesInfo * info) { ExprResult tmp, field; ExprDef *arrayNdx; @@ -688,7 +694,7 @@ HandleKeyNameVar(VarDef * stmt, XkbDescPtr xkb, unsigned merge, static int HandleIndicatorNameDef(IndicatorNameDef * def, - XkbDescPtr xkb, unsigned merge, KeyNamesInfo * info) + unsigned merge, KeyNamesInfo * info) { IndicatorNameInfo ii; ExprResult tmp; @@ -734,7 +740,7 @@ HandleKeycodesFile(XkbFile * file, info->errorCount++; break; case StmtKeycodeDef: - if (!HandleKeycodeDef((KeycodeDef *) stmt, xkb, merge, info)) + if (!HandleKeycodeDef((KeycodeDef *) stmt, merge, info)) info->errorCount++; break; case StmtKeyAliasDef: @@ -742,12 +748,12 @@ HandleKeycodesFile(XkbFile * file, merge, info->fileID, &info->aliases)) info->errorCount++; break; - case StmtVarDef: - if (!HandleKeyNameVar((VarDef *) stmt, xkb, merge, info)) + case StmtVarDef: /* e.g. minimum, maximum */ + if (!HandleKeyNameVar((VarDef *) stmt, merge, info)) info->errorCount++; break; case StmtIndicatorNameDef: - if (!HandleIndicatorNameDef((IndicatorNameDef *) stmt, xkb, + if (!HandleIndicatorNameDef((IndicatorNameDef *) stmt, merge, info)) { info->errorCount++; -- cgit v1.2.3