diff --git a/src/listener.c b/src/listener.c index 39a35a1e..121b836f 100644 --- a/src/listener.c +++ b/src/listener.c @@ -80,15 +80,15 @@ listener_remove(notify notify_cb) } void -listener_notify(enum listener_event_type type) +listener_notify(short event_mask) { struct listener *listener; listener = listener_list; while (listener) { - if (type & listener->events) - listener->notify_cb(type); + if (event_mask & listener->events) + listener->notify_cb(event_mask & listener->events); listener = listener->next; } } diff --git a/src/listener.h b/src/listener.h index 13988835..b5e717ab 100644 --- a/src/listener.h +++ b/src/listener.h @@ -36,7 +36,8 @@ typedef void (*notify)(short event_mask); * Registers the given callback function to the given event types. * This function is not thread safe. Listeners must be added once at startup. * - * @param notify_cb Callback function + * @param notify_cb Callback function (should be a non-blocking function, + * especially when the event is from the player) * @param event_mask Event mask, one or more of LISTENER_* * @return 0 on success, -1 on failure */ @@ -57,10 +58,10 @@ listener_remove(notify notify_cb); * Calls the callback function of the registered listeners listening for the * given type of event. * - * @param type The event type, on of the LISTENER_* values + * @param event_mask Event mask, one or more of LISTENER_* * */ void -listener_notify(enum listener_event_type type); +listener_notify(short event_mask); #endif /* !__LISTENER_H__ */