1 | /** @file
|
---|
2 | *
|
---|
3 | * Module to dynamically load libhal and libdbus and load all symbols
|
---|
4 | * which are needed by VirtualBox.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef ____H_VBOX_LIBHAL
|
---|
24 | #define ____H_VBOX_LIBHAL
|
---|
25 |
|
---|
26 | #include <stdint.h>
|
---|
27 |
|
---|
28 | #define LIB_HAL "libhal.so.1"
|
---|
29 |
|
---|
30 | /** Types from the dbus and hal header files which we need. These are taken more or less
|
---|
31 | verbatim from the DBus and Hal public interface header files. */
|
---|
32 | struct DBusError
|
---|
33 | {
|
---|
34 | const char *name;
|
---|
35 | const char *message;
|
---|
36 | unsigned int dummy1 : 1; /**< placeholder */
|
---|
37 | unsigned int dummy2 : 1; /**< placeholder */
|
---|
38 | unsigned int dummy3 : 1; /**< placeholder */
|
---|
39 | unsigned int dummy4 : 1; /**< placeholder */
|
---|
40 | unsigned int dummy5 : 1; /**< placeholder */
|
---|
41 | void *padding1; /**< placeholder */
|
---|
42 | };
|
---|
43 | struct DBusConnection;
|
---|
44 | typedef struct DBusConnection DBusConnection;
|
---|
45 | typedef uint32_t dbus_bool_t;
|
---|
46 | typedef enum { DBUS_BUS_SESSON, DBUS_BUS_SYSTEM, DBUS_BUS_STARTER } DBusBusType;
|
---|
47 | struct LibHalContext_s;
|
---|
48 | typedef struct LibHalContext_s LibHalContext;
|
---|
49 |
|
---|
50 | /** The following are the symbols which we need from libdbus and libhal. */
|
---|
51 | extern void (*gDBusErrorInit)(DBusError *);
|
---|
52 | extern DBusConnection *(*gDBusBusGet)(DBusBusType, DBusError *);
|
---|
53 | extern void (*gDBusErrorFree)(DBusError *);
|
---|
54 | extern void (*gDBusConnectionUnref)(DBusConnection *);
|
---|
55 | extern LibHalContext *(*gLibHalCtxNew)(void);
|
---|
56 | extern dbus_bool_t (*gLibHalCtxSetDBusConnection)(LibHalContext *, DBusConnection *);
|
---|
57 | extern dbus_bool_t (*gLibHalCtxInit)(LibHalContext *, DBusError *);
|
---|
58 | extern char **(*gLibHalFindDeviceStringMatch)(LibHalContext *, const char *, const char *, int *,
|
---|
59 | DBusError *);
|
---|
60 | extern char *(*gLibHalDeviceGetPropertyString)(LibHalContext *, const char *, const char *,
|
---|
61 | DBusError *);
|
---|
62 | extern void (*gLibHalFreeString)(char *);
|
---|
63 | extern void (*gLibHalFreeStringArray)(char **);
|
---|
64 | extern dbus_bool_t (*gLibHalCtxShutdown)(LibHalContext *, DBusError *);
|
---|
65 | extern dbus_bool_t (*gLibHalCtxFree)(LibHalContext *);
|
---|
66 |
|
---|
67 | extern bool gLibHalCheckPresence(void);
|
---|
68 |
|
---|
69 | #endif /* ____H_VBOX_LIBHAL not defined */
|
---|