shl: hook: add 'oneshot' flag
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 13 Jan 2013 10:42:04 +0000 (11:42 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 13 Jan 2013 10:42:04 +0000 (11:42 +0100)
commit5ee2338b6095c5fa996f4d77a6cd9103f1d589d3
tree873b33dcbb46de4df171268f89ba95ba44a4c159
parent8fa28926cbe8fdcf0ec8f96d932e160399a1ac8a
shl: hook: add 'oneshot' flag

If an entry is marked as 'oneshot' then it will get deleted after it has
been called once. Note that the entry is unlinked _before_ the callback is
called.

If you use 'oneshot'-entries and normal entries with the same cb+data
combination, then you will probably get unexpected behavior. It is not
recommended to do that. In detail, you cannot control which entry is
deleted via a shl_hook_rm() call so you can never be sure whether the
oneshot entry or a normal entry is deleted.

Do not mix oneshot entries with normal entries!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/eloop.c
src/shl_hook.h
src/uterm_input.c
src/uterm_video.c