Bug 1031122: Use per-event callbacks for tasks

Tasks now handle EPOLLIN and EPOLLERR in two separate functions.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 1031122: Mark public interfaces with "C" linkage

This patch marks public interfaces with "C" linkage. This allows
C++ programs to include them easily.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>