VirtualBox

source: vbox/trunk/src/VBox/Main/include/vbox-libhal.h@ 107044

Last change on this file since 107044 was 106061, checked in by vboxsync, 2 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/* $Id: vbox-libhal.h 106061 2024-09-16 14:03:52Z 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-2024 Oracle and/or its affiliates.
10 *
11 * This file is part of VirtualBox base platform packages, as
12 * available from https://www.virtualbox.org.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation, in version 3 of the
17 * License.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see <https://www.gnu.org/licenses>.
26 *
27 * SPDX-License-Identifier: GPL-3.0-only
28 */
29
30#ifndef MAIN_INCLUDED_vbox_libhal_h
31#define MAIN_INCLUDED_vbox_libhal_h
32#ifndef RT_WITHOUT_PRAGMA_ONCE
33# pragma once
34#endif
35
36#include <stdint.h>
37
38#define LIB_HAL "libhal.so.1"
39
40/** Types from the dbus and hal header files which we need. These are taken more or less
41 verbatim from the DBus and Hal public interface header files. */
42struct DBusError
43{
44 const char *name;
45 const char *message;
46 unsigned int dummy1 : 1; /**< placeholder */
47 unsigned int dummy2 : 1; /**< placeholder */
48 unsigned int dummy3 : 1; /**< placeholder */
49 unsigned int dummy4 : 1; /**< placeholder */
50 unsigned int dummy5 : 1; /**< placeholder */
51 void *padding1; /**< placeholder */
52};
53struct DBusConnection;
54typedef struct DBusConnection DBusConnection;
55typedef uint32_t dbus_bool_t;
56typedef enum { DBUS_BUS_SESSON, DBUS_BUS_SYSTEM, DBUS_BUS_STARTER } DBusBusType;
57struct LibHalContext_s;
58typedef struct LibHalContext_s LibHalContext;
59
60/** The following are the symbols which we need from libdbus and libhal. */
61extern void (*gDBusErrorInit)(DBusError *);
62extern DBusConnection *(*gDBusBusGet)(DBusBusType, DBusError *);
63extern void (*gDBusErrorFree)(DBusError *);
64extern void (*gDBusConnectionUnref)(DBusConnection *);
65extern LibHalContext *(*gLibHalCtxNew)(void);
66extern dbus_bool_t (*gLibHalCtxSetDBusConnection)(LibHalContext *, DBusConnection *);
67extern dbus_bool_t (*gLibHalCtxInit)(LibHalContext *, DBusError *);
68extern char **(*gLibHalFindDeviceStringMatch)(LibHalContext *, const char *, const char *, int *,
69 DBusError *);
70extern char *(*gLibHalDeviceGetPropertyString)(LibHalContext *, const char *, const char *,
71 DBusError *);
72extern void (*gLibHalFreeString)(char *);
73extern void (*gLibHalFreeStringArray)(char **);
74extern dbus_bool_t (*gLibHalCtxShutdown)(LibHalContext *, DBusError *);
75extern dbus_bool_t (*gLibHalCtxFree)(LibHalContext *);
76
77extern bool gLibHalCheckPresence(void);
78
79#endif /* !MAIN_INCLUDED_vbox_libhal_h */
80/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette