NeoMutt  2022-04-29-247-gc6aae8
Teaching an old dog new tricks
DOXYGEN
observer.h
Go to the documentation of this file.
1
23#ifndef MUTT_LIB_OBSERVER_H
24#define MUTT_LIB_OBSERVER_H
25
26#include <stdbool.h>
27#include "notify_type.h"
28#include "queue.h"
29
34{
35 struct Notify *current;
38 void *event_data;
40};
41
55typedef int (*observer_t)(struct NotifyCallback *nc);
56
61{
65};
66
71{
74};
76
77#endif /* MUTT_LIB_OBSERVER_H */
Notification Types.
NotifyType
Notification Types.
Definition: notify_type.h:34
STAILQ_HEAD(ObserverList, ObserverNode)
int(* observer_t)(struct NotifyCallback *nc)
Definition: observer.h:55
Data passed to a notification function.
Definition: observer.h:34
void * event_data
Data from notify_send()
Definition: observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:36
struct Notify * current
Notify object being observed.
Definition: observer.h:35
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition: observer.h:37
void * global_data
Data from notify_observer_add()
Definition: observer.h:39
Notification API.
Definition: notify.c:51
List of Observers.
Definition: observer.h:71
STAILQ_ENTRY(ObserverNode) entries
Linked list.
struct Observer * observer
An Observer.
Definition: observer.h:72
An observer of notifications.
Definition: observer.h:61
observer_t callback
Callback function for events.
Definition: observer.h:63
void * global_data
Private data to pass to callback.
Definition: observer.h:64
enum NotifyType type
Notification type to observe, e.g. NT_WINDOW.
Definition: observer.h:62