NeoMutt  2019-12-07-60-g0cfa53
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 <stdint.h>
34 #include "notify_type.h"
35 #include "queue.h"
36 
41 {
44  void *event_data;
45  void *global_data;
46 };
47 
54 typedef int (*observer_t)(struct NotifyCallback *nc);
55 
59 struct Observer
60 {
62  void *global_data;
63 };
64 
69 {
70  struct Observer *observer;
71  STAILQ_ENTRY(ObserverNode) entries;
72 };
73 STAILQ_HEAD(ObserverList, ObserverNode);
74 
75 #endif /* MUTT_LIB_OBSERVER_H */
Data passed to a notification function.
Definition: observer.h:40
struct Observer * observer
An Observer.
Definition: observer.h:70
#define STAILQ_ENTRY(type)
Definition: queue.h:324
void * global_data
Private data to pass to callback.
Definition: observer.h:62
NotifyType
Notification Types.
Definition: notify_type.h:29
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)
typedef observer_t - Prototype for a notification callback function
Definition: observer.h:54
void * global_data
Data from notify_observer_add()
Definition: observer.h:45
An observer of notifications.
Definition: observer.h:59
Notification Types.
List of Observers.
Definition: observer.h:68
void * event_data
Data from notify_send()
Definition: observer.h:44
observer_t callback
Callback function for events.
Definition: observer.h:61
STAILQ_HEAD(ObserverList, ObserverNode)