Without the re-initialization, the copying fails. This wasn't noticed
because this code practically never gets executed with ordinary keymaps.
Signed-off-by: Ran Benita <ran234@gmail.com>
==7071== Conditional jump or move depends on uninitialised value(s)
==7071== at 0x40B6CB: AddIndicatorName (keycodes.c:148)
==7071== by 0x40C34F: MergeIncludedKeycodes (keycodes.c:420)
==7071== by 0x40C613: HandleIncludeKeycodes (keycodes.c:480)
==7071== by 0x40D022: HandleKeycodesFile (keycodes.c:733)
==7071== by 0x40D79F: CompileKeycodes (keycodes.c:881)
==7071== by 0x401E22: compile_keymap (xkbcomp.c:157)
==7071== by 0x402091: xkb_map_new_from_kccgst (xkbcomp.c:229)
==7071== by 0x40216A: xkb_map_new_from_names (xkbcomp.c:254)
==7071== by 0x4046F5: test_compile_rules (common.c:164)
==7071== by 0x4015C1: test_rmlvo (rulescomp.c:44)
==7071== by 0x40180D: main (rulescomp.c:98)
Signed-off-by: Ran Benita <ran234@gmail.com>
and let the info always be the first argument to the various functions,
just for consistency (and it acting as the contex for this file).
Signed-off-by: Ran Benita <ran234@gmail.com>
Add new public API to provide the library users with some options to
control and customize the logging output from the library. It is based
upon the skeleton from the libabc demo libray:
https://git.kernel.org/?p=linux/kernel/git/kay/libabc.git
which is public domain and works pretty well.
This requires passing in the context object in every logging call, and
thus the conversion is done file by file. We also remove the global
warningLevel variable in favor of a verbosity level in the context,
which can be set by the user and is silent by default.
One issue is the ACTION calls, which, while nice, do not play very well
with line- and priority-based logging, and would require some
line continuation handling or keeping state or some other compromise. So
instead remove these and just inline them with their respective
warning/error. So instead of:
ERROR("Memory allocation failed\n")
ACTION("Removing all files on hardisk\n")
its something like that:
log_err("Memory allocation failed; Removing all files on harddisk\n")
Signed-off-by: Ran Benita <ran234@gmail.com>
The include/ dir is somewhat redundant and makes it just a bit harder to
handle the -I directives from out side of automake; without it the
default $(top_buildir) just works.
Here's also some further justifications I found:
http://smcv.pseudorandom.co.uk/2008/09/pc-uninstalled/
Signed-off-by: Ran Benita <ran234@gmail.com>
When including a file from another file, its possible to do something
like this:
include "+some(other)+files"
with the "+" or "|" in the beginning. What will happen then is that
instead of processing the include files separately and then merging into
the existing info, we instead start with the existing info and merge
into it as we go, as if it was written explicitly before the first "+".
It's not particulary clear what this may be useful for. Since it's not
used by xkeyboard-config, not documented anywhere (and google doesn't
bring up anything), completely untested and kind of ugly, remove this
"feature". It most likely never been used.
Signed-off-by: Ran Benita <ran234@gmail.com>
Taken from xserver/include/list.h. The changes made are:
* Drop the xorg_ prefix and some typedef from the end.
* Rename _for_each_entry macros to just _foreach (like darray).
* Rename list_is_empty to list_empty (like darray).
* Add a list_replace function which we use later.
Signed-off-by: Ran Benita <ran234@gmail.com>
This way we don't need to look up the key every time. We now only deal
with keycodes in the public API and in keycodes.c.
Also adds an xkb_foreach_key macro, which is used a lot.
Signed-off-by: Ran Benita <ran234@gmail.com>