~ubuntu-branches/ubuntu/wily/qemu-kvm-spice/wily

« back to all changes in this revision

Viewing changes to notify.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-10-19 10:44:56 UTC
  • Revision ID: james.westby@ubuntu.com-20111019104456-xgvskumk3sxi97f4
Tags: upstream-0.15.0+noroms
ImportĀ upstreamĀ versionĀ 0.15.0+noroms

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
{
 
23
    void (*notify)(Notifier *notifier, void *data);
 
24
    QTAILQ_ENTRY(Notifier) node;
 
25
};
 
26
 
 
27
typedef struct NotifierList
 
28
{
 
29
    QTAILQ_HEAD(, Notifier) notifiers;
 
30
} NotifierList;
 
31
 
 
32
#define NOTIFIER_LIST_INITIALIZER(head) \
 
33
    { QTAILQ_HEAD_INITIALIZER((head).notifiers) }
 
34
 
 
35
void notifier_list_init(NotifierList *list);
 
36
 
 
37
void notifier_list_add(NotifierList *list, Notifier *notifier);
 
38
 
 
39
void notifier_list_remove(NotifierList *list, Notifier *notifier);
 
40
 
 
41
void notifier_list_notify(NotifierList *list, void *data);
 
42
 
 
43
#endif