mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 14:03:02 +01:00
Some cosmetic changes in the plugin manager.
This commit is contained in:
parent
743dc62a3b
commit
6822d129ca
@ -295,21 +295,18 @@ void PluginManager::PluginModule::unload_module()
|
||||
|
||||
// Code that handles loading the generic firebird/plugin directory
|
||||
|
||||
static const char *ENGINE_PLUGIN_DIR = "plugins";
|
||||
static PluginManager enginePluginManager;
|
||||
static char enginePluginsLoaded = 0;
|
||||
const char *PluginManager::ENGINE_PLUGIN_DIR = "plugins";
|
||||
|
||||
#ifndef DARWIN
|
||||
static char *ENGINE_PLUGIN_REGISTRATION_ENTRYPOINT = "register_plugin";
|
||||
const char *PluginManager::ENGINE_PLUGIN_REGISTRATION_ENTRYPOINT = "register_plugin";
|
||||
#else
|
||||
static char *ENGINE_PLUGIN_REGISTRATION_ENTRYPOINT = "_register_plugin";
|
||||
const char *PluginManager::ENGINE_PLUGIN_REGISTRATION_ENTRYPOINT = "_register_plugin";
|
||||
#endif
|
||||
typedef void (*engineRegistrationFuncType)(PluginManager::Plugin*);
|
||||
|
||||
void PluginManager::load_engine_plugins()
|
||||
{
|
||||
if (enginePluginsLoaded)
|
||||
return;
|
||||
|
||||
PluginManager& enginePluginManager = getEnginePluginManager();
|
||||
|
||||
enginePluginManager.addSearchPath(ENGINE_PLUGIN_DIR);
|
||||
enginePluginManager.loadAllPlugins();
|
||||
|
||||
@ -325,3 +322,9 @@ void PluginManager::load_engine_plugins()
|
||||
(*regFunc)(&p);
|
||||
}
|
||||
}
|
||||
|
||||
PluginManager& PluginManager::getEnginePluginManager()
|
||||
{
|
||||
static PluginManager manager;
|
||||
return manager;
|
||||
}
|
||||
|
@ -48,6 +48,9 @@
|
||||
**/
|
||||
class PluginManager
|
||||
{
|
||||
static const char *ENGINE_PLUGIN_DIR;
|
||||
static const char *ENGINE_PLUGIN_REGISTRATION_ENTRYPOINT;
|
||||
|
||||
public:
|
||||
static void load_engine_plugins();
|
||||
|
||||
@ -199,8 +202,11 @@ public:
|
||||
/// is the set of all plugins known to the PluginManager. This includes all plugins
|
||||
/// found with the loadAllPluings and findPlugin functions.
|
||||
iterator begin() { return iterator(moduleList); }
|
||||
|
||||
static PluginManager& getEnginePluginManager();
|
||||
|
||||
private:
|
||||
typedef void (*engineRegistrationFuncType)(Plugin*);
|
||||
typedef std::pair<Firebird::string, bool> Path;
|
||||
Module *moduleList;
|
||||
Firebird::list<Path> searchPaths;
|
||||
|
Loading…
Reference in New Issue
Block a user