Make XkbFileCreate argument types match between header & implementation

Fixes build failure with Solaris Studio compilers:
"src/xkbcomp/ast-build.c", line 492: identifier redeclared: XkbFileCreate
  current : function(..., enum xkb_map_flags)
  previous: function(..., unsigned int) : "src/xkbcomp/ast-build.h", line 98

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Bump version to 0.3.2

Add a NEWS file, with some retroactive entries. Also add 'check-news' to
configure.ac, though this might be a bit annoying.

Signed-off-by: Ran Benita <ran234@gmail.com>
NEWS: add missing 'New API' entries for NO_FLAGS

Forgot to add this.

Signed-off-by: Ran Benita <ran234@gmail.com>
symbols: rename info.modMaps -> modmaps

Signed-off-by: Ran Benita <ran234@gmail.com>
symbols: modernize LookupKeysym

Signed-off-by: Ran Benita <ran234@gmail.com>
scanner: restore lost DIVIDE token

I don't know how this could have happened. Luckily this token is
completely useless.

Signed-off-by: Ran Benita <ran234@gmail.com>
Resolve keysyms early in parser

Instead of having the parser passing strings to the AST, and
symbols/compat etc. resolving them themselves. This simplifies the code
a bit, and makes it possible to print where exactly in the file the bad
keysym originates from.

The previous lazy approach had an advantage of not needlessly resolving
keysyms from unrelated maps. However, I think reporting these errors in
*any* map is better, and the parser is also a bit smarter then old
xkbcomp and doesn't parse many useless maps. So there's no discernible
speed/memory difference with this change.

Signed-off-by: Ran Benita <ran234@gmail.com>
expr: add 'ident' value to ExprDef union

This distinguishes between an identifier expression and a string
expression in the union.

Signed-off-by: Ran Benita <ran234@gmail.com>
expr: add constructors for more expression types

This makes the parser a bit more declarative. But really it might make
error handling easier.

Signed-off-by: Ran Benita <ran234@gmail.com>
expr: add constructor for boolean expressions

Also add a 'bool set' to the ExprDef union, instead of using 'ival' as a
bool.

Signed-off-by: Ran Benita <ran234@gmail.com>
parser: remove 'uval' yylval type

We don't care about DoodadType.

Signed-off-by: Ran Benita <ran234@gmail.com>
expr: use ExprCreate in more places

Signed-off-by: Ran Benita <ran234@gmail.com>
parser, symbols: drop unnecessary casts

It's casted into ExprDef and then uncasted for no reason.

Signed-off-by: Ran Benita <ran234@gmail.com>
expr: split expression types and allocate them separately

Currently, we have one ExprDef type, which contains a tagged union with
the value of all expression types. Turns out, this union is quite
wasteful memory-wise. Instead, create separate types for all expressions
(e.g ExprBinary, ExprInteger) which embed the common fields
(ExprCommon), and malloc them per their size; ExprDef then becomes a
union of all these types, but is just used as a generic pointer.

[Instead of making ExprDef a union, another option is to use
ExprCommon as the generic pointer type and then do up-castings, like we
do with ParseCommon. But this makes the code much uglier.]

The diff is mostly straightforward mechanical adaptations. It could have
been much smaller with the help of C11 anonymous structs (which were
previously a gnu extension). This will have saved all of the 'op' ->
'expr->op', etc changes. But if we can be a bit more portable for a
little effort, we should.

Before (./test/rulescomp, x86 32 bit, -O2):
==12974==   total heap usage: 145,217 allocs, 145,217 frees, 10,476,238 bytes allocated

After:
==11145==   total heap usage: 145,217 allocs, 145,217 frees, 8,270,358 bytes allocated

Signed-off-by: Ran Benita <ran234@gmail.com>
expr: add wrapper macro for ExprCreate

Signed-off-by: Ran Benita <ran234@gmail.com>
expr: make Expr creation naming and file location consistent

Signed-off-by: Ran Benita <ran234@gmail.com>
atom: drop {xkb_,}atom_strdup

Even though in 112cccb18ad1bc877b3c4a87fa536ea085c761b5 I said it might
be useful, it's not. So remove it.

Signed-off-by: Ran Benita <ran234@gmail.com>
atom: allow interning empty string

Which is different than XKB_ATOM_NONE, as in "" != NULL.

Signed-off-by: Ran Benita <ran234@gmail.com>
atom: allow passing NULLs to find_node_pointer()

Signed-off-by: Ran Benita <ran234@gmail.com>
atom: tiny style fixes

Signed-off-by: Ran Benita <ran234@gmail.com>