/[svn]/linuxsampler/trunk/src/plugins/InstrumentEditorFactory.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/plugins/InstrumentEditorFactory.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1600 by senoner, Wed Nov 14 23:42:15 2007 UTC revision 1601 by schoenebeck, Sat Dec 29 20:27:53 2007 UTC
# Line 28  Line 28 
28  #include <dlfcn.h>  #include <dlfcn.h>
29  #include <errno.h>  #include <errno.h>
30  #include <dirent.h>  #include <dirent.h>
31    #include <sys/types.h>
32    #include <sys/stat.h>
33    #include <unistd.h>
34  #endif  #endif
35  #include <string.h>  #include <string.h>
36    
# Line 185  namespace LinuxSampler { Line 188  namespace LinuxSampler {
188                  return;                  return;
189              }              }
190              for (dirent* pEntry = readdir(hDir); pEntry; pEntry = readdir(hDir)) {              for (dirent* pEntry = readdir(hDir); pEntry; pEntry = readdir(hDir)) {
191                    // dir entry name as full qualified path
192                    const String sPath = CONFIG_PLUGIN_DIR + ("/" + String(pEntry->d_name));
193                  // skip entries that are not regular files                  // skip entries that are not regular files
194                  if (pEntry->d_type != DT_REG) continue;                  struct stat entry_stat;
195                  String sPath = pEntry->d_name;                  if (lstat(sPath.c_str(), &entry_stat) != 0 ||
196                       (entry_stat.st_mode & S_IFMT) != S_IFREG)
197                       continue;
198                  // skip files that are not .so files                  // skip files that are not .so files
199                  if (                  if (sPath.length() < 3 ||
200                      sPath.substr(sPath.length() - 3) != ".so" &&                      sPath.substr(sPath.length() - 3) != ".so" &&
201                      sPath.find(".so.") == String::npos                      sPath.find(".so.") == String::npos
202                  ) continue;                  ) continue;
                 // make it a full qualified path  
                 sPath = CONFIG_PLUGIN_DIR + ("/" + sPath);  
203                  // load the DLL (the plugins should register themselfes automatically)                  // load the DLL (the plugins should register themselfes automatically)
204                  void* pDLL = dlopen(sPath.c_str(), RTLD_NOW);                  void* pDLL = dlopen(sPath.c_str(), RTLD_NOW);
205                  if (pDLL) LoadedDLLs.push_back(pDLL);                  if (pDLL) LoadedDLLs.push_back(pDLL);

Legend:
Removed from v.1600  
changed lines
  Added in v.1601

  ViewVC Help
Powered by ViewVC