# HG changeset patch # User Thinker K.F. Li # Date 1228881737 -28800 # Node ID 748896358da288e1d2240174971797b4e9e7474e # Parent e91ba9e197bdea910ff1fdfee8d778ea3ef9151c Export subject_add_event_observer() to rest of the system. - declare it in mb_observer.h diff -r e91ba9e197bd -r 748896358da2 include/mb_observer.h --- a/include/mb_observer.h Wed Dec 10 11:52:36 2008 +0800 +++ b/include/mb_observer.h Wed Dec 10 12:02:17 2008 +0800 @@ -83,6 +83,8 @@ extern void subject_notify(subject_t *subject, event_t *evt); extern observer_t *subject_add_observer(subject_t *subject, evt_handler hdr, void *arg); +extern observer_t *subject_add_event_observer(subject_t *subject, int type, + evt_handler hdr, void *arg); extern void subject_remove_observer(subject_t *subject, observer_t *observer); diff -r e91ba9e197bd -r 748896358da2 src/observer.c --- a/src/observer.c Wed Dec 10 11:52:36 2008 +0800 +++ b/src/observer.c Wed Dec 10 12:02:17 2008 +0800 @@ -83,6 +83,8 @@ } } +/*! \brief Add an observer for any type of events. + */ observer_t *subject_add_observer(subject_t *subject, evt_handler hdr, void *arg) { ob_factory_t *factory = subject->factory; @@ -100,6 +102,8 @@ return observer; } +/*! \brief Add an observer for specified type of events. + */ observer_t *subject_add_event_observer(subject_t *subject, int type, evt_handler hdr, void *arg) { ob_factory_t *factory = subject->factory;