aboutsummaryrefslogtreecommitdiff
path: root/src/plugin/pluginmgr_dl.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-10 23:25:14 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-10 23:25:14 +0800
commitf54345e4fc889471513cba99151a5e6a2dcef2d8 (patch)
tree0751093de4a8656ae24b139bf669f3f0a78ea417 /src/plugin/pluginmgr_dl.cpp
parentc108631ffb580cfed1e92b1a0713e11d8dcbdddd (diff)
downloadbullet-lab-remix-f54345e4fc889471513cba99151a5e6a2dcef2d8.tar.xz
This fixed yesterday's problem...
In fact there was no object slicing, but it was due to my laziness... I reused the code from BLR2 in bullet.hpp and there was no inheritance in BLR2... Also start the implementation of the plugin system.
Diffstat (limited to 'src/plugin/pluginmgr_dl.cpp')
-rw-r--r--src/plugin/pluginmgr_dl.cpp20
1 files changed, 20 insertions, 0 deletions
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);
+ }
+}