Annotation of qemu/notify.h, revision 1.1.1.3

1.1       root        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: 
                     19: typedef struct Notifier Notifier;
                     20: 
                     21: struct Notifier
                     22: {
1.1.1.2   root       23:     void (*notify)(Notifier *notifier, void *data);
1.1.1.3 ! root       24:     QLIST_ENTRY(Notifier) node;
1.1       root       25: };
                     26: 
                     27: typedef struct NotifierList
                     28: {
1.1.1.3 ! root       29:     QLIST_HEAD(, Notifier) notifiers;
1.1       root       30: } NotifierList;
                     31: 
                     32: #define NOTIFIER_LIST_INITIALIZER(head) \
1.1.1.3 ! root       33:     { QLIST_HEAD_INITIALIZER((head).notifiers) }
1.1       root       34: 
                     35: void notifier_list_init(NotifierList *list);
                     36: 
                     37: void notifier_list_add(NotifierList *list, Notifier *notifier);
                     38: 
1.1.1.3 ! root       39: void notifier_remove(Notifier *notifier);
1.1       root       40: 
1.1.1.2   root       41: void notifier_list_notify(NotifierList *list, void *data);
1.1       root       42: 
                     43: #endif

unix.superglobalmegacorp.com