- XkbFile *keycodes, *types, *compat, *symbols;
- IncludeStmt *inc;
-
- inc = IncludeCreate(ktcsg->keycodes, MERGE_DEFAULT);
- keycodes = CreateXKBFile(ctx, FILE_TYPE_KEYCODES, NULL,
- (ParseCommon *) inc, 0);
-
- inc = IncludeCreate(ktcsg->types, MERGE_DEFAULT);
- types = CreateXKBFile(ctx, FILE_TYPE_TYPES, NULL,
- (ParseCommon *) inc, 0);
- AppendStmt(&keycodes->common, &types->common);
-
- inc = IncludeCreate(ktcsg->compat, MERGE_DEFAULT);
- compat = CreateXKBFile(ctx, FILE_TYPE_COMPAT, NULL,
- (ParseCommon *) inc, 0);
- AppendStmt(&keycodes->common, &compat->common);
-
- inc = IncludeCreate(ktcsg->symbols, MERGE_DEFAULT);
- symbols = CreateXKBFile(ctx, FILE_TYPE_SYMBOLS, NULL,
- (ParseCommon *) inc, 0);
- AppendStmt(&keycodes->common, &symbols->common);
-
- return CreateXKBFile(ctx, FILE_TYPE_KEYMAP, strdup(""),
- &keycodes->common, 0);
-}
-
-/**
- * Compile the given file and store the output in keymap.
- * @param file A list of XkbFiles, each denoting one type (e.g.
- * FILE_TYPE_KEYCODES, etc.)
- */
-static struct xkb_keymap *
-compile_keymap(struct xkb_context *ctx, XkbFile *file)
-{
- bool ok;
- unsigned have = 0;
- const char *main_name;
- struct xkb_keymap *keymap;
- XkbFile *keycodes = NULL;
- XkbFile *types = NULL;
- XkbFile *compat = NULL;
- XkbFile *symbols = NULL;
-
- keymap = XkbcAllocKeyboard(ctx);
- if (!keymap)
- goto err;
-
- main_name = file->name ? file->name : "(unnamed)";
-
- /*
- * Other aggregate file types are converted to FILE_TYPE_KEYMAP
- * in the parser.
- */
- if (file->type != FILE_TYPE_KEYMAP) {
- ERROR("Cannot compile a %s file alone into a keymap\n",
- XkbcFileTypeText(file->type));
- goto err;