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;
90 LedInfo leds[XKB_MAX_LEDS];
91 unsigned int num_leds;
93 struct xkb_mod_set mods;
95 struct xkb_context *ctx;
99 siText(SymInterpInfo *si, CompatInfo *info)
101 char *buf = xkb_context_get_buffer(info->ctx, 128);
103 if (si == &info->default_interp)
106 snprintf(buf, 128, "%s+%s(%s)",
107 KeysymText(info->ctx, si->interp.sym),
108 SIMatchText(si->interp.match),
109 ModMaskText(info->ctx, &info->mods, si->interp.mods));
115 ReportSINotArray(CompatInfo *info, SymInterpInfo *si, const char *field)
117 return ReportNotArray(info->ctx, "symbol interpretation", field,
122 ReportSIBadType(CompatInfo *info, SymInterpInfo *si, const char *field,
125 return ReportBadType(info->ctx, "symbol interpretation", field,
126 siText(si, info), wanted);
130 ReportLedBadType(CompatInfo *info, LedInfo *ledi, const char *field,
133 return ReportBadType(info->ctx, "indicator map", field,
134 xkb_atom_text(info->ctx, ledi->led.name),
139 ReportLedNotArray(CompatInfo *info, LedInfo *ledi, const char *field)
141 return ReportNotArray(info->ctx, "indicator map", field,
142 xkb_atom_text(info->ctx, ledi->led.name));
146 InitCompatInfo(CompatInfo *info, struct xkb_context *ctx,
147 ActionsInfo *actions, const struct xkb_mod_set *mods)
149 memset(info, 0, sizeof(*info));
151 info->actions = actions;
153 info->default_interp.merge = MERGE_OVERRIDE;
154 info->default_interp.interp.virtual_mod = XKB_MOD_INVALID;
155 info->default_led.merge = MERGE_OVERRIDE;
159 ClearCompatInfo(CompatInfo *info)
162 darray_free(info->interps);
165 static SymInterpInfo *
166 FindMatchingInterp(CompatInfo *info, SymInterpInfo *new)
170 darray_foreach(old, info->interps)
171 if (old->interp.sym == new->interp.sym &&
172 old->interp.mods == new->interp.mods &&
173 old->interp.match == new->interp.match)
180 UseNewInterpField(enum si_field field, SymInterpInfo *old, SymInterpInfo *new,
181 bool report, enum si_field *collide)
183 if (!(old->defined & field))
186 if (new->defined & field) {
190 if (new->merge != MERGE_AUGMENT)
198 AddInterp(CompatInfo *info, SymInterpInfo *new, bool same_file)
200 SymInterpInfo *old = FindMatchingInterp(info, new);
202 const int verbosity = xkb_context_get_log_verbosity(info->ctx);
203 const bool report = (same_file && verbosity > 0) || verbosity > 9;
204 enum si_field collide = 0;
206 if (new->merge == MERGE_REPLACE) {
209 "Multiple definitions for \"%s\"; "
210 "Earlier interpretation ignored\n",
216 if (UseNewInterpField(SI_FIELD_VIRTUAL_MOD, old, new, report,
218 old->interp.virtual_mod = new->interp.virtual_mod;
219 old->defined |= SI_FIELD_VIRTUAL_MOD;
221 if (UseNewInterpField(SI_FIELD_ACTION, old, new, report,
223 old->interp.action = new->interp.action;
224 old->defined |= SI_FIELD_ACTION;
226 if (UseNewInterpField(SI_FIELD_AUTO_REPEAT, old, new, report,
228 old->interp.repeat = new->interp.repeat;
229 old->defined |= SI_FIELD_AUTO_REPEAT;
231 if (UseNewInterpField(SI_FIELD_LEVEL_ONE_ONLY, old, new, report,
233 old->interp.level_one_only = new->interp.level_one_only;
234 old->defined |= SI_FIELD_LEVEL_ONE_ONLY;
239 "Multiple interpretations of \"%s\"; "
240 "Using %s definition for duplicate fields\n",
242 (new->merge != MERGE_AUGMENT ? "last" : "first"));
248 darray_append(info->interps, *new);
252 /***====================================================================***/
255 ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn,
256 xkb_mod_mask_t *mods_rtrn, CompatInfo *info)
259 *pred_rtrn = MATCH_ANY_OR_NONE;
260 *mods_rtrn = MOD_REAL_MASK_ALL;
264 *pred_rtrn = MATCH_EXACTLY;
265 if (expr->expr.op == EXPR_ACTION_DECL) {
266 const char *pred_txt = xkb_atom_text(info->ctx, expr->action.name);
267 if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn) ||
268 !expr->action.args) {
270 "Illegal modifier predicate \"%s\"; Ignored\n", pred_txt);
273 expr = expr->action.args;
275 else if (expr->expr.op == EXPR_IDENT) {
276 const char *pred_txt = xkb_atom_text(info->ctx, expr->ident.ident);
277 if (pred_txt && istreq(pred_txt, "any")) {
278 *pred_rtrn = MATCH_ANY;
279 *mods_rtrn = MOD_REAL_MASK_ALL;
284 return ExprResolveModMask(info->ctx, expr, MOD_REAL, &info->mods,
288 /***====================================================================***/
291 UseNewLEDField(enum led_field field, LedInfo *old, LedInfo *new,
292 bool report, enum led_field *collide)
294 if (!(old->defined & field))
297 if (new->defined & field) {
301 if (new->merge != MERGE_AUGMENT)
309 AddLedMap(CompatInfo *info, LedInfo *new, bool same_file)
311 enum led_field collide;
312 const int verbosity = xkb_context_get_log_verbosity(info->ctx);
313 const bool report = (same_file && verbosity > 0) || verbosity > 9;
315 for (xkb_led_index_t i = 0; i < info->num_leds; i++) {
316 LedInfo *old = &info->leds[i];
318 if (old->led.name != new->led.name)
321 if (old->led.mods.mods == new->led.mods.mods &&
322 old->led.groups == new->led.groups &&
323 old->led.ctrls == new->led.ctrls &&
324 old->led.which_mods == new->led.which_mods &&
325 old->led.which_groups == new->led.which_groups) {
326 old->defined |= new->defined;
330 if (new->merge == MERGE_REPLACE) {
333 "Map for indicator %s redefined; "
334 "Earlier definition ignored\n",
335 xkb_atom_text(info->ctx, old->led.name));
341 if (UseNewLEDField(LED_FIELD_MODS, old, new, report, &collide)) {
342 old->led.which_mods = new->led.which_mods;
343 old->led.mods = new->led.mods;
344 old->defined |= LED_FIELD_MODS;
346 if (UseNewLEDField(LED_FIELD_GROUPS, old, new, report, &collide)) {
347 old->led.which_groups = new->led.which_groups;
348 old->led.groups = new->led.groups;
349 old->defined |= LED_FIELD_GROUPS;
351 if (UseNewLEDField(LED_FIELD_CTRLS, old, new, report, &collide)) {
352 old->led.ctrls = new->led.ctrls;
353 old->defined |= LED_FIELD_CTRLS;
358 "Map for indicator %s redefined; "
359 "Using %s definition for duplicate fields\n",
360 xkb_atom_text(info->ctx, old->led.name),
361 (new->merge == MERGE_AUGMENT ? "first" : "last"));
367 if (info->num_leds >= XKB_MAX_LEDS) {
369 "Too many LEDs defined (maximum %d)\n",
373 info->leds[info->num_leds++] = *new;
378 MergeIncludedCompatMaps(CompatInfo *into, CompatInfo *from,
379 enum merge_mode merge)
381 if (from->errorCount > 0) {
382 into->errorCount += from->errorCount;
386 into->mods = from->mods;
388 if (into->name == NULL) {
389 into->name = from->name;
393 if (darray_empty(into->interps)) {
394 into->interps = from->interps;
395 darray_init(from->interps);
399 darray_foreach(si, from->interps) {
400 si->merge = (merge == MERGE_DEFAULT ? si->merge : merge);
401 if (!AddInterp(into, si, false))
406 if (into->num_leds == 0) {
407 memcpy(into->leds, from->leds, sizeof(*from->leds) * from->num_leds);
408 into->num_leds = from->num_leds;
412 for (xkb_led_index_t i = 0; i < from->num_leds; i++) {
413 LedInfo *ledi = &from->leds[i];
414 ledi->merge = (merge == MERGE_DEFAULT ? ledi->merge : merge);
415 if (!AddLedMap(into, ledi, false))
422 HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge);
425 HandleIncludeCompatMap(CompatInfo *info, IncludeStmt *include)
429 InitCompatInfo(&included, info->ctx, info->actions, &info->mods);
430 included.name = include->stmt;
431 include->stmt = NULL;
433 for (IncludeStmt *stmt = include; stmt; stmt = stmt->next_incl) {
434 CompatInfo next_incl;
437 file = ProcessIncludeFile(info->ctx, stmt, FILE_TYPE_COMPAT);
439 info->errorCount += 10;
440 ClearCompatInfo(&included);
444 InitCompatInfo(&next_incl, info->ctx, info->actions, &included.mods);
445 next_incl.default_interp = info->default_interp;
446 next_incl.default_interp.merge = stmt->merge;
447 next_incl.default_led = info->default_led;
448 next_incl.default_led.merge = stmt->merge;
450 HandleCompatMapFile(&next_incl, file, MERGE_OVERRIDE);
452 MergeIncludedCompatMaps(&included, &next_incl, stmt->merge);
454 ClearCompatInfo(&next_incl);
458 MergeIncludedCompatMaps(info, &included, include->merge);
459 ClearCompatInfo(&included);
461 return (info->errorCount == 0);
465 SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field,
466 ExprDef *arrayNdx, ExprDef *value)
470 if (istreq(field, "action")) {
472 return ReportSINotArray(info, si, field);
474 if (!HandleActionDef(info->ctx, info->actions, &info->mods,
475 value, &si->interp.action))
478 si->defined |= SI_FIELD_ACTION;
480 else if (istreq(field, "virtualmodifier") ||
481 istreq(field, "virtualmod")) {
483 return ReportSINotArray(info, si, field);
485 if (!ExprResolveMod(info->ctx, value, MOD_VIRT, &info->mods, &ndx))
486 return ReportSIBadType(info, si, field, "virtual modifier");
488 si->interp.virtual_mod = ndx;
489 si->defined |= SI_FIELD_VIRTUAL_MOD;
491 else if (istreq(field, "repeat")) {
495 return ReportSINotArray(info, si, field);
497 if (!ExprResolveBoolean(info->ctx, value, &set))
498 return ReportSIBadType(info, si, field, "boolean");
500 si->interp.repeat = set;
502 si->defined |= SI_FIELD_AUTO_REPEAT;
504 else if (istreq(field, "locking")) {
506 "The \"locking\" field in symbol interpretation is unsupported; "
509 else if (istreq(field, "usemodmap") ||
510 istreq(field, "usemodmapmods")) {
514 return ReportSINotArray(info, si, field);
516 if (!ExprResolveEnum(info->ctx, value, &val, useModMapValueNames))
517 return ReportSIBadType(info, si, field, "level specification");
519 si->interp.level_one_only = val;
520 si->defined |= SI_FIELD_LEVEL_ONE_ONLY;
523 return ReportBadField(info->ctx, "symbol interpretation", field,
531 SetLedMapField(CompatInfo *info, LedInfo *ledi, const char *field,
532 ExprDef *arrayNdx, ExprDef *value)
536 if (istreq(field, "modifiers") || istreq(field, "mods")) {
538 return ReportLedNotArray(info, ledi, field);
540 if (!ExprResolveModMask(info->ctx, value, MOD_BOTH,
541 &info->mods, &ledi->led.mods.mods))
542 return ReportLedBadType(info, ledi, field, "modifier mask");
544 ledi->defined |= LED_FIELD_MODS;
546 else if (istreq(field, "groups")) {
550 return ReportLedNotArray(info, ledi, field);
552 if (!ExprResolveMask(info->ctx, value, &mask, groupMaskNames))
553 return ReportLedBadType(info, ledi, field, "group mask");
555 ledi->led.groups = mask;
556 ledi->defined |= LED_FIELD_GROUPS;
558 else if (istreq(field, "controls") || istreq(field, "ctrls")) {
562 return ReportLedNotArray(info, ledi, field);
564 if (!ExprResolveMask(info->ctx, value, &mask, ctrlMaskNames))
565 return ReportLedBadType(info, ledi, field, "controls mask");
567 ledi->led.ctrls = mask;
568 ledi->defined |= LED_FIELD_CTRLS;
570 else if (istreq(field, "allowexplicit")) {
572 "The \"allowExplicit\" field in indicator statements is unsupported; "
575 else if (istreq(field, "whichmodstate") ||
576 istreq(field, "whichmodifierstate")) {
580 return ReportLedNotArray(info, ledi, field);
582 if (!ExprResolveMask(info->ctx, value, &mask,
583 modComponentMaskNames))
584 return ReportLedBadType(info, ledi, field,
585 "mask of modifier state components");
587 ledi->led.which_mods = mask;
589 else if (istreq(field, "whichgroupstate")) {
593 return ReportLedNotArray(info, ledi, field);
595 if (!ExprResolveMask(info->ctx, value, &mask,
596 groupComponentMaskNames))
597 return ReportLedBadType(info, ledi, field,
598 "mask of group state components");
600 ledi->led.which_groups = mask;
602 else if (istreq(field, "driveskbd") ||
603 istreq(field, "driveskeyboard") ||
604 istreq(field, "leddriveskbd") ||
605 istreq(field, "leddriveskeyboard") ||
606 istreq(field, "indicatordriveskbd") ||
607 istreq(field, "indicatordriveskeyboard")) {
609 "The \"%s\" field in indicator statements is unsupported; "
612 else if (istreq(field, "index")) {
613 /* Users should see this, it might cause unexpected behavior. */
615 "The \"index\" field in indicator statements is unsupported; "
620 "Unknown field %s in map for %s indicator; "
621 "Definition ignored\n",
622 field, xkb_atom_text(info->ctx, ledi->led.name));
630 HandleGlobalVar(CompatInfo *info, VarDef *stmt)
632 const char *elem, *field;
636 if (!ExprResolveLhs(info->ctx, stmt->name, &elem, &field, &ndx))
638 else if (elem && istreq(elem, "interpret"))
639 ret = SetInterpField(info, &info->default_interp, field, ndx,
641 else if (elem && istreq(elem, "indicator"))
642 ret = SetLedMapField(info, &info->default_led, field, ndx,
645 ret = SetActionField(info->ctx, info->actions, &info->mods,
646 elem, field, ndx, stmt->value);
651 HandleInterpBody(CompatInfo *info, VarDef *def, SymInterpInfo *si)
654 const char *elem, *field;
657 for (; def; def = (VarDef *) def->common.next) {
658 if (def->name && def->name->expr.op == EXPR_FIELD_REF) {
660 "Cannot set a global default value from within an interpret statement; "
661 "Move statements to the global file scope\n");
666 ok = ExprResolveLhs(info->ctx, def->name, &elem, &field, &arrayNdx);
670 ok = SetInterpField(info, si, field, arrayNdx, def->value);
677 HandleInterpDef(CompatInfo *info, InterpDef *def, enum merge_mode merge)
679 enum xkb_match_operation pred;
683 if (!ResolveStateAndPredicate(def->match, &pred, &mods, info)) {
685 "Couldn't determine matching modifiers; "
686 "Symbol interpretation ignored\n");
690 si = info->default_interp;
691 si.merge = merge = (def->merge == MERGE_DEFAULT ? merge : def->merge);
692 si.interp.sym = def->sym;
693 si.interp.match = pred;
694 si.interp.mods = mods;
696 if (!HandleInterpBody(info, def->def, &si)) {
701 if (!AddInterp(info, &si, true)) {
710 HandleLedMapDef(CompatInfo *info, LedMapDef *def, enum merge_mode merge)
716 if (def->merge != MERGE_DEFAULT)
719 ledi = info->default_led;
721 ledi.led.name = def->name;
724 for (var = def->body; var != NULL; var = (VarDef *) var->common.next) {
725 const char *elem, *field;
727 if (!ExprResolveLhs(info->ctx, var->name, &elem, &field, &arrayNdx)) {
734 "Cannot set defaults for \"%s\" element in indicator map; "
735 "Assignment to %s.%s ignored\n", elem, elem, field);
739 ok = SetLedMapField(info, &ledi, field, arrayNdx, var->value) && ok;
744 return AddLedMap(info, &ledi, true);
750 HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge)
754 merge = (merge == MERGE_DEFAULT ? MERGE_AUGMENT : merge);
757 info->name = strdup_safe(file->name);
759 for (ParseCommon *stmt = file->defs; stmt; stmt = stmt->next) {
760 switch (stmt->type) {
762 ok = HandleIncludeCompatMap(info, (IncludeStmt *) stmt);
765 ok = HandleInterpDef(info, (InterpDef *) stmt, merge);
767 case STMT_GROUP_COMPAT:
769 "The \"group\" statement in compat is unsupported; "
774 ok = HandleLedMapDef(info, (LedMapDef *) stmt, merge);
777 ok = HandleGlobalVar(info, (VarDef *) stmt);
780 ok = HandleVModDef(info->ctx, &info->mods, (VModDef *) stmt, merge);
784 "Compat files may not include other types; "
785 "Ignoring %s\n", stmt_type_to_string(stmt->type));
793 if (info->errorCount > 10) {
795 "Abandoning compatibility map \"%s\"\n", file->name);
801 /* Temporary struct for CopyInterps. */
803 darray(struct xkb_sym_interpret) sym_interprets;
807 CopyInterps(CompatInfo *info, bool needSymbol, enum xkb_match_operation pred,
808 struct collect *collect)
812 darray_foreach(si, info->interps)
813 if (si->interp.match == pred &&
814 (si->interp.sym != XKB_KEY_NoSymbol) == needSymbol)
815 darray_append(collect->sym_interprets, si->interp);
819 CopyLedMapDefsToKeymap(struct xkb_keymap *keymap, CompatInfo *info)
821 for (xkb_led_index_t idx = 0; idx < info->num_leds; idx++) {
822 LedInfo *ledi = &info->leds[idx];
827 * Find the LED with the given name, if it was already declared
830 xkb_leds_enumerate(i, led, keymap)
831 if (led->name == ledi->led.name)
834 /* Not previously declared; create it with next free index. */
835 if (i >= keymap->num_leds) {
837 "Indicator name \"%s\" was not declared in the keycodes section; "
838 "Adding new indicator\n",
839 xkb_atom_text(keymap->ctx, ledi->led.name));
841 xkb_leds_enumerate(i, led, keymap)
842 if (led->name == XKB_ATOM_NONE)
845 if (i >= keymap->num_leds) {
846 /* Not place to put it; ignore. */
847 if (i >= XKB_MAX_LEDS) {
849 "Too many indicators (maximum is %d); "
850 "Indicator name \"%s\" ignored\n",
852 xkb_atom_text(keymap->ctx, ledi->led.name));
857 led = &keymap->leds[keymap->num_leds++];
862 if (led->groups != 0 && led->which_groups == 0)
863 led->which_groups = XKB_STATE_LAYOUT_EFFECTIVE;
864 if (led->mods.mods != 0 && led->which_mods == 0)
865 led->which_mods = XKB_STATE_MODS_EFFECTIVE;
870 CopyCompatToKeymap(struct xkb_keymap *keymap, CompatInfo *info)
872 keymap->compat_section_name = strdup_safe(info->name);
873 XkbEscapeMapName(keymap->compat_section_name);
875 keymap->mods = info->mods;
877 if (!darray_empty(info->interps)) {
878 struct collect collect;
879 darray_init(collect.sym_interprets);
881 /* Most specific to least specific. */
882 CopyInterps(info, true, MATCH_EXACTLY, &collect);
883 CopyInterps(info, true, MATCH_ALL, &collect);
884 CopyInterps(info, true, MATCH_NONE, &collect);
885 CopyInterps(info, true, MATCH_ANY, &collect);
886 CopyInterps(info, true, MATCH_ANY_OR_NONE, &collect);
887 CopyInterps(info, false, MATCH_EXACTLY, &collect);
888 CopyInterps(info, false, MATCH_ALL, &collect);
889 CopyInterps(info, false, MATCH_NONE, &collect);
890 CopyInterps(info, false, MATCH_ANY, &collect);
891 CopyInterps(info, false, MATCH_ANY_OR_NONE, &collect);
893 darray_steal(collect.sym_interprets,
894 &keymap->sym_interprets, &keymap->num_sym_interprets);
897 CopyLedMapDefsToKeymap(keymap, info);
903 CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap,
904 enum merge_mode merge)
907 ActionsInfo *actions;
909 actions = NewActionsInfo();
913 InitCompatInfo(&info, keymap->ctx, actions, &keymap->mods);
914 info.default_interp.merge = merge;
915 info.default_led.merge = merge;
917 HandleCompatMapFile(&info, file, merge);
918 if (info.errorCount != 0)
921 if (!CopyCompatToKeymap(keymap, &info))
924 ClearCompatInfo(&info);
925 FreeActionsInfo(actions);
929 ClearCompatInfo(&info);
930 FreeActionsInfo(actions);