1 /************************************************************
2 * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
4 * Permission to use, copy, modify, and distribute this
5 * software and its documentation for any purpose and without
6 * fee is hereby granted, provided that the above copyright
7 * notice appear in all copies and that both that copyright
8 * notice and this permission notice appear in supporting
9 * documentation, and that the name of Silicon Graphics not be
10 * used in advertising or publicity pertaining to distribution
11 * of the software without specific prior written permission.
12 * Silicon Graphics makes no representation about the suitability
13 * of this software for any purpose. It is provided "as is"
14 * without any express or implied warranty.
16 * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18 * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19 * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
23 * THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 ********************************************************/
28 * Copyright © 2012 Ran Benita <ran234@gmail.com>
30 * Permission is hereby granted, free of charge, to any person obtaining a
31 * copy of this software and associated documentation files (the "Software"),
32 * to deal in the Software without restriction, including without limitation
33 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
34 * and/or sell copies of the Software, and to permit persons to whom the
35 * Software is furnished to do so, subject to the following conditions:
37 * The above copyright notice and this permission notice (including the next
38 * paragraph) shall be included in all copies or substantial portions of the
41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
44 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
46 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
47 * DEALINGS IN THE SOFTWARE.
50 #include "xkbcomp-priv.h"
58 SI_FIELD_VIRTUAL_MOD = (1 << 0),
59 SI_FIELD_ACTION = (1 << 1),
60 SI_FIELD_AUTO_REPEAT = (1 << 2),
61 SI_FIELD_LEVEL_ONE_ONLY = (1 << 3),
65 enum si_field defined;
66 enum merge_mode merge;
68 struct xkb_sym_interpret interp;
72 LED_FIELD_MODS = (1 << 0),
73 LED_FIELD_GROUPS = (1 << 1),
74 LED_FIELD_CTRLS = (1 << 2),
78 enum led_field defined;
79 enum merge_mode merge;
87 SymInterpInfo default_interp;
88 darray(SymInterpInfo) interps;
92 struct xkb_keymap *keymap;
96 siText(SymInterpInfo *si, CompatInfo *info)
98 char *buf = xkb_context_get_buffer(info->keymap->ctx, 128);
100 if (si == &info->default_interp)
103 snprintf(buf, 128, "%s+%s(%s)",
104 KeysymText(info->keymap->ctx, si->interp.sym),
105 SIMatchText(si->interp.match),
106 ModMaskText(info->keymap, si->interp.mods));
112 ReportSINotArray(CompatInfo *info, SymInterpInfo *si, const char *field)
114 return ReportNotArray(info->keymap->ctx, "symbol interpretation", field,
119 ReportSIBadType(CompatInfo *info, SymInterpInfo *si, const char *field,
122 return ReportBadType(info->keymap->ctx, "symbol interpretation", field,
123 siText(si, info), wanted);
127 ReportLedBadType(CompatInfo *info, LedInfo *ledi, const char *field,
130 return ReportBadType(info->keymap->ctx, "indicator map", field,
131 xkb_atom_text(info->keymap->ctx, ledi->led.name),
136 ReportLedNotArray(CompatInfo *info, LedInfo *ledi, const char *field)
138 return ReportNotArray(info->keymap->ctx, "indicator map", field,
139 xkb_atom_text(info->keymap->ctx, ledi->led.name));
143 InitCompatInfo(CompatInfo *info, struct xkb_keymap *keymap,
144 ActionsInfo *actions)
146 memset(info, 0, sizeof(*info));
147 info->keymap = keymap;
148 info->actions = actions;
149 info->default_interp.merge = MERGE_OVERRIDE;
150 info->default_interp.interp.virtual_mod = XKB_MOD_INVALID;
151 info->default_led.merge = MERGE_OVERRIDE;
155 ClearCompatInfo(CompatInfo *info)
158 darray_free(info->interps);
159 darray_free(info->leds);
162 static SymInterpInfo *
163 FindMatchingInterp(CompatInfo *info, SymInterpInfo *new)
167 darray_foreach(old, info->interps)
168 if (old->interp.sym == new->interp.sym &&
169 old->interp.mods == new->interp.mods &&
170 old->interp.match == new->interp.match)
177 UseNewInterpField(enum si_field field, SymInterpInfo *old, SymInterpInfo *new,
178 bool report, enum si_field *collide)
180 if (!(old->defined & field))
183 if (new->defined & field) {
187 if (new->merge != MERGE_AUGMENT)
195 AddInterp(CompatInfo *info, SymInterpInfo *new, bool same_file)
197 SymInterpInfo *old = FindMatchingInterp(info, new);
199 const int verbosity = xkb_context_get_log_verbosity(info->keymap->ctx);
200 const bool report = (same_file && verbosity > 0) || verbosity > 9;
201 enum si_field collide = 0;
203 if (new->merge == MERGE_REPLACE) {
205 log_warn(info->keymap->ctx,
206 "Multiple definitions for \"%s\"; "
207 "Earlier interpretation ignored\n",
213 if (UseNewInterpField(SI_FIELD_VIRTUAL_MOD, old, new, report,
215 old->interp.virtual_mod = new->interp.virtual_mod;
216 old->defined |= SI_FIELD_VIRTUAL_MOD;
218 if (UseNewInterpField(SI_FIELD_ACTION, old, new, report,
220 old->interp.action = new->interp.action;
221 old->defined |= SI_FIELD_ACTION;
223 if (UseNewInterpField(SI_FIELD_AUTO_REPEAT, old, new, report,
225 old->interp.repeat = new->interp.repeat;
226 old->defined |= SI_FIELD_AUTO_REPEAT;
228 if (UseNewInterpField(SI_FIELD_LEVEL_ONE_ONLY, old, new, report,
230 old->interp.level_one_only = new->interp.level_one_only;
231 old->defined |= SI_FIELD_LEVEL_ONE_ONLY;
235 log_warn(info->keymap->ctx,
236 "Multiple interpretations of \"%s\"; "
237 "Using %s definition for duplicate fields\n",
239 (new->merge != MERGE_AUGMENT ? "last" : "first"));
245 darray_append(info->interps, *new);
249 /***====================================================================***/
252 ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn,
253 xkb_mod_mask_t *mods_rtrn, CompatInfo *info)
256 *pred_rtrn = MATCH_ANY_OR_NONE;
257 *mods_rtrn = MOD_REAL_MASK_ALL;
261 *pred_rtrn = MATCH_EXACTLY;
262 if (expr->expr.op == EXPR_ACTION_DECL) {
263 const char *pred_txt = xkb_atom_text(info->keymap->ctx,
265 if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn)) {
266 log_err(info->keymap->ctx,
267 "Illegal modifier predicate \"%s\"; Ignored\n", pred_txt);
270 expr = expr->action.args;
272 else if (expr->expr.op == EXPR_IDENT) {
273 const char *pred_txt = xkb_atom_text(info->keymap->ctx,
275 if (pred_txt && istreq(pred_txt, "any")) {
276 *pred_rtrn = MATCH_ANY;
277 *mods_rtrn = MOD_REAL_MASK_ALL;
282 return ExprResolveModMask(info->keymap, expr, MOD_REAL, mods_rtrn);
285 /***====================================================================***/
288 UseNewLEDField(enum led_field field, LedInfo *old, LedInfo *new,
289 bool report, enum led_field *collide)
291 if (!(old->defined & field))
294 if (new->defined & field) {
298 if (new->merge != MERGE_AUGMENT)
306 AddLedMap(CompatInfo *info, LedInfo *new, bool same_file)
309 enum led_field collide;
310 struct xkb_context *ctx = info->keymap->ctx;
311 const int verbosity = xkb_context_get_log_verbosity(ctx);
312 const bool report = (same_file && verbosity > 0) || verbosity > 9;
314 darray_foreach(old, info->leds) {
315 if (old->led.name != new->led.name)
318 if (old->led.mods.mods == new->led.mods.mods &&
319 old->led.groups == new->led.groups &&
320 old->led.ctrls == new->led.ctrls &&
321 old->led.which_mods == new->led.which_mods &&
322 old->led.which_groups == new->led.which_groups) {
323 old->defined |= new->defined;
327 if (new->merge == MERGE_REPLACE) {
329 log_warn(info->keymap->ctx,
330 "Map for indicator %s redefined; "
331 "Earlier definition ignored\n",
332 xkb_atom_text(ctx, old->led.name));
338 if (UseNewLEDField(LED_FIELD_MODS, old, new, report, &collide)) {
339 old->led.which_mods = new->led.which_mods;
340 old->led.mods = new->led.mods;
341 old->defined |= LED_FIELD_MODS;
343 if (UseNewLEDField(LED_FIELD_GROUPS, old, new, report, &collide)) {
344 old->led.which_groups = new->led.which_groups;
345 old->led.groups = new->led.groups;
346 old->defined |= LED_FIELD_GROUPS;
348 if (UseNewLEDField(LED_FIELD_CTRLS, old, new, report, &collide)) {
349 old->led.ctrls = new->led.ctrls;
350 old->defined |= LED_FIELD_CTRLS;
354 log_warn(info->keymap->ctx,
355 "Map for indicator %s redefined; "
356 "Using %s definition for duplicate fields\n",
357 xkb_atom_text(ctx, old->led.name),
358 (new->merge == MERGE_AUGMENT ? "first" : "last"));
364 darray_append(info->leds, *new);
369 MergeIncludedCompatMaps(CompatInfo *into, CompatInfo *from,
370 enum merge_mode merge)
375 if (from->errorCount > 0) {
376 into->errorCount += from->errorCount;
380 if (into->name == NULL) {
381 into->name = from->name;
385 darray_foreach(si, from->interps) {
386 si->merge = (merge == MERGE_DEFAULT ? si->merge : merge);
387 if (!AddInterp(into, si, false))
391 darray_foreach(ledi, from->leds) {
392 ledi->merge = (merge == MERGE_DEFAULT ? ledi->merge : merge);
393 if (!AddLedMap(into, ledi, false))
399 HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge);
402 HandleIncludeCompatMap(CompatInfo *info, IncludeStmt *include)
406 InitCompatInfo(&included, info->keymap, info->actions);
407 included.name = include->stmt;
408 include->stmt = NULL;
410 for (IncludeStmt *stmt = include; stmt; stmt = stmt->next_incl) {
411 CompatInfo next_incl;
414 file = ProcessIncludeFile(info->keymap->ctx, stmt, FILE_TYPE_COMPAT);
416 info->errorCount += 10;
417 ClearCompatInfo(&included);
421 InitCompatInfo(&next_incl, info->keymap, info->actions);
422 next_incl.default_interp = info->default_interp;
423 next_incl.default_interp.merge = stmt->merge;
424 next_incl.default_led = info->default_led;
425 next_incl.default_led.merge = stmt->merge;
427 HandleCompatMapFile(&next_incl, file, MERGE_OVERRIDE);
429 MergeIncludedCompatMaps(&included, &next_incl, stmt->merge);
431 ClearCompatInfo(&next_incl);
435 MergeIncludedCompatMaps(info, &included, include->merge);
436 ClearCompatInfo(&included);
438 return (info->errorCount == 0);
442 SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field,
443 ExprDef *arrayNdx, ExprDef *value)
445 struct xkb_keymap *keymap = info->keymap;
448 if (istreq(field, "action")) {
450 return ReportSINotArray(info, si, field);
452 if (!HandleActionDef(value, keymap, &si->interp.action, info->actions))
455 si->defined |= SI_FIELD_ACTION;
457 else if (istreq(field, "virtualmodifier") ||
458 istreq(field, "virtualmod")) {
460 return ReportSINotArray(info, si, field);
462 if (!ExprResolveMod(keymap, value, MOD_VIRT, &ndx))
463 return ReportSIBadType(info, si, field, "virtual modifier");
465 si->interp.virtual_mod = ndx;
466 si->defined |= SI_FIELD_VIRTUAL_MOD;
468 else if (istreq(field, "repeat")) {
472 return ReportSINotArray(info, si, field);
474 if (!ExprResolveBoolean(keymap->ctx, value, &set))
475 return ReportSIBadType(info, si, field, "boolean");
477 si->interp.repeat = set;
479 si->defined |= SI_FIELD_AUTO_REPEAT;
481 else if (istreq(field, "locking")) {
482 log_dbg(info->keymap->ctx,
483 "The \"locking\" field in symbol interpretation is unsupported; "
486 else if (istreq(field, "usemodmap") ||
487 istreq(field, "usemodmapmods")) {
491 return ReportSINotArray(info, si, field);
493 if (!ExprResolveEnum(keymap->ctx, value, &val, useModMapValueNames))
494 return ReportSIBadType(info, si, field, "level specification");
496 si->interp.level_one_only = !!val;
497 si->defined |= SI_FIELD_LEVEL_ONE_ONLY;
500 return ReportBadField(keymap->ctx, "symbol interpretation", field,
508 SetLedMapField(CompatInfo *info, LedInfo *ledi, const char *field,
509 ExprDef *arrayNdx, ExprDef *value)
512 struct xkb_keymap *keymap = info->keymap;
514 if (istreq(field, "modifiers") || istreq(field, "mods")) {
516 return ReportLedNotArray(info, ledi, field);
518 if (!ExprResolveModMask(keymap, value, MOD_BOTH, &ledi->led.mods.mods))
519 return ReportLedBadType(info, ledi, field, "modifier mask");
521 ledi->defined |= LED_FIELD_MODS;
523 else if (istreq(field, "groups")) {
527 return ReportLedNotArray(info, ledi, field);
529 if (!ExprResolveMask(keymap->ctx, value, &mask, groupMaskNames))
530 return ReportLedBadType(info, ledi, field, "group mask");
532 ledi->led.groups = mask;
533 ledi->defined |= LED_FIELD_GROUPS;
535 else if (istreq(field, "controls") || istreq(field, "ctrls")) {
539 return ReportLedNotArray(info, ledi, field);
541 if (!ExprResolveMask(keymap->ctx, value, &mask, ctrlMaskNames))
542 return ReportLedBadType(info, ledi, field, "controls mask");
544 ledi->led.ctrls = mask;
545 ledi->defined |= LED_FIELD_CTRLS;
547 else if (istreq(field, "allowexplicit")) {
548 log_dbg(info->keymap->ctx,
549 "The \"allowExplicit\" field in indicator statements is unsupported; "
552 else if (istreq(field, "whichmodstate") ||
553 istreq(field, "whichmodifierstate")) {
557 return ReportLedNotArray(info, ledi, field);
559 if (!ExprResolveMask(keymap->ctx, value, &mask,
560 modComponentMaskNames))
561 return ReportLedBadType(info, ledi, field,
562 "mask of modifier state components");
564 ledi->led.which_mods = mask;
566 else if (istreq(field, "whichgroupstate")) {
570 return ReportLedNotArray(info, ledi, field);
572 if (!ExprResolveMask(keymap->ctx, value, &mask,
573 groupComponentMaskNames))
574 return ReportLedBadType(info, ledi, field,
575 "mask of group state components");
577 ledi->led.which_groups = mask;
579 else if (istreq(field, "driveskbd") ||
580 istreq(field, "driveskeyboard") ||
581 istreq(field, "leddriveskbd") ||
582 istreq(field, "leddriveskeyboard") ||
583 istreq(field, "indicatordriveskbd") ||
584 istreq(field, "indicatordriveskeyboard")) {
585 log_dbg(info->keymap->ctx,
586 "The \"%s\" field in indicator statements is unsupported; "
589 else if (istreq(field, "index")) {
590 /* Users should see this, it might cause unexpected behavior. */
591 log_err(info->keymap->ctx,
592 "The \"index\" field in indicator statements is unsupported; "
596 log_err(info->keymap->ctx,
597 "Unknown field %s in map for %s indicator; "
598 "Definition ignored\n",
599 field, xkb_atom_text(keymap->ctx, ledi->led.name));
607 HandleGlobalVar(CompatInfo *info, VarDef *stmt)
609 const char *elem, *field;
613 if (!ExprResolveLhs(info->keymap->ctx, stmt->name, &elem, &field, &ndx))
615 else if (elem && istreq(elem, "interpret"))
616 ret = SetInterpField(info, &info->default_interp, field, ndx,
618 else if (elem && istreq(elem, "indicator"))
619 ret = SetLedMapField(info, &info->default_led, field, ndx,
622 ret = SetActionField(info->keymap, elem, field, ndx, stmt->value,
628 HandleInterpBody(CompatInfo *info, VarDef *def, SymInterpInfo *si)
631 const char *elem, *field;
634 for (; def; def = (VarDef *) def->common.next) {
635 if (def->name && def->name->expr.op == EXPR_FIELD_REF) {
636 log_err(info->keymap->ctx,
637 "Cannot set a global default value from within an interpret statement; "
638 "Move statements to the global file scope\n");
643 ok = ExprResolveLhs(info->keymap->ctx, def->name, &elem, &field,
648 ok = SetInterpField(info, si, field, arrayNdx, def->value);
655 HandleInterpDef(CompatInfo *info, InterpDef *def, enum merge_mode merge)
657 enum xkb_match_operation pred;
661 if (!ResolveStateAndPredicate(def->match, &pred, &mods, info)) {
662 log_err(info->keymap->ctx,
663 "Couldn't determine matching modifiers; "
664 "Symbol interpretation ignored\n");
668 si = info->default_interp;
669 si.merge = merge = (def->merge == MERGE_DEFAULT ? merge : def->merge);
670 si.interp.sym = def->sym;
671 si.interp.match = pred;
672 si.interp.mods = mods;
674 if (!HandleInterpBody(info, def->def, &si)) {
679 if (!AddInterp(info, &si, true)) {
688 HandleLedMapDef(CompatInfo *info, LedMapDef *def, enum merge_mode merge)
694 if (def->merge != MERGE_DEFAULT)
697 ledi = info->default_led;
699 ledi.led.name = def->name;
702 for (var = def->body; var != NULL; var = (VarDef *) var->common.next) {
703 const char *elem, *field;
705 if (!ExprResolveLhs(info->keymap->ctx, var->name, &elem, &field,
712 log_err(info->keymap->ctx,
713 "Cannot set defaults for \"%s\" element in indicator map; "
714 "Assignment to %s.%s ignored\n", elem, elem, field);
718 ok = SetLedMapField(info, &ledi, field, arrayNdx, var->value) && ok;
723 return AddLedMap(info, &ledi, true);
729 HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge)
733 merge = (merge == MERGE_DEFAULT ? MERGE_AUGMENT : merge);
736 info->name = strdup_safe(file->name);
738 for (ParseCommon *stmt = file->defs; stmt; stmt = stmt->next) {
739 switch (stmt->type) {
741 ok = HandleIncludeCompatMap(info, (IncludeStmt *) stmt);
744 ok = HandleInterpDef(info, (InterpDef *) stmt, merge);
746 case STMT_GROUP_COMPAT:
747 log_dbg(info->keymap->ctx,
748 "The \"group\" statement in compat is unsupported; "
753 ok = HandleLedMapDef(info, (LedMapDef *) stmt, merge);
756 ok = HandleGlobalVar(info, (VarDef *) stmt);
759 ok = HandleVModDef(info->keymap, (VModDef *) stmt);
762 log_err(info->keymap->ctx,
763 "Compat files may not include other types; "
764 "Ignoring %s\n", stmt_type_to_string(stmt->type));
772 if (info->errorCount > 10) {
773 log_err(info->keymap->ctx,
774 "Abandoning compatibility map \"%s\"\n", file->topName);
780 /* Temporary struct for CopyInterps. */
782 darray(struct xkb_sym_interpret) sym_interprets;
786 CopyInterps(CompatInfo *info, bool needSymbol, enum xkb_match_operation pred,
787 struct collect *collect)
791 darray_foreach(si, info->interps)
792 if (si->interp.match == pred &&
793 (si->interp.sym != XKB_KEY_NoSymbol) == needSymbol)
794 darray_append(collect->sym_interprets, si->interp);
798 CopyLedMapDefs(CompatInfo *info)
803 struct xkb_keymap *keymap = info->keymap;
805 darray_foreach(ledi, info->leds) {
807 * Find the LED with the given name, if it was already declared
810 darray_enumerate(i, led, keymap->leds)
811 if (led->name == ledi->led.name)
814 /* Not previously declared; create it with next free index. */
815 if (i >= darray_size(keymap->leds)) {
817 "Indicator name \"%s\" was not declared in the keycodes section; "
818 "Adding new indicator\n",
819 xkb_atom_text(keymap->ctx, ledi->led.name));
821 darray_enumerate(i, led, keymap->leds)
822 if (led->name == XKB_ATOM_NONE)
825 if (i >= darray_size(keymap->leds)) {
826 /* Not place to put it; ignore. */
827 if (i >= XKB_MAX_LEDS) {
829 "Too many indicators (maximum is %d); "
830 "Indicator name \"%s\" ignored\n",
832 xkb_atom_text(keymap->ctx, ledi->led.name));
836 darray_resize(keymap->leds, i + 1);
837 led = &darray_item(keymap->leds, i);
842 if (led->groups != 0 && led->which_groups == 0)
843 led->which_groups = XKB_STATE_LAYOUT_EFFECTIVE;
844 if (led->mods.mods != 0 && led->which_mods == 0)
845 led->which_mods = XKB_STATE_MODS_EFFECTIVE;
850 CopyCompatToKeymap(struct xkb_keymap *keymap, CompatInfo *info)
852 keymap->compat_section_name = strdup_safe(info->name);
853 XkbEscapeMapName(keymap->compat_section_name);
855 if (!darray_empty(info->interps)) {
856 struct collect collect;
857 darray_init(collect.sym_interprets);
859 /* Most specific to least specific. */
860 CopyInterps(info, true, MATCH_EXACTLY, &collect);
861 CopyInterps(info, true, MATCH_ALL, &collect);
862 CopyInterps(info, true, MATCH_NONE, &collect);
863 CopyInterps(info, true, MATCH_ANY, &collect);
864 CopyInterps(info, true, MATCH_ANY_OR_NONE, &collect);
865 CopyInterps(info, false, MATCH_EXACTLY, &collect);
866 CopyInterps(info, false, MATCH_ALL, &collect);
867 CopyInterps(info, false, MATCH_NONE, &collect);
868 CopyInterps(info, false, MATCH_ANY, &collect);
869 CopyInterps(info, false, MATCH_ANY_OR_NONE, &collect);
871 keymap->num_sym_interprets = darray_size(collect.sym_interprets);
872 keymap->sym_interprets = darray_mem(collect.sym_interprets, 0);
875 CopyLedMapDefs(info);
881 CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap,
882 enum merge_mode merge)
885 ActionsInfo *actions;
887 actions = NewActionsInfo();
891 InitCompatInfo(&info, keymap, actions);
892 info.default_interp.merge = merge;
893 info.default_led.merge = merge;
895 HandleCompatMapFile(&info, file, merge);
896 if (info.errorCount != 0)
899 if (!CopyCompatToKeymap(keymap, &info))
902 ClearCompatInfo(&info);
903 FreeActionsInfo(actions);
907 ClearCompatInfo(&info);
908 FreeActionsInfo(actions);