Libspinscale: Initial top-level SMO port to coroutine framework

We haven't ported everything. Just the top-level methods. We'll
dig in to the leaf stuff later. Surprisingly, this all went without
any real difficulties.

Runs like a charm on first try.
This commit is contained in:
2026-05-24 16:12:29 -04:00
parent c539e6e924
commit cde2737876
44 changed files with 1296 additions and 1530 deletions
@@ -33,23 +33,27 @@ std::string DeviceManager::readDapSpecFile(const std::string& filename)
void DeviceManager::collateAllDapSpecs(void)
{
OptionParser &options = OptionParser::getOptions();
allDapSpecs = options.dapSpecs;
DeviceManager &dm = getInstance();
dm.s.rsrc.allDapSpecs = options.dapSpecs;
for (const auto& file : options.dapSpecFiles)
{
std::string fileContent = readDapSpecFile(file);
if (!allDapSpecs.empty()) {
allDapSpecs += "||";
if (!dm.s.rsrc.allDapSpecs.empty()) {
dm.s.rsrc.allDapSpecs += "||";
}
allDapSpecs += fileContent;
dm.s.rsrc.allDapSpecs += fileContent;
}
}
void DeviceManager::parseAllDapSpecs(void)
{
DeviceManager &dm = getInstance();
auto file_deleter = [](FILE* f) { if (f) fclose(f); };
std::unique_ptr<FILE, decltype(file_deleter)> input(
fmemopen((void*)allDapSpecs.c_str(), allDapSpecs.size(), "r"),
fmemopen(
(void*)dm.s.rsrc.allDapSpecs.c_str(),
dm.s.rsrc.allDapSpecs.size(), "r"),
file_deleter);
if (!input)