uterm: vt: add a lot more verbose error messages

This adds a lot more verbose error messages to the whole real-VT handling
so we can debug this fragile system way better than before.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: remove fake-VT SIGUSR1/2 (de)activation

This whole concept was broken from the beginning. With hotkey based
activation we have a much better debugging tool. This is still very
fragile, but better than nothing. And we are doing pretty well in error
recovery during hijacked VT switches so that's not as problematic as one
might think.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: register input-cb for all VTs

This modifies the generic VT layer to register input-cbs for all VT types
and dispatch the event to the correct handler.
This will allow us to handle VT-switches for real VTs ourself instead of
relying on VT input.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: handle VT switches without kernel input

We now set KBMODE to K_OFF so we are totally independent of kernel input.
Instead, we handle VT switches with uterm-input now. This also allows us
to have full control of which keyboard input is parsed by us and which is
parsed by the kernel.

We still need to set a flag for uterm-input events that they were handled
to avoid having the TSM layer handle these events again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: dlist: add macros for iterating lists in reverse order

These macros do the same as the already available macros but in reversed
order. This is useful when list-order is important.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: hook: link elements in reverse order

When adding new elements, we should add them at the tail, not at the
front. And when removing elements, we should remove them from the tail,
too.

We also convert the whole stuff to the shl_dlist API so we do not have to
manage the linked-list ourself.

Note that this silently breaks the idea of having multiple listeners with
the same function+data in the hook. This is because removing the listener
may now change order of two identical entries, as we don't know which of
them to remove. That means, when adding two identical entries, you cannot
rely on them to retain their position in regard to each other.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
genunifont: avoid format-security compiler warning

Current warning without the patch:
src/genunifont.c: In function 'print_data_row':
src/genunifont.c:85:3: warning: format not a string literal and no format arguments [-Wformat-security]
src/genunifont.c:88:3: warning: format not a string literal and no format arguments [-Wformat-security]

We use fputs() to avoid any format-string parsing and instead directly
write the string into the file.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: handle AM_PROG_AR not present in autoconf 1.11

AM_PROG_AR is a new feature since autoconf 1.12.
autogen.sh failed on Ubuntu 11.10 without this patch with:

configure.ac:30: error: possibly undefined macro: AM_PROG_AR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

AM_PROG_AR is required only for autoconf-1.12 so we can just skip it if
using an autoconf version that does not include it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: inverse get_pitch/stride logic

We should use get_stride() if this check fails as this is the new
function. We use this check only for backwards-compatibility reasons but
should not require it to pass for new builds.

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