NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
observer.h
Go to the documentation of this file.
1 
29 #ifndef MUTT_LIB_OBSERVER_H
30 #define MUTT_LIB_OBSERVER_H
31 
32 #include <stdbool.h>
33 #include "notify_type.h"
34 #include "queue.h"
35 
40 {
41  struct Notify *current;
44  void *event_data;
45  void *global_data;
46 };
47 
58 typedef int (*observer_t)(struct NotifyCallback *nc);
59 
63 struct Observer
64 {
65  enum NotifyType type;
67  void *global_data;
68 };
69 
74 {
75  struct Observer *observer;
76  STAILQ_ENTRY(ObserverNode) entries;
77 };
78 STAILQ_HEAD(ObserverList, ObserverNode);
79 
80 #endif /* MUTT_LIB_OBSERVER_H */
Data passed to a notification function.
Definition: observer.h:39
struct Observer * observer
An Observer.
Definition: observer.h:75
#define STAILQ_ENTRY(type)
Definition: queue.h:327
void * global_data
Private data to pass to callback.
Definition: observer.h:67
NotifyType
Notification Types.
Definition: notify_type.h:31
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition: observer.h:43
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:42
int(* observer_t)(struct NotifyCallback *nc)
Prototype for a notification callback function.
Definition: observer.h:58
void * global_data
Data from notify_observer_add()
Definition: observer.h:45
An observer of notifications.
Definition: observer.h:63
Notification API.
Definition: notify.c:50
struct Notify * current
Notify object being observed.
Definition: observer.h:41
Notification Types.
List of Observers.
Definition: observer.h:73
void * event_data
Data from notify_send()
Definition: observer.h:44
observer_t callback
Callback function for events.
Definition: observer.h:66
STAILQ_HEAD(ObserverList, ObserverNode)