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