]> git.proxmox.com Git - qemu.git/blame - notify.h
update VERSION for 1.1.2
[qemu.git] / notify.h
CommitLineData
d1e70c5e
AL
1/*
2 * Notifier lists
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13
14#ifndef QEMU_NOTIFY_H
15#define QEMU_NOTIFY_H
16
17#include "qemu-queue.h"
18
19typedef struct Notifier Notifier;
20
21struct Notifier
22{
9e8dd451 23 void (*notify)(Notifier *notifier, void *data);
31552529 24 QLIST_ENTRY(Notifier) node;
d1e70c5e
AL
25};
26
27typedef struct NotifierList
28{
31552529 29 QLIST_HEAD(, Notifier) notifiers;
d1e70c5e
AL
30} NotifierList;
31
32#define NOTIFIER_LIST_INITIALIZER(head) \
31552529 33 { QLIST_HEAD_INITIALIZER((head).notifiers) }
d1e70c5e
AL
34
35void notifier_list_init(NotifierList *list);
36
37void notifier_list_add(NotifierList *list, Notifier *notifier);
38
31552529 39void notifier_remove(Notifier *notifier);
d1e70c5e 40
9e8dd451 41void notifier_list_notify(NotifierList *list, void *data);
d1e70c5e
AL
42
43#endif