types: separate ctx
authorRan Benita <ran234@gmail.com>
Thu, 7 Feb 2013 22:14:49 +0000 (00:14 +0200)
committerRan Benita <ran234@gmail.com>
Wed, 16 Apr 2014 20:19:49 +0000 (23:19 +0300)
commit36cbecc5b5a209fa17f2c8a9214ed09a1ca5585e
tree0c7618e89a6d57ca2f5569c73aa4a8a5b37a0925
parent999f3792ac19449764fca224b0741512cc945776
types: separate ctx

Separate the ctx object to its own field in CompatInfo, instead of doing
keymap->ctx.

The compilation functions should not have direct access to the keymap;
instead they should process the files with their own independent state
(in the *Info structs) as much as possible, and only at the end should
they be copied (i.e. commited) to the keymap. If the compilation fails,
it leaves no by-products. It's also just good form.

This was seemingly the original author's intention, but I suppose he cut
a few corners (mostly with the handling of virtual modifiers, which are
threaded through types -> compat -> symbols).

This commit is the first step and may look artificial; however the
'keymap' field will be removed shortly.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/types.c