conf: prefix helpers with CONF_*

This is part of an effort to make the conf-subsystem more friendly for
external users like the tests/* binaries.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: make types generic

This abstracts the type system of the config parser so other types can be
added without changing the parser itself. This will also be required to
make the conf-subsystem exportable to other users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: make config types constant

Config types are shared so they should never be modified. Hence, make them
constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: move CONF_HAS_ARG flag to config-types

Whether an option takes an argument or not is definitely a property of the
type and not of the option. Therefore, move the flag to the type structure
and remove it from the option structure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: make missing arguments or wrong arguments fatal

It is not acceptable to start the applications with wrong parameters. A
typo must be corrected before starting the application so simply fail
loudly on errors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: be more verbose about wrong arguments

We didn't handle the case that an argument has a parameter but doesn't
need one.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: add aftercheck logic

The aftercheck logic allows each argument to make adjustments after the
argument-list has been parsed. It is also used to consume remaining
arguments.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: make important symbols global

In order to make the conf subsystem more open we need to make all
important symbols visible so others can include them.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: make config functions take conf-options as arguments

This replaces the global conf-options array with a parameter so we can use
the config parsers with different argument-lists.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
main: move conf_global to kmscon_conf in new header main.h

The main configuration is now limited to kmscon and thus should not use
the conf_* prefix. Move all code to use the new name and introduce the new
main.h header mainly for kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: input: pass xkb parameters from outside

Instead of accessing the kmscon configuration from the uterm code, we
should pass it in on creation. Otherwise, uterm depends on main.c which
would be really ugly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
main: add main.h header

Whoops, I missed this in the previous commits. damnit...

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tests: make all tests use the new conf-parsers

This allows the tests to have their own command-line parsers. Finally!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: add string-list type

The string-list type parses an argument as a list of strings separated
with commas. Empty arguments are accepted and correctly parsed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
main: replace unused --seat argument with --seats

The old --seat argument was no implemented, so replace it with --seats
which accepts a list of seats where kmscon runs on. Each seat is separate
from the others but kmscon allows providing terminal services to multiple
users/seats in a single process sharing resources like fonts and
renderers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>