Commit 61cf87da authored by Ludovic Courtès's avatar Ludovic Courtès

core: 'plugin_search_path' is now an actual function.

parent 01fa171b
...@@ -60,8 +60,9 @@ static std::string library_name(const std::string name) ...@@ -60,8 +60,9 @@ static std::string library_name(const std::string name)
// Return the plugin search path based on the 'ALTA_PLUGIN_PATH' environment // Return the plugin search path based on the 'ALTA_PLUGIN_PATH' environment
// variable. Empty entries in that variable's value are taken to designate // variable. Empty entries in that variable's value are taken to designate
// the plugin installation directory. // the plugin installation directory.
static void plugin_search_path(std::list<std::string>& dirs) static std::list<std::string> plugin_search_path()
{ {
std::list<std::string> dirs;
std::string obj_str ; std::string obj_str ;
const char *env_str = std::getenv("ALTA_PLUGIN_PATH"); const char *env_str = std::getenv("ALTA_PLUGIN_PATH");
...@@ -95,6 +96,8 @@ static void plugin_search_path(std::list<std::string>& dirs) ...@@ -95,6 +96,8 @@ static void plugin_search_path(std::list<std::string>& dirs)
dirs.push_back(ALTA_PLUGIN_DIRECTORY); dirs.push_back(ALTA_PLUGIN_DIRECTORY);
} }
} }
return dirs;
} }
//! \brief Open a dynamic library file (.so or .dll) and extract the associated //! \brief Open a dynamic library file (.so or .dll) and extract the associated
...@@ -103,8 +106,7 @@ static void plugin_search_path(std::list<std::string>& dirs) ...@@ -103,8 +106,7 @@ static void plugin_search_path(std::list<std::string>& dirs)
template<typename T> template<typename T>
static T open_library(const std::string& filename, const char* function) static T open_library(const std::string& filename, const char* function)
{ {
std::list<std::string> basename; auto basename = plugin_search_path();
plugin_search_path(basename);
std::list<std::string>::iterator iter; std::list<std::string>::iterator iter;
for(iter = basename.begin(); iter != basename.end(); ++iter) for(iter = basename.begin(); iter != basename.end(); ++iter)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment