Rename YYLTYPE to struct YYLTYPE

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Use AC_ARG_VAR for X11 header and XKB paths

And don't call pkg-config unless we need to.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Revert "Unconstify xkb_rules_names"

This reverts commit d007cd0a1f3f4b9c927175771ff79aae6fe4ab8b.

This is in fact more restrictive, because it breaks the (common) case
where the strings are const themselved, e.g. "evdev", "us", etc. As is
you must either duplicate the strings or suppress the warnings.

If the user needs to retain the non-const strings, he should instead
just keep them in some other struct and use xkb_rules_names just as
a temporary parameter for xkb_map_new_from_names. Mildly annoying but
acceptable.
Uncomment sections of test/rulescomp.c

Fixes an 'unused' warning. There seems to be nothing wrong with these
sections though, all the tests pass.

Signed-off-by: Ran Benita <ran234@gmail.com>
Update .gitignore for automake 1.12

Signed-off-by: Ran Benita <ran234@gmail.com>
Remove left over filecomp.sh file

Should have removed it in a previous commit.

Signed-off-by: Ran Benita <ran234@gmail.com>
Don't use typeof

clang complains with the xorg-macros warning flags:
src/context.c:58:36: error: extension used [-Werror,-pedantic,-Wlanguage-extension-token]
                                   typeof(new_paths));

This was not entirely correct, too. So bring back the casts to the
results of the allocation macros; might as well make them a bit more
type safe.

Signed-off-by: Ran Benita <ran234@gmail.com>
Refactor Compile<component> functions

The error handling was not ideal, so unify it. Also makes the functions
a bit easier to read.

Signed-off-by: Ran Benita <ran234@gmail.com>
Rename xkbcomp/misc.h to xkbcomp-priv.h and use it

The include dependencies were quite convoluted, where you change the
order and get a ton of errors. Instead, change one file to act as the
internal interface for the xkbcomp files, and make every file use it.

Also drop the pointless "xkb" prefix to file names.

Signed-off-by: Ran Benita <ran234@gmail.com>
Rename XKBcommonint.h to xkb-priv.h and use it

Make the files in the src/* directory use their own header or a
consilidated private header. This makes the file dependencies clearer.

Also drop the pointless "xkb" file name prefix, add split a few
declarations to their own files (atom.h and text.h).

Signed-off-by: Ran Benita <ran234@gmail.com>
Reintroduce $(builddir)/src/xkbcomp include

This is required for parser.h, which is autogenerated and thus only in
the build directory.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Add flags to keymap compilation entrypoints

No use as yet, but might as well ...

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Add flags to context creation

None defined as yet, but why not.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Add context flag to inhibit default include paths

Which will make the context start with no include paths at all.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Add pre-defined names database

xkbcommon-names.h right now just contains a set of hardcoded modifier
strings that are most commonly used for the usual modifiers.  Provide
definitions of these so people don't have to worry about typoing a
string or mixing up Mod1 and Mod4.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Add multiple modifier state matching API

Two new calls allow users to test the exact modifier state, including
verifying that no other modifiers but the ones you wanted are down.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>