Remove support for xkb_layout and xkb_semantics file types
authorRan Benita <ran234@gmail.com>
Wed, 9 May 2012 14:54:37 +0000 (17:54 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Wed, 9 May 2012 16:53:15 +0000 (17:53 +0100)
These are two aggregate file types which are not used anywhere. We
maintain useful-enough backward compatibility in the parser, by treating
them as xkb_keymap. The keymap type allows for all types of components,
so they will still compile fine if they ever come up.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/text.c
src/xkb-priv.h
src/xkbcomp/keymap.c
src/xkbcomp/parser.y
src/xkbcomp/parseutils.c
src/xkbcomp/path.c
src/xkbcomp/xkbcomp.c

index 7603a6a..2ca411b 100644 (file)
@@ -189,10 +189,6 @@ const char *
 XkbcConfigText(unsigned config)
 {
     switch (config) {
-    case XkmSemanticsFile:
-        return "Semantics";
-    case XkmLayoutFile:
-        return "Layout";
     case XkmKeymapFile:
         return "Keymap";
     case XkmTypesIndex:
index 35f7f8a..7527bf3 100644 (file)
@@ -89,8 +89,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "utils.h"
 
 /* From XKM.h */
-#define        XkmSemanticsFile        20
-#define        XkmLayoutFile           21
 #define        XkmKeymapFile           22
 #define        XkmRulesFile            24
 
@@ -106,14 +104,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define        XkmKeyNamesMask         (1<<4)
 #define XkmGeometryMask         (1<<5)
 
-#define        XkmSemanticsRequired    (XkmCompatMapMask)
-#define        XkmSemanticsOptional    (XkmTypesMask|XkmGeometryMask)
-#define        XkmSemanticsLegal       (XkmSemanticsRequired|XkmSemanticsOptional)
-#define        XkmLayoutRequired       (XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask)
-#define        XkmLayoutOptional       (XkmGeometryMask)
-#define        XkmLayoutLegal          (XkmLayoutRequired|XkmLayoutOptional)
-#define        XkmKeymapRequired       (XkmSemanticsRequired|XkmLayoutRequired)
-#define        XkmKeymapOptional       ((XkmSemanticsOptional|XkmLayoutOptional)&(~XkmKeymapRequired))
+#define        XkmKeymapRequired       (XkmCompatMapMask|XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask)
+#define        XkmKeymapOptional       ((XkmTypesMask|XkmGeometryMask)&(~XkmKeymapRequired))
 #define        XkmKeymapLegal          (XkmKeymapRequired|XkmKeymapOptional)
 
 struct xkb_any_action {
index 58141e0..9967f0e 100644 (file)
@@ -57,14 +57,6 @@ CompileKeymap(struct xkb_ctx *ctx, XkbFile *file)
     mainName = file->name ? file->name : "(unnamed)";
     switch (mainType)
     {
-    case XkmSemanticsFile:
-        required = XkmSemanticsRequired;
-        legal = XkmSemanticsLegal;
-        break;
-    case XkmLayoutFile:        /* standard type  if setxkbmap -print */
-        required = XkmLayoutRequired;
-        legal = XkmKeymapLegal;
-        break;
     case XkmKeymapFile:
         required = XkmKeyNamesIndex | XkmTypesIndex | XkmSymbolsIndex |
                    XkmCompatMapIndex;
@@ -114,8 +106,6 @@ CompileKeymap(struct xkb_ctx *ctx, XkbFile *file)
             WSGO("Unknown file type %d\n", file->type);
             ACTION("Ignored\n");
             continue;
-        case XkmSemanticsFile:
-        case XkmLayoutFile:
         case XkmKeymapFile:
             WSGO("Illegal %s configuration in a %s file\n",
                   XkbcConfigText(file->type), XkbcConfigText(mainType));
index 2810a13..9eb51fc 100644 (file)
@@ -182,8 +182,8 @@ XkbCompositeMap     :       OptFlags XkbCompositeType OptMapName OBRACE
                ;
 
 XkbCompositeType:      XKB_KEYMAP      { $$= XkmKeymapFile; }
-               |       XKB_SEMANTICS   { $$= XkmSemanticsFile; }
-               |       XKB_LAYOUT      { $$= XkmLayoutFile; }
+               |       XKB_SEMANTICS   { $$= XkmKeymapFile; }
+               |       XKB_LAYOUT      { $$= XkmKeymapFile; }
                ;
 
 XkbMapConfigList :     XkbMapConfigList XkbMapConfig
index 8be29cb..82e74ca 100644 (file)
@@ -850,8 +850,6 @@ FreeXKBFile(XkbFile *file)
         switch (file->type)
         {
         case XkmKeymapFile:
-        case XkmSemanticsFile:
-        case XkmLayoutFile:
             FreeXKBFile((XkbFile *)file->defs);
             break;
         case XkmTypesIndex:
index e10d3cf..f45ab6b 100644 (file)
@@ -146,10 +146,6 @@ XkbDirectoryForInclude(unsigned type)
 {
     switch (type)
     {
-    case XkmSemanticsFile:
-        return "semantics";
-    case XkmLayoutFile:
-        return "layout";
     case XkmKeymapFile:
         return "keymap";
     case XkmKeyNamesIndex:
@@ -176,7 +172,7 @@ XkbDirectoryForInclude(unsigned type)
  *
  * @param ctx the XKB ctx containing the include paths
  * @param type one of XkbTypesIndex, XkbCompatMapIndex, ..., or
- *             XkbSemanticsFile, XkmKeymapFile, ...
+ *             XkmKeymapFile
  * @param pathReturn is set to the full path of the file if found.
  *
  * @return an FD to the file or NULL. If NULL is returned, the value of
index bf08b01..a18451f 100644 (file)
@@ -199,15 +199,7 @@ compile_keymap(struct xkb_ctx *ctx, XkbFile *file)
 
     /* Find map to use */
     mapToUse = XkbChooseMap(file, NULL);
-    if (!mapToUse)
-        goto err;
-
-    switch (mapToUse->type) {
-    case XkmSemanticsFile:
-    case XkmLayoutFile:
-    case XkmKeymapFile:
-        break;
-    default:
+    if (!mapToUse || mapToUse->type != XkmKeymapFile) {
         ERROR("file type %d not handled\n", mapToUse->type);
         goto err;
     }