osdep: include glib-compat.h before other QEMU headers
[qemu/ar7.git] / include / qemu / event_notifier.h
blobb79add035de8b2f00dbba4c8bca562b3dc3a0ca4
1 /*
2 * event notifier support
4 * Copyright Red Hat, Inc. 2010
6 * Authors:
7 * Michael S. Tsirkin <mst@redhat.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
13 #ifndef QEMU_EVENT_NOTIFIER_H
14 #define QEMU_EVENT_NOTIFIER_H
17 #ifdef _WIN32
18 #include <windows.h>
19 #endif
21 struct EventNotifier {
22 #ifdef _WIN32
23 HANDLE event;
24 #else
25 int rfd;
26 int wfd;
27 bool initialized;
28 #endif
31 typedef void EventNotifierHandler(EventNotifier *);
33 int event_notifier_init(EventNotifier *, int active);
34 void event_notifier_cleanup(EventNotifier *);
35 int event_notifier_set(EventNotifier *);
36 int event_notifier_test_and_clear(EventNotifier *);
38 #ifdef CONFIG_POSIX
39 void event_notifier_init_fd(EventNotifier *, int fd);
40 int event_notifier_get_fd(const EventNotifier *);
41 #else
42 HANDLE event_notifier_get_handle(EventNotifier *);
43 #endif
45 #endif