* observer.c: Minor comments edits.

This commit is contained in:
Joel Brobecker 2003-02-28 07:19:32 +00:00
parent 7a28f9732a
commit 974e8cede2
2 changed files with 12 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2003-02-27 J. Brobecker <brobecker@gnat.com>
* observer.c: Minor comments edits.
2003-02-27 J. Brobecker <brobecker@gnat.com> 2003-02-27 J. Brobecker <brobecker@gnat.com>
* observer.h, observer.c: New file. * observer.h, observer.c: New file.

View File

@ -95,9 +95,9 @@ xfree_observer_list_node (struct observer_list *node)
xfree (node); xfree (node);
} }
/* Attach the callback NOTIFY to a subject represented by its list /* Attach the callback NOTIFY to a SUBJECT. The DATA is also stored,
of observers LIST. The DATA is also stored, in order for the subject in order for the subject to provide it back to the observer during
to provide it back to the observer during a notification. */ a notification. */
static struct observer * static struct observer *
generic_observer_attach (struct observer_list **subject, generic_observer_attach (struct observer_list **subject,
@ -114,10 +114,9 @@ generic_observer_attach (struct observer_list **subject,
return observer_list->observer; return observer_list->observer;
} }
/* Remove the given OBSERVER from the list of observers that need /* Remove the given OBSERVER from the SUBJECT. Once detached, OBSERVER
to be notified by the subject represented by its LIST of observers. should no longer be used, as it is no longer valid. */
Once detached, OBSERVER should no longer be used, as it is no longer
valid. */
static void static void
generic_observer_detach (struct observer_list **subject, generic_observer_detach (struct observer_list **subject,
const struct observer *observer) const struct observer *observer)
@ -145,9 +144,8 @@ generic_observer_detach (struct observer_list **subject,
warning ("Failed to detach observer"); warning ("Failed to detach observer");
} }
/* Send a notification to all the observers of a subject represented by /* Send a notification to all the observers of SUBJECT. ARGS is passed to
its LIST of observers. ARGS is passed to all observers as an argument all observers as an argument to the notification callback. */
to the notification callback. */
static void static void
generic_observer_notify (struct observer_list *subject, const void *args) generic_observer_notify (struct observer_list *subject, const void *args)