work on testMenu

This commit is contained in:
2025-03-12 14:07:04 -05:00
parent 666ecd409b
commit d9ef1122ee
4 changed files with 47 additions and 6 deletions

View File

@@ -25,14 +25,44 @@ App::~App() {
void App::run() {
std::cout << "\nTesting...\n";
done = modules.empty();
// Main loop
while (!done) {
end();
for(auto it = modules.begin(); it != modules.end(); it++)
(*it)->run();
}
}
void App::load(std::string lib) {
void* handle = dlopen(lib.c_str(), RTLD_LAZY);
if(!handle) {
std::cout << "could not open lib!\n";
return;
}
Module::create_t* create = (Module::create_t*) dlsym(handle, "create");
if(dlerror()) {
std::cout << "error finding create function in file: " << lib << std::endl;
}
Module::destroy_t* destroy = (Module::destroy_t*) dlsym(handle, "destroy");
if(dlerror()) {
std::cout << "error finding destroy function in file: " << lib << std::endl;
}
Module* m = create(handle);
for(auto it = modules.begin(); it != modules.end(); it++) {
if((*it)->getName() != "") {
}
}
}
void App::handleArgs(const int& argc, char* argv[]) {
@@ -56,3 +86,7 @@ void App::handleArgs(const int& argc, char* argv[]) {
i++;
}
}
void App::printHelp() {
std::cout << "archimedes [ -h | --help ] /path/to/some/library.so\n";
}