Elektra  0.8.21
Functions
elektra/plugin.c File Reference

Interna of plugin functionality. More...

#include <kdberrors.h>
#include <kdbinternal.h>
#include <kdbversion.h>
Include dependency graph for elektra/plugin.c:

Functions

int elektraProcessPlugin (Key *cur, int *pluginNumber, char **pluginName, char **referenceName, Key *errorKey)
 
int elektraProcessPlugins (Plugin **plugins, KeySet *modules, KeySet *referencePlugins, KeySet *config, KeySet *systemConfig, Key *errorKey)
 Load a plugin. More...
 
Plugin * elektraPluginOpen (const char *name, KeySet *modules, KeySet *config, Key *errorKey)
 Opens a plugin. More...
 

Detailed Description

Interna of plugin functionality.

Function Documentation

◆ elektraPluginOpen()

Plugin* elektraPluginOpen ( const char *  name,
KeySet *  modules,
KeySet *  config,
Key *  errorKey 
)

Opens a plugin.

The config will be used as is. So be sure to transfer ownership of the config to it, with e.g. ksDup(). elektraPluginClose() will delete the config.

Returns
a pointer to a new created plugin or 0 on error

◆ elektraProcessPlugin()

int elektraProcessPlugin ( Key *  cur,
int *  pluginNumber,
char **  pluginName,
char **  referenceName,
Key *  errorKey 
)
Return values
1and an allocated string of the pluginName if a new plugins should be created.
2and an allocated string of the referenceName if an old plugin should be used
3and both if a new plugin should be created and made available for later back referencing.
-1on error

◆ elektraProcessPlugins()

int elektraProcessPlugins ( Plugin **  plugins,
KeySet *  modules,
KeySet *  referencePlugins,
KeySet *  config,
KeySet *  systemConfig,
Key *  errorKey 
)

Load a plugin.

The array of plugins must be set to 0. Its length is NR_OF_PLUGINS.

systemConfig will only be used, not deleted.

Parameters
configthe config with the information how the plugins should be put together
systemConfigthe shared (system) config for the plugins. Every plugin additional get this config.
Return values
-1on failure