diff options
Diffstat (limited to 'src/plugin')
-rw-r--r-- | src/plugin/pluginmgr.hpp | 15 | ||||
-rw-r--r-- | src/plugin/pluginmgr_dl.cpp | 20 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/plugin/pluginmgr.hpp b/src/plugin/pluginmgr.hpp new file mode 100644 index 0000000..e3220c1 --- /dev/null +++ b/src/plugin/pluginmgr.hpp @@ -0,0 +1,15 @@ +#ifndef PLUGINMGR_H +#define PLUGINMGR_H +class pluginManager +{ +private: + char fn[256][256]; + int fcnt; + char pluginFolder[256]; +public: + pluginManager(); + void scanPlugin(); + void loadPlugin(const char* filename); +}; +#endif + diff --git a/src/plugin/pluginmgr_dl.cpp b/src/plugin/pluginmgr_dl.cpp new file mode 100644 index 0000000..f3ab816 --- /dev/null +++ b/src/plugin/pluginmgr_dl.cpp @@ -0,0 +1,20 @@ +#include <dlfcn.h> +#include <dirent.h> +#include "pluginmgr.hpp" +pluginManager::pluginManager() +{ + pluginFolder="./plugins"; +} +void pluginManager::scanPlugin() +{ + DIR *dir; + struct dirent *file; + if(dir=opendir(pluginFolder)) + { + while(file=readdir(dir)) + //puts(file->d_name); + if(strcmp(file->d_name+strlen(file->d_name)-3,".so")==0) + strcpy(fn[fcnt++],file->d_name); + closedir(dir); + } +} |