SenseApiLib, SenseApiDesc improvements, new Sense API Mgmt Lib Ops role

SenseApiDesc:
* Use a number count for num exported implexor APIs instead of
  NULL-terminated list.
* Add sanity checker functions for structs.

SenseApiLib:
* Invoke the new sanity checkers on new Lib objects.
* SenseApiDesc is now a member object instead of being
  pointed to.

SenseApiManager:
* loadSenseApiLib now calls the SenseApiDesc getter function.
* loadSenseApiLib now fills out the SenseApiLib class object.

New Sense API Mgmt Sub-API:

This sub-api (metalanguage, some might call it) is used to initialize
the lib's connection to the provider. After this call, the lib should
be ready to attach new devices to its provider on behalf of Hk.
This commit is contained in:
2025-01-09 06:03:43 -04:00
parent 2a397ae064
commit 53583e5735
4 changed files with 196 additions and 25 deletions
+45 -4
View File
@@ -8,16 +8,29 @@ static CExportedImplexorApiDesc xcbXorgExportedImplexorApis[] =
{
{
.name = "video-implexor"
},
{
.name = NULL
}
};
static sal_lmo_initializeIndFn xcbXorg_initializeInd;
static sal_lmo_finalizeIndFn xcbXorg_finalizeInd;
static sal_lmo_attachDeviceReqFn xcbXorg_attachDeviceReq;
static sal_lmo_detachDeviceReqFn xcbXorg_detachDeviceReq;
static Csal_libMgmtOps xcbXorgSalLibMgmtOps =
{
.initializeInd = xcbXorg_initializeInd,
.finalizeInd = xcbXorg_finalizeInd,
.attachDeviceReq = xcbXorg_attachDeviceReq,
.detachDeviceReq = xcbXorg_detachDeviceReq
};
static CSenseApiDesc xcbXorgApiDesc =
{
.name = "XcbXorg",
.exportedImplexorApis = xcbXorgExportedImplexorApis
.numExportedImplexorApis = sizeof(xcbXorgExportedImplexorApis) /
sizeof(*xcbXorgExportedImplexorApis),
.exportedImplexorApis = xcbXorgExportedImplexorApis,
.sal_libMgmtOps = &xcbXorgSalLibMgmtOps
};
extern HK_UNMANGLED getSenseApiDescFn HK_GET_SENSE_API_DESC_FN_NAME;
@@ -26,3 +39,31 @@ const CSenseApiDesc *HK_GET_SENSE_API_DESC_FN_NAME(void)
{
return &xcbXorgApiDesc;
}
static sal_lmo_initializeIndFn xcbXorg_initializeInd;
int xcbXorg_initializeInd(void)
{
std::cerr << "XcbXorg::sal_lmo_initializeInd\n";
return 0;
}
static sal_lmo_finalizeIndFn xcbXorg_finalizeInd;
int xcbXorg_finalizeInd(void)
{
std::cerr << "XcbXorg::sal_lmo_finalizeInd\n";
return 0;
}
static sal_lmo_attachDeviceReqFn xcbXorg_attachDeviceReq;
int xcbXorg_attachDeviceReq(void)
{
std::cerr << "XcbXorg::sal_lmo_attachDeviceReq\n";
return 0;
}
static sal_lmo_detachDeviceReqFn xcbXorg_detachDeviceReq;
int xcbXorg_detachDeviceReq(void)
{
std::cerr << "XcbXorg::sal_lmo_detachDeviceReq\n";
return 0;
}