• Home
  • Raw
  • Download

Lines Matching full:info

99 siText(SymInterpInfo *si, CompatInfo *info)  in siText()  argument
101 char *buf = xkb_context_get_buffer(info->ctx, 128); in siText()
103 if (si == &info->default_interp) in siText()
107 KeysymText(info->ctx, si->interp.sym), in siText()
109 ModMaskText(info->ctx, &info->mods, si->interp.mods)); in siText()
115 ReportSINotArray(CompatInfo *info, SymInterpInfo *si, const char *field) in ReportSINotArray() argument
117 return ReportNotArray(info->ctx, "symbol interpretation", field, in ReportSINotArray()
118 siText(si, info)); in ReportSINotArray()
122 ReportSIBadType(CompatInfo *info, SymInterpInfo *si, const char *field, in ReportSIBadType() argument
125 return ReportBadType(info->ctx, "symbol interpretation", field, in ReportSIBadType()
126 siText(si, info), wanted); in ReportSIBadType()
130 ReportLedBadType(CompatInfo *info, LedInfo *ledi, const char *field, in ReportLedBadType() argument
133 return ReportBadType(info->ctx, "indicator map", field, in ReportLedBadType()
134 xkb_atom_text(info->ctx, ledi->led.name), in ReportLedBadType()
139 ReportLedNotArray(CompatInfo *info, LedInfo *ledi, const char *field) in ReportLedNotArray() argument
141 return ReportNotArray(info->ctx, "indicator map", field, in ReportLedNotArray()
142 xkb_atom_text(info->ctx, ledi->led.name)); in ReportLedNotArray()
146 InitCompatInfo(CompatInfo *info, struct xkb_context *ctx, in InitCompatInfo() argument
149 memset(info, 0, sizeof(*info)); in InitCompatInfo()
150 info->ctx = ctx; in InitCompatInfo()
151 info->actions = actions; in InitCompatInfo()
152 info->mods = *mods; in InitCompatInfo()
153 info->default_interp.merge = MERGE_OVERRIDE; in InitCompatInfo()
154 info->default_interp.interp.virtual_mod = XKB_MOD_INVALID; in InitCompatInfo()
155 info->default_led.merge = MERGE_OVERRIDE; in InitCompatInfo()
159 ClearCompatInfo(CompatInfo *info) in ClearCompatInfo() argument
161 free(info->name); in ClearCompatInfo()
162 darray_free(info->interps); in ClearCompatInfo()
166 FindMatchingInterp(CompatInfo *info, SymInterpInfo *new) in FindMatchingInterp() argument
170 darray_foreach(old, info->interps) in FindMatchingInterp()
198 AddInterp(CompatInfo *info, SymInterpInfo *new, bool same_file) in AddInterp() argument
200 SymInterpInfo *old = FindMatchingInterp(info, new); in AddInterp()
202 const int verbosity = xkb_context_get_log_verbosity(info->ctx); in AddInterp()
208 log_warn(info->ctx, in AddInterp()
211 siText(new, info)); in AddInterp()
238 log_warn(info->ctx, in AddInterp()
241 siText(new, info), in AddInterp()
248 darray_append(info->interps, *new); in AddInterp()
256 xkb_mod_mask_t *mods_rtrn, CompatInfo *info) in ResolveStateAndPredicate() argument
266 const char *pred_txt = xkb_atom_text(info->ctx, expr->action.name); in ResolveStateAndPredicate()
268 log_err(info->ctx, in ResolveStateAndPredicate()
275 const char *pred_txt = xkb_atom_text(info->ctx, expr->ident.ident); in ResolveStateAndPredicate()
283 return ExprResolveModMask(info->ctx, expr, MOD_REAL, &info->mods, in ResolveStateAndPredicate()
308 AddLedMap(CompatInfo *info, LedInfo *new, bool same_file) in AddLedMap() argument
311 const int verbosity = xkb_context_get_log_verbosity(info->ctx); in AddLedMap()
314 for (xkb_led_index_t i = 0; i < info->num_leds; i++) { in AddLedMap()
315 LedInfo *old = &info->leds[i]; in AddLedMap()
331 log_warn(info->ctx, in AddLedMap()
334 xkb_atom_text(info->ctx, old->led.name)); in AddLedMap()
356 log_warn(info->ctx, in AddLedMap()
359 xkb_atom_text(info->ctx, old->led.name), in AddLedMap()
366 if (info->num_leds >= XKB_MAX_LEDS) { in AddLedMap()
367 log_err(info->ctx, in AddLedMap()
372 info->leds[info->num_leds++] = *new; in AddLedMap()
422 HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge);
425 HandleIncludeCompatMap(CompatInfo *info, IncludeStmt *include) in HandleIncludeCompatMap() argument
429 InitCompatInfo(&included, info->ctx, info->actions, &info->mods); in HandleIncludeCompatMap()
437 file = ProcessIncludeFile(info->ctx, stmt, FILE_TYPE_COMPAT); in HandleIncludeCompatMap()
439 info->errorCount += 10; in HandleIncludeCompatMap()
444 InitCompatInfo(&next_incl, info->ctx, info->actions, &included.mods); in HandleIncludeCompatMap()
445 next_incl.default_interp = info->default_interp; in HandleIncludeCompatMap()
447 next_incl.default_led = info->default_led; in HandleIncludeCompatMap()
458 MergeIncludedCompatMaps(info, &included, include->merge); in HandleIncludeCompatMap()
461 return (info->errorCount == 0); in HandleIncludeCompatMap()
465 SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field, in SetInterpField() argument
472 return ReportSINotArray(info, si, field); in SetInterpField()
474 if (!HandleActionDef(info->ctx, info->actions, &info->mods, in SetInterpField()
483 return ReportSINotArray(info, si, field); in SetInterpField()
485 if (!ExprResolveMod(info->ctx, value, MOD_VIRT, &info->mods, &ndx)) in SetInterpField()
486 return ReportSIBadType(info, si, field, "virtual modifier"); in SetInterpField()
495 return ReportSINotArray(info, si, field); in SetInterpField()
497 if (!ExprResolveBoolean(info->ctx, value, &set)) in SetInterpField()
498 return ReportSIBadType(info, si, field, "boolean"); in SetInterpField()
505 log_dbg(info->ctx, in SetInterpField()
514 return ReportSINotArray(info, si, field); in SetInterpField()
516 if (!ExprResolveEnum(info->ctx, value, &val, useModMapValueNames)) in SetInterpField()
517 return ReportSIBadType(info, si, field, "level specification"); in SetInterpField()
523 return ReportBadField(info->ctx, "symbol interpretation", field, in SetInterpField()
524 siText(si, info)); in SetInterpField()
531 SetLedMapField(CompatInfo *info, LedInfo *ledi, const char *field, in SetLedMapField() argument
538 return ReportLedNotArray(info, ledi, field); in SetLedMapField()
540 if (!ExprResolveModMask(info->ctx, value, MOD_BOTH, in SetLedMapField()
541 &info->mods, &ledi->led.mods.mods)) in SetLedMapField()
542 return ReportLedBadType(info, ledi, field, "modifier mask"); in SetLedMapField()
550 return ReportLedNotArray(info, ledi, field); in SetLedMapField()
552 if (!ExprResolveMask(info->ctx, value, &mask, groupMaskNames)) in SetLedMapField()
553 return ReportLedBadType(info, ledi, field, "group mask"); in SetLedMapField()
562 return ReportLedNotArray(info, ledi, field); in SetLedMapField()
564 if (!ExprResolveMask(info->ctx, value, &mask, ctrlMaskNames)) in SetLedMapField()
565 return ReportLedBadType(info, ledi, field, "controls mask"); in SetLedMapField()
571 log_dbg(info->ctx, in SetLedMapField()
580 return ReportLedNotArray(info, ledi, field); in SetLedMapField()
582 if (!ExprResolveMask(info->ctx, value, &mask, in SetLedMapField()
584 return ReportLedBadType(info, ledi, field, in SetLedMapField()
593 return ReportLedNotArray(info, ledi, field); in SetLedMapField()
595 if (!ExprResolveMask(info->ctx, value, &mask, in SetLedMapField()
597 return ReportLedBadType(info, ledi, field, in SetLedMapField()
608 log_dbg(info->ctx, in SetLedMapField()
614 log_err(info->ctx, in SetLedMapField()
619 log_err(info->ctx, in SetLedMapField()
622 field, xkb_atom_text(info->ctx, ledi->led.name)); in SetLedMapField()
630 HandleGlobalVar(CompatInfo *info, VarDef *stmt) in HandleGlobalVar() argument
636 if (!ExprResolveLhs(info->ctx, stmt->name, &elem, &field, &ndx)) in HandleGlobalVar()
639 ret = SetInterpField(info, &info->default_interp, field, ndx, in HandleGlobalVar()
642 ret = SetLedMapField(info, &info->default_led, field, ndx, in HandleGlobalVar()
645 ret = SetActionField(info->ctx, info->actions, &info->mods, in HandleGlobalVar()
651 HandleInterpBody(CompatInfo *info, VarDef *def, SymInterpInfo *si) in HandleInterpBody() argument
659 log_err(info->ctx, in HandleInterpBody()
666 ok = ExprResolveLhs(info->ctx, def->name, &elem, &field, &arrayNdx); in HandleInterpBody()
670 ok = SetInterpField(info, si, field, arrayNdx, def->value); in HandleInterpBody()
677 HandleInterpDef(CompatInfo *info, InterpDef *def, enum merge_mode merge) in HandleInterpDef() argument
683 if (!ResolveStateAndPredicate(def->match, &pred, &mods, info)) { in HandleInterpDef()
684 log_err(info->ctx, in HandleInterpDef()
690 si = info->default_interp; in HandleInterpDef()
696 if (!HandleInterpBody(info, def->def, &si)) { in HandleInterpDef()
697 info->errorCount++; in HandleInterpDef()
701 if (!AddInterp(info, &si, true)) { in HandleInterpDef()
702 info->errorCount++; in HandleInterpDef()
710 HandleLedMapDef(CompatInfo *info, LedMapDef *def, enum merge_mode merge) in HandleLedMapDef() argument
719 ledi = info->default_led; in HandleLedMapDef()
727 if (!ExprResolveLhs(info->ctx, var->name, &elem, &field, &arrayNdx)) { in HandleLedMapDef()
733 log_err(info->ctx, in HandleLedMapDef()
739 ok = SetLedMapField(info, &ledi, field, arrayNdx, var->value) && ok; in HandleLedMapDef()
744 return AddLedMap(info, &ledi, true); in HandleLedMapDef()
750 HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge) in HandleCompatMapFile() argument
756 free(info->name); in HandleCompatMapFile()
757 info->name = strdup_safe(file->name); in HandleCompatMapFile()
762 ok = HandleIncludeCompatMap(info, (IncludeStmt *) stmt); in HandleCompatMapFile()
765 ok = HandleInterpDef(info, (InterpDef *) stmt, merge); in HandleCompatMapFile()
768 log_dbg(info->ctx, in HandleCompatMapFile()
774 ok = HandleLedMapDef(info, (LedMapDef *) stmt, merge); in HandleCompatMapFile()
777 ok = HandleGlobalVar(info, (VarDef *) stmt); in HandleCompatMapFile()
780 ok = HandleVModDef(info->ctx, &info->mods, (VModDef *) stmt, merge); in HandleCompatMapFile()
783 log_err(info->ctx, in HandleCompatMapFile()
791 info->errorCount++; in HandleCompatMapFile()
793 if (info->errorCount > 10) { in HandleCompatMapFile()
794 log_err(info->ctx, in HandleCompatMapFile()
807 CopyInterps(CompatInfo *info, bool needSymbol, enum xkb_match_operation pred, in CopyInterps() argument
812 darray_foreach(si, info->interps) in CopyInterps()
819 CopyLedMapDefsToKeymap(struct xkb_keymap *keymap, CompatInfo *info) in CopyLedMapDefsToKeymap() argument
821 for (xkb_led_index_t idx = 0; idx < info->num_leds; idx++) { in CopyLedMapDefsToKeymap()
822 LedInfo *ledi = &info->leds[idx]; in CopyLedMapDefsToKeymap()
870 CopyCompatToKeymap(struct xkb_keymap *keymap, CompatInfo *info) in CopyCompatToKeymap() argument
872 keymap->compat_section_name = strdup_safe(info->name); in CopyCompatToKeymap()
875 keymap->mods = info->mods; in CopyCompatToKeymap()
877 if (!darray_empty(info->interps)) { in CopyCompatToKeymap()
882 CopyInterps(info, true, MATCH_EXACTLY, &collect); in CopyCompatToKeymap()
883 CopyInterps(info, true, MATCH_ALL, &collect); in CopyCompatToKeymap()
884 CopyInterps(info, true, MATCH_NONE, &collect); in CopyCompatToKeymap()
885 CopyInterps(info, true, MATCH_ANY, &collect); in CopyCompatToKeymap()
886 CopyInterps(info, true, MATCH_ANY_OR_NONE, &collect); in CopyCompatToKeymap()
887 CopyInterps(info, false, MATCH_EXACTLY, &collect); in CopyCompatToKeymap()
888 CopyInterps(info, false, MATCH_ALL, &collect); in CopyCompatToKeymap()
889 CopyInterps(info, false, MATCH_NONE, &collect); in CopyCompatToKeymap()
890 CopyInterps(info, false, MATCH_ANY, &collect); in CopyCompatToKeymap()
891 CopyInterps(info, false, MATCH_ANY_OR_NONE, &collect); in CopyCompatToKeymap()
897 CopyLedMapDefsToKeymap(keymap, info); in CopyCompatToKeymap()
906 CompatInfo info; in CompileCompatMap() local
913 InitCompatInfo(&info, keymap->ctx, actions, &keymap->mods); in CompileCompatMap()
914 info.default_interp.merge = merge; in CompileCompatMap()
915 info.default_led.merge = merge; in CompileCompatMap()
917 HandleCompatMapFile(&info, file, merge); in CompileCompatMap()
918 if (info.errorCount != 0) in CompileCompatMap()
921 if (!CopyCompatToKeymap(keymap, &info)) in CompileCompatMap()
924 ClearCompatInfo(&info); in CompileCompatMap()
929 ClearCompatInfo(&info); in CompileCompatMap()