Opts: Make singleton; senseApi: check senseApiLibPath, get senseApiDescFn pointer.

* OptionsParser now has a singleton.
* We now use the cmdline opt -p <senseApiLibPath>, and search for
  the specified library in:
  * senseApiLibPath, then CWD, then the place where our executable
    is running from, and then finally we let the hosting OS do
    its own search.
* We now call dlsym() on dlopen()'d libs to to get the senseApiDescFn
  pointer.
This commit is contained in:
2025-01-08 13:43:44 -04:00
parent b40790ee4a
commit bffa2b837c
4 changed files with 68 additions and 5 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ public:
class SenseApiLib
{
public:
typedef const CSenseApiDesc *(SenseApiDescGetterFn)(void);
typedef const CSenseApiDesc* (SenseApiDescGetterFn)(void);
public:
SenseApiLib(const std::string& path)
@@ -58,7 +58,7 @@ public:
* This getter function should be visible to dlsym() so that Harikoff can
* find it in the lib after loading it, and call it.
*/
SenseApiDescGetterFn *getSenseApiDescriptor;
std::function<SenseApiDescGetterFn> getSenseApiDescriptor;
/**
* @brief Harikoff will call the `getSenseApiDescriptor` getter function and