XkbCompositeMap : OptFlags XkbCompositeType OptMapName OBRACE
XkbMapConfigList
CBRACE SEMI
- { $$= CreateXKBFile($2,$3,&$5->common,$1); }
+ {
+ $$ = CreateXKBFile(param->context, $2, $3,
+ &$5->common, $1);
+ }
;
XkbCompositeType: XKB_KEYMAP { $$= XkmKeymapFile; }
}
else
{
- $$= CreateXKBFile($2,$3,$5,$1);
+ $$ = CreateXKBFile(param->context, $2, $3, $5, $1);
}
}
;
}
else
{
- $$= CreateXKBFile($2,$3,$4,$1);
+ $$ = CreateXKBFile(param->context, $2, $3, $4, $1);
}
}
;
}
XkbFile *
-CreateXKBFile(int type, char *name, ParseCommon * defs, unsigned flags)
+CreateXKBFile(struct xkb_context *context, int type, char *name,
+ ParseCommon *defs, unsigned flags)
{
XkbFile *file;
- static int fileID;
file = uTypedAlloc(XkbFile);
if (file)
file->topName = uDupString(name);
file->name = name;
file->defs = defs;
- file->id = fileID++;
+ file->id = xkb_context_take_file_id(context);
file->flags = flags;
}
return file;
#define ISEMPTY(str) (!(str) || (strlen(str) == 0))
static XkbFile *
-XkbKeymapFileFromComponents(const struct xkb_component_names * ktcsg)
+XkbKeymapFileFromComponents(struct xkb_context *context,
+ const struct xkb_component_names *ktcsg)
{
XkbFile *keycodes, *types, *compat, *symbols;
IncludeStmt *inc;
inc = IncludeCreate(ktcsg->keycodes, MergeDefault);
- keycodes = CreateXKBFile(XkmKeyNamesIndex, NULL, (ParseCommon *)inc, 0);
+ keycodes = CreateXKBFile(context, XkmKeyNamesIndex, NULL,
+ (ParseCommon *)inc, 0);
inc = IncludeCreate(ktcsg->types, MergeDefault);
- types = CreateXKBFile(XkmTypesIndex, NULL, (ParseCommon *)inc, 0);
+ types = CreateXKBFile(context, XkmTypesIndex, NULL,
+ (ParseCommon *)inc, 0);
AppendStmt(&keycodes->common, &types->common);
inc = IncludeCreate(ktcsg->compat, MergeDefault);
- compat = CreateXKBFile(XkmCompatMapIndex, NULL, (ParseCommon *)inc, 0);
+ compat = CreateXKBFile(context, XkmCompatMapIndex, NULL,
+ (ParseCommon *)inc, 0);
AppendStmt(&keycodes->common, &compat->common);
inc = IncludeCreate(ktcsg->symbols, MergeDefault);
- symbols = CreateXKBFile(XkmSymbolsIndex, NULL, (ParseCommon *)inc, 0);
+ symbols = CreateXKBFile(context, XkmSymbolsIndex, NULL,
+ (ParseCommon *)inc, 0);
AppendStmt(&keycodes->common, &symbols->common);
- return CreateXKBFile(XkmKeymapFile,
+ return CreateXKBFile(context, XkmKeymapFile,
ktcsg->keymap ? ktcsg->keymap : strdup(""),
&keycodes->common, 0);
}
return NULL;
}
- if (!(file = XkbKeymapFileFromComponents(kccgst))) {
+ if (!(file = XkbKeymapFileFromComponents(context, kccgst))) {
ERROR("failed to generate parsed XKB file from components\n");
return NULL;
}