/** @file
*
* Module to dynamically load libhal and libdbus and load all symbols
* which are needed by VirtualBox.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "vbox-libhal.h"
/**
* Whether we have tried to load libdbus and libhal yet. This flag should only be set
* to "true" after we have either loaded both libraries and all symbols which we need,
* or failed to load something and unloaded and set back to zero pLibDBus and pLibHal.
*/
static bool gCheckedForLibHal = false;
/**
* Pointer to the libhal shared object. This should only be set once all needed libraries
* and symbols have been successfully loaded.
*/
/** The following are the symbols which we need from libdbus and libhal. */
DBusError *);
void (*gLibHalFreeString)(char *);
void (*gLibHalFreeStringArray)(char **);
bool gLibHalCheckPresence(void)
{
if (ghLibHal != 0 && gCheckedForLibHal == true)
return true;
if (gCheckedForLibHal == true)
return false;
{
return false;
}
(void **) &gDBusConnectionUnref))
(void **) &gLibHalCtxSetDBusConnection))
(void **) &gLibHalFindDeviceStringMatch))
(void **) &gLibHalDeviceGetPropertyString))
(void **) &gLibHalFreeStringArray))
)
{
gCheckedForLibHal = true;
return true;
}
else
{
gCheckedForLibHal = true;
return false;
}
}