NeoMutt  2024-04-25-85-g27bab4
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
observer.h
Go to the documentation of this file.
1
23#ifndef MUTT_MUTT_OBSERVER_H
24#define MUTT_MUTT_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
54typedef int (*observer_t)(struct NotifyCallback *nc);
55
60{
64};
65
70{
73};
75
76#endif /* MUTT_MUTT_OBSERVER_H */
Notification Types.
NotifyType
Notification Types.
Definition: notify_type.h:34
int(* observer_t)(struct NotifyCallback *nc)
Definition: observer.h:54
#define STAILQ_HEAD(name, type)
Definition: queue.h:312
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:53
List of Observers.
Definition: observer.h:70
STAILQ_ENTRY(ObserverNode) entries
Linked list.
struct Observer * observer
An Observer.
Definition: observer.h:71
An observer of notifications.
Definition: observer.h:60
observer_t callback
Callback function for events.
Definition: observer.h:62
void * global_data
Private data to pass to callback.
Definition: observer.h:63
enum NotifyType type
Notification type to observe, e.g. NT_WINDOW.
Definition: observer.h:61