Tellurium Plugin C API  1.0.0
Plugin Framework for Tellurium
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions
Plugin Manager

Plugin Manager Library Functions. More...

Functions

TELHandle tpCreatePluginManager (const char *pluginDir)
 Create a new instance of a plugin manager. More...
 
bool tpFreePluginManager (TELHandle handle)
 Free the plugin manager. A call to this function will also unload any loaded plugins. More...
 
bool tpLoadPlugins (TELHandle handle)
 Load plugins. The function will look in the default plugin folder for plugins, and load them. More...
 
char * tpGetPluginLoadErrors (TELHandle handle)
 Retrieve any errors that occured durig loading of plugins.
 
bool tpUnLoadPlugins (TELHandle handle)
 Unload plugins. More...
 
TELHandle tpLoadPlugin (TELHandle handle, const char *pluginName)
 Load a particular plugin. More...
 
bool tpUnLoadPlugin (TELHandle handle, TELHandle plugin)
 unload a particular plugin More...
 
int tpGetNumberOfPlugins (TELHandle handle)
 Get Number of loaded plugins. More...
 
char * tpGetPluginNames (TELHandle handle)
 Function to retrieve the names of currently loaded plugins. More...
 
char * tpGetPluginLibraryNames (TELHandle handle)
 Function to retrieve the library name of currently loaded plugins. More...
 
TELHandle tpGetFirstPlugin (TELHandle handle)
 getFirstPlugin retrieves the "first" plugin in the plugin managers internal list of plugins. This function is typically used together with the getNextPlugin and the getPreviousPlugin functions. More...
 
TELHandle tpGetNextPlugin (TELHandle handle)
 getNextPlugin retrieves the "next" plugin in the plugin managers internal list of plugins. This function is typically used together with the getFirstPlugin and getPreviousPlugin functions. More...
 
TELHandle tpGetPreviousPlugin (TELHandle handle)
 getPreviousPlugin retrieves the "previous" plugin in the plugin managers internal list of plugins. This function is typically used together with the getFirstPlugin and getNextPlugin functions. More...
 
TELHandle tpGetCurrentPlugin (TELHandle handle)
 getCurrentPlugin retrieves the "current" plugin in the plugin managers internal list of plugins. This function is typically used together with the getFirst, Next and getPreviousPlugin functions. More...
 
TELHandle tpGetPlugin (TELHandle handle, const char *pluginName)
 GetPluginHandle. More...
 
long tpGetPluginSharedLibHandle (TELHandle handle, TELHandle pluginHandle)
 Get a handle to a plugins shared library. More...
 

Detailed Description

Plugin Manager Library Functions.

Function Documentation

TELHandle tpCreatePluginManager ( const char *  pluginDir)

Create a new instance of a plugin manager.

A PluginManager manages a collection of plugins, loaded and unloaded by the load and unload API functions respectively.

Parameters
pluginDirFull path to folder containing plugins. If NULL, uses default folder.
Returns
On success, a handle to a Plugin manager, on failure, NULL.
bool tpFreePluginManager ( TELHandle  handle)

Free the plugin manager. A call to this function will also unload any loaded plugins.

Parameters
handleHandle to a plugin manager.
Returns
true if success, false otherwise.

free the plugin manager

TELHandle tpGetCurrentPlugin ( TELHandle  handle)

getCurrentPlugin retrieves the "current" plugin in the plugin managers internal list of plugins. This function is typically used together with the getFirst, Next and getPreviousPlugin functions.

Parameters
handleHandle to a PluginManager instance
Returns
Returns a handle to a plugin. Returns NULL if the plugin is not found
TELHandle tpGetFirstPlugin ( TELHandle  handle)

getFirstPlugin retrieves the "first" plugin in the plugin managers internal list of plugins. This function is typically used together with the getNextPlugin and the getPreviousPlugin functions.

Parameters
handleHandle to a PluginManager instance
Returns
Returns a handle to a plugin. Returns NULL if the plugin is not found
TELHandle tpGetNextPlugin ( TELHandle  handle)

getNextPlugin retrieves the "next" plugin in the plugin managers internal list of plugins. This function is typically used together with the getFirstPlugin and getPreviousPlugin functions.

Parameters
handleHandle to a PluginManager instance
Returns
Returns a handle to a plugin. Returns NULL if the plugin is not found
int tpGetNumberOfPlugins ( TELHandle  handle)

Get Number of loaded plugins.

Parameters
handleHandle to a PluginManager instance
Returns
Returns the number of loaded plugins, -1 if a problem is encountered
TELHandle tpGetPlugin ( TELHandle  handle,
const char *  pluginName 
)

GetPluginHandle.

Parameters
handleHandle to a PluginManager instance
pluginNamePointer to string holding the name of a plugin
Returns
Returns a handle to a plugin, with name as supplied in the parameter pluginName. Returns NULL if the plugin is not found
char* tpGetPluginLibraryNames ( TELHandle  handle)

Function to retrieve the library name of currently loaded plugins.

Parameters
handleHandle to a PluginManager instance
Returns
Returns names for loaded plugins as a RRStringArrayPtr, NULL otherwise
char* tpGetPluginNames ( TELHandle  handle)

Function to retrieve the names of currently loaded plugins.

Parameters
handleHandle to a PluginManager instance
Returns
Returns names for loaded plugins as a RRStringArrayPtr, NULL otherwise
long tpGetPluginSharedLibHandle ( TELHandle  handle,
TELHandle  pluginHandle 
)

Get a handle to a plugins shared library.

Parameters
handleHandle to a PluginManager instance
pluginHandleHandle to a plugin
Returns
Returns a handle to the shared library holding a plugin. Returns -1 if the handle can't be retrieved.
Note
This function is not yet implemented..
TELHandle tpGetPreviousPlugin ( TELHandle  handle)

getPreviousPlugin retrieves the "previous" plugin in the plugin managers internal list of plugins. This function is typically used together with the getFirstPlugin and getNextPlugin functions.

Parameters
handleHandle to a PluginManager instance
Returns
Returns a handle to a plugin. Returns NULL if the plugin is not found
TELHandle tpLoadPlugin ( TELHandle  handle,
const char *  pluginName 
)

Load a particular plugin.

Parameters
handleHandle to a PluginManager instance
pluginNameName of the plugin to load. The plugin name is the plugins shared library name, without path and extension.
Returns
Returns a handle to a plugin, NULL if unsuccesfull
bool tpLoadPlugins ( TELHandle  handle)

Load plugins. The function will look in the default plugin folder for plugins, and load them.

Parameters
handleHandle to a PluginManager instance
Returns
Returns a boolean indicating success/failure
Note
Failure during the tpLoadPlugins call can be retrieved using the getPluginsLoadError() function
bool tpUnLoadPlugin ( TELHandle  handle,
TELHandle  plugin 
)

unload a particular plugin

Parameters
handleHandle to a PluginManager instance
pluginHandle to a Plugin instance
Returns
Returns true if the Plugin are unloaded succesfully, false otherwise
bool tpUnLoadPlugins ( TELHandle  handle)

Unload plugins.

Parameters
handleHandle to a PluginManager instance
Returns
Returns true if Plugins are unloaded succesfully, false otherwise