diff options
Diffstat (limited to '4a-hal/4a-hal-manager/4a-hal-manager.c')
-rw-r--r-- | 4a-hal/4a-hal-manager/4a-hal-manager.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/4a-hal/4a-hal-manager/4a-hal-manager.c b/4a-hal/4a-hal-manager/4a-hal-manager.c index df35d12..f3ebe14 100644 --- a/4a-hal/4a-hal-manager/4a-hal-manager.c +++ b/4a-hal/4a-hal-manager/4a-hal-manager.c @@ -31,6 +31,9 @@ // Default api to print log when apihandle not available AFB_ApiT AFB_default; +// Local (static) Hal manager data structure +static struct HalMgrData localHalMgrGlobalData; + /******************************************************************************* * HAL Manager verbs table * ******************************************************************************/ @@ -49,6 +52,16 @@ struct HalUtlApiVerb HalManagerApiStaticVerbs[] = }; /******************************************************************************* + * HAL Manager get first 'SpecificHalData' structure * + from HAL list function * + ******************************************************************************/ + +struct SpecificHalData **HalMngGetFirstHalData(void) +{ + return &localHalMgrGlobalData.first; +} + +/******************************************************************************* * Dynamic API functions for hal manager * * TBD JAI : Use API-V3 instead of API-PRE-V3 * ******************************************************************************/ @@ -120,27 +133,22 @@ int HalMgrCreateApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) int afbBindingVdyn(AFB_ApiT apiHandle) { int status = 0, rc; - struct HalMgrData *HalMgrGlobalData; if(! apiHandle) return -1; - HalMgrGlobalData = (struct HalMgrData *) calloc(1, sizeof(struct HalMgrData)); - if(! HalMgrGlobalData) - return -2; - // Hugely hack to make all V2 AFB_DEBUG to work in fileutils AFB_default = apiHandle; AFB_ApiNotice(apiHandle, "In %s", __func__); // Load Hal-Manager using DynApi - rc = HalMgrCreateApi(apiHandle, HalMgrGlobalData); + rc = HalMgrCreateApi(apiHandle, &localHalMgrGlobalData); if(rc < 0) status--; // Load Hal-Ctls using DynApi - rc = HalCtlsCreateAllApi(apiHandle, HalMgrGlobalData); + rc = HalCtlsCreateAllApi(apiHandle, &localHalMgrGlobalData); if(rc < 0) status -= rc; |