shl: hook: link elements in reverse order
authorDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 8 Oct 2012 15:26:48 +0000 (17:26 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 8 Oct 2012 15:26:48 +0000 (17:26 +0200)
commit158b5fcbaced56479b2d370a68e770506f0df5d3
treee4b2f9df581d5f0149fffbb0e487dfca315ca63c
parentf1c972f7d955c9382f4b0d5b366ea6c95be24b32
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>
Makefile.am
src/shl_hook.h