2.  Shared Library Loader

The shared library loader EPluginLib implements a concrete EPlugin type which loads GNU shared libraries via the GModule api. It simply resolves symbols directly from the loaded shared object and invokes them expecting a function signature of EPluginLibFunc.

To manage plugin lifecycle, the function e_plugin_lib_enable will be invoked which allows the plugin to initialise itself. Its signature should match EPluginLibEnableFunc, and it will be called with enable=1. If the enable function returns non-zero it is assumed to have failed intialisation and will not be invoked further.

2.1. Definition

The shared library loader only requires one extra parameter in the base plugin definition.

	    
<e-plugin
  ...
  type="shlib"
  location="/full/path/name.so"
  ...
  <hook class="...">
   ...
</e-plugin>
type
The type name of the shared library plugin is shlib.
location
The location parameter contains the full path-name of a shared object to load.

2.2. Invocation

Function specification

Where a function spec is required in a plugin hook definition, it should simply be the full name of an exported symbol in the shared object.

Callback signature

void * function(ep, data);
EPlugin * ep;
void * data;

function
The callback function.
ep
The container EPlugin representing this plugin.
data
Hook context data. It is part of the hook's api to specify the type of this pointer.
return value
Return data. It is part of the hook's api to specify the type of this pointer.