changeset 206:748896358da2

Export subject_add_event_observer() to rest of the system. - declare it in mb_observer.h
author Thinker K.F. Li <thinker@branda.to>
date Wed, 10 Dec 2008 12:02:17 +0800
parents e91ba9e197bd
children fd3e311e7e5d
files include/mb_observer.h src/observer.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
--- 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;