NeoMutt  2020-06-26-89-g172cd3
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 {
43  void *event_data;
44  void *global_data;
45 };
46 
53 typedef int (*observer_t)(struct NotifyCallback *nc);
54 
58 struct Observer
59 {
61  void *global_data;
62 };
63 
68 {
69  struct Observer *observer;
70  STAILQ_ENTRY(ObserverNode) entries;
71 };
72 STAILQ_HEAD(ObserverList, ObserverNode);
73 
74 #endif /* MUTT_LIB_OBSERVER_H */
Data passed to a notification function.
Definition: observer.h:39
struct Observer * observer
An Observer.
Definition: observer.h:69
#define STAILQ_ENTRY(type)
Definition: queue.h:324
void * global_data
Private data to pass to callback.
Definition: observer.h:61
NotifyType
Notification Types.
Definition: notify_type.h:31
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition: observer.h:42
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:41
int(* observer_t)(struct NotifyCallback *nc)
Prototype for a notification callback function.
Definition: observer.h:53
void * global_data
Data from notify_observer_add()
Definition: observer.h:44
An observer of notifications.
Definition: observer.h:58
Notification Types.
List of Observers.
Definition: observer.h:67
void * event_data
Data from notify_send()
Definition: observer.h:43
observer_t callback
Callback function for events.
Definition: observer.h:60
STAILQ_HEAD(ObserverList, ObserverNode)