gwenhywfar  5.14.1
Functions | Variables
plugin.c File Reference
#include "plugin_p.h"
#include <gwenhywfar/debug.h>
#include <ctype.h>
Include dependency graph for plugin.c:

Go to the source code of this file.

Functions

static GWEN_PLUGIN_DESCRIPTION_LIST2_combinedPluginDescrList (const GWEN_PLUGIN_DESCRIPTION_LIST2 *pdlLoaded, const GWEN_PLUGIN_DESCRIPTION_LIST2 *pdlFromPluginList)
 
static GWEN_PLUGIN_createPluginFromLibloader (GWEN_PLUGIN_MANAGER *pm, GWEN_LIBLOADER *libLoader, const char *modname)
 
static GWEN_PLUGIN_DESCRIPTION_findPluginDescrByNameInList2 (const GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl, const char *name)
 
static GWEN_PLUGIN_findPluginInListByName (GWEN_PLUGIN_MANAGER *pm, const char *s)
 
static GWEN_PLUGIN_DESCRIPTION_LIST2_getPluginDescrsFromPluginList (GWEN_PLUGIN_MANAGER *pm)
 
static GWEN_PLUGIN_DESCRIPTION_LIST2_loadPluginDescrs (GWEN_PLUGIN_MANAGER *pm)
 
static GWEN_LIBLOADER_searchAndLoadModule (GWEN_PLUGIN_MANAGER *pm, const char *modname)
 
static void _setLibLoader (GWEN_PLUGIN *p, GWEN_LIBLOADER *ll)
 
void GWEN_Plugin_Attach (GWEN_PLUGIN *p)
 
void GWEN_Plugin_free (GWEN_PLUGIN *p)
 
const char * GWEN_Plugin_GetFileName (const GWEN_PLUGIN *p)
 
GWEN_LIBLOADERGWEN_Plugin_GetLibLoader (const GWEN_PLUGIN *p)
 
GWEN_PLUGIN_MANAGERGWEN_Plugin_GetManager (const GWEN_PLUGIN *p)
 
const char * GWEN_Plugin_GetName (const GWEN_PLUGIN *p)
 
const GWEN_PLUGIN_DESCRIPTIONGWEN_Plugin_GetPluginDescription (const GWEN_PLUGIN *p)
 
int GWEN_Plugin_ModuleFini (void)
 
int GWEN_Plugin_ModuleInit (void)
 
GWEN_PLUGINGWEN_Plugin_new (GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
 
void GWEN_Plugin_SetPluginDescription (GWEN_PLUGIN *p, GWEN_PLUGIN_DESCRIPTION *pd)
 
int GWEN_PluginManager_AddPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
 
int GWEN_PluginManager_AddPathFromWinReg (GWEN_UNUSED GWEN_PLUGIN_MANAGER *pm, GWEN_UNUSED const char *callingLib, GWEN_UNUSED const char *keypath, GWEN_UNUSED const char *varname)
 
void GWEN_PluginManager_AddPlugin (GWEN_PLUGIN_MANAGER *pm, GWEN_PLUGIN *p)
 
int GWEN_PluginManager_AddRelPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s, GWEN_PATHMANAGER_RELMODE rm)
 
GWEN_PLUGIN_MANAGERGWEN_PluginManager_FindPluginManager (const char *s)
 
void GWEN_PluginManager_free (GWEN_PLUGIN_MANAGER *pm)
 
const char * GWEN_PluginManager_GetName (const GWEN_PLUGIN_MANAGER *pm)
 
GWEN_STRINGLISTGWEN_PluginManager_GetPaths (const GWEN_PLUGIN_MANAGER *pm)
 
GWEN_PLUGINGWEN_PluginManager_GetPlugin (GWEN_PLUGIN_MANAGER *pm, const char *s)
 
GWEN_PLUGIN_DESCRIPTIONGWEN_PluginManager_GetPluginDescr (GWEN_PLUGIN_MANAGER *pm, const char *modName)
 
GWEN_PLUGIN_DESCRIPTION_LIST2GWEN_PluginManager_GetPluginDescrs (GWEN_PLUGIN_MANAGER *pm)
 
int GWEN_PluginManager_InsertPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
 
int GWEN_PluginManager_InsertRelPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *relpath, GWEN_PATHMANAGER_RELMODE rm)
 
GWEN_PLUGINGWEN_PluginManager_LoadPlugin (GWEN_PLUGIN_MANAGER *pm, const char *modname)
 
GWEN_PLUGINGWEN_PluginManager_LoadPluginFile (GWEN_PLUGIN_MANAGER *pm, const char *modname, const char *fname)
 
GWEN_PLUGIN_MANAGERGWEN_PluginManager_new (const char *name, const char *destLib)
 
int GWEN_PluginManager_Register (GWEN_PLUGIN_MANAGER *pm)
 
int GWEN_PluginManager_RemovePath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
 
int GWEN_PluginManager_Unregister (GWEN_PLUGIN_MANAGER *pm)
 

Variables

static GWEN_PLUGIN_MANAGER_LIST * gwen_plugin_manager__list =0
 

Function Documentation

◆ _combinedPluginDescrList()

GWEN_PLUGIN_DESCRIPTION_LIST2 * _combinedPluginDescrList ( const GWEN_PLUGIN_DESCRIPTION_LIST2 pdlLoaded,
const GWEN_PLUGIN_DESCRIPTION_LIST2 pdlFromPluginList 
)
static

◆ _createPluginFromLibloader()

GWEN_PLUGIN * _createPluginFromLibloader ( GWEN_PLUGIN_MANAGER pm,
GWEN_LIBLOADER libLoader,
const char *  modname 
)
static

◆ _findPluginDescrByNameInList2()

GWEN_PLUGIN_DESCRIPTION * _findPluginDescrByNameInList2 ( const GWEN_PLUGIN_DESCRIPTION_LIST2 pdl,
const char *  name 
)
static

◆ _findPluginInListByName()

GWEN_PLUGIN * _findPluginInListByName ( GWEN_PLUGIN_MANAGER pm,
const char *  s 
)
static

Definition at line 705 of file plugin.c.

Referenced by GWEN_PluginManager_GetPlugin().

Here is the caller graph for this function:

◆ _getPluginDescrsFromPluginList()

GWEN_PLUGIN_DESCRIPTION_LIST2 * _getPluginDescrsFromPluginList ( GWEN_PLUGIN_MANAGER pm)
static

◆ _loadPluginDescrs()

GWEN_PLUGIN_DESCRIPTION_LIST2 * _loadPluginDescrs ( GWEN_PLUGIN_MANAGER pm)
static

◆ _searchAndLoadModule()

GWEN_LIBLOADER * _searchAndLoadModule ( GWEN_PLUGIN_MANAGER pm,
const char *  modname 
)
static

◆ _setLibLoader()

void _setLibLoader ( GWEN_PLUGIN p,
GWEN_LIBLOADER ll 
)
static

Definition at line 162 of file plugin.c.

Referenced by GWEN_PluginManager_LoadPlugin(), and GWEN_PluginManager_LoadPluginFile().

Here is the caller graph for this function:

◆ GWEN_Plugin_Attach()

void GWEN_Plugin_Attach ( GWEN_PLUGIN p)

Definition at line 120 of file plugin.c.

References DBG_MEM_INC.

◆ GWEN_Plugin_free()

void GWEN_Plugin_free ( GWEN_PLUGIN p)

Definition at line 98 of file plugin.c.

References DBG_MEM_DEC, GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, GWEN_LibLoader_CloseLibrary(), GWEN_LibLoader_free(), GWEN_LIST_FINI, and GWEN_PluginDescription_free().

Here is the call graph for this function:

◆ GWEN_Plugin_GetFileName()

const char* GWEN_Plugin_GetFileName ( const GWEN_PLUGIN p)

Definition at line 146 of file plugin.c.

◆ GWEN_Plugin_GetLibLoader()

GWEN_LIBLOADER* GWEN_Plugin_GetLibLoader ( const GWEN_PLUGIN p)

Definition at line 154 of file plugin.c.

◆ GWEN_Plugin_GetManager()

GWEN_PLUGIN_MANAGER* GWEN_Plugin_GetManager ( const GWEN_PLUGIN p)

Definition at line 130 of file plugin.c.

Referenced by GWEN_Crypt_TokenOHBCI_Plugin_CreateToken().

Here is the caller graph for this function:

◆ GWEN_Plugin_GetName()

const char* GWEN_Plugin_GetName ( const GWEN_PLUGIN p)

Definition at line 138 of file plugin.c.

Referenced by _checkPlugin(), and GWEN_PluginManager_AddPlugin().

Here is the caller graph for this function:

◆ GWEN_Plugin_GetPluginDescription()

const GWEN_PLUGIN_DESCRIPTION* GWEN_Plugin_GetPluginDescription ( const GWEN_PLUGIN p)

Definition at line 170 of file plugin.c.

Referenced by _getPluginDescrsFromPluginList(), and GWEN_PluginManager_AddPlugin().

Here is the caller graph for this function:

◆ GWEN_Plugin_ModuleFini()

int GWEN_Plugin_ModuleFini ( void  )

Definition at line 69 of file plugin.c.

References gwen_plugin_manager__list.

Referenced by GWEN_Fini().

Here is the caller graph for this function:

◆ GWEN_Plugin_ModuleInit()

int GWEN_Plugin_ModuleInit ( void  )

Definition at line 61 of file plugin.c.

References gwen_plugin_manager__list.

Referenced by GWEN_Init().

Here is the caller graph for this function:

◆ GWEN_Plugin_new()

GWEN_PLUGIN* GWEN_Plugin_new ( GWEN_PLUGIN_MANAGER pm,
const char *  name,
const char *  fileName 
)

Definition at line 77 of file plugin.c.

References DBG_MEM_INC, GWEN_INHERIT_INIT, GWEN_LIST_INIT, and GWEN_NEW_OBJECT.

Referenced by GWEN_ConfigMgr_Plugin_new(), GWEN_Crypt_Token_Plugin_new(), and GWEN_DBIO_Plugin_new().

Here is the caller graph for this function:

◆ GWEN_Plugin_SetPluginDescription()

void GWEN_Plugin_SetPluginDescription ( GWEN_PLUGIN p,
GWEN_PLUGIN_DESCRIPTION pd 
)

Definition at line 178 of file plugin.c.

References GWEN_PluginDescription_free().

Referenced by _createPluginFromLibloader(), and GWEN_PluginManager_AddPlugin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginManager_AddPath()

int GWEN_PluginManager_AddPath ( GWEN_PLUGIN_MANAGER pm,
const char *  callingLib,
const char *  path 
)

Add a directory path to lookup plugins from. The plugin manager must already be registered with Gwen (using GWEN_PluginManager_Register) otherwise the path can not be added

Definition at line 234 of file plugin.c.

References GWEN_PathManager_AddPath().

Referenced by GWEN_ConfigMgr_ModuleInit(), GWEN_Crypt_Token_ModuleInit(), and GWEN_DBIO_ModuleInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginManager_AddPathFromWinReg()

int GWEN_PluginManager_AddPathFromWinReg ( GWEN_UNUSED GWEN_PLUGIN_MANAGER pm,
GWEN_UNUSED const char *  callingLib,
GWEN_UNUSED const char *  keypath,
GWEN_UNUSED const char *  varname 
)

Definition at line 329 of file plugin.c.

◆ GWEN_PluginManager_AddPlugin()

void GWEN_PluginManager_AddPlugin ( GWEN_PLUGIN_MANAGER pm,
GWEN_PLUGIN p 
)

Add a plugin to this plugin manager. Normally plugins are loaded upon GWEN_PluginManager_GetPlugin. This function allows for plugins that are created by other means (e.g. by static linking)

Definition at line 677 of file plugin.c.

References DBG_ERROR, DBG_INFO, GWEN_LOGDOMAIN, GWEN_Plugin_GetName(), GWEN_Plugin_GetPluginDescription(), GWEN_Plugin_SetPluginDescription(), GWEN_PluginDescription_new(), GWEN_PluginDescription_SetName(), GWEN_PluginDescription_SetType(), and NULL.

Here is the call graph for this function:

◆ GWEN_PluginManager_AddRelPath()

int GWEN_PluginManager_AddRelPath ( GWEN_PLUGIN_MANAGER pm,
const char *  callingLib,
const char *  s,
GWEN_PATHMANAGER_RELMODE  rm 
)

Definition at line 242 of file plugin.c.

References GWEN_PathManager_AddRelPath().

Here is the call graph for this function:

◆ GWEN_PluginManager_FindPluginManager()

GWEN_PLUGIN_MANAGER* GWEN_PluginManager_FindPluginManager ( const char *  s)

◆ GWEN_PluginManager_free()

void GWEN_PluginManager_free ( GWEN_PLUGIN_MANAGER pm)

Definition at line 211 of file plugin.c.

References DBG_MEM_DEC, GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, and GWEN_LIST_FINI.

Referenced by GWEN_ConfigMgr_ModuleFini(), GWEN_Crypt_Token_ModuleFini(), and GWEN_DBIO_ModuleFini().

Here is the caller graph for this function:

◆ GWEN_PluginManager_GetName()

const char* GWEN_PluginManager_GetName ( const GWEN_PLUGIN_MANAGER pm)

Definition at line 226 of file plugin.c.

◆ GWEN_PluginManager_GetPaths()

GWEN_STRINGLIST* GWEN_PluginManager_GetPaths ( const GWEN_PLUGIN_MANAGER pm)

Returns the list of all search paths of the given PluginManager.

Definition at line 648 of file plugin.c.

References GWEN_PathManager_GetPaths().

Here is the call graph for this function:

◆ GWEN_PluginManager_GetPlugin()

GWEN_PLUGIN* GWEN_PluginManager_GetPlugin ( GWEN_PLUGIN_MANAGER pm,
const char *  s 
)

Definition at line 522 of file plugin.c.

References _findPluginInListByName(), DBG_INFO, GWEN_LOGDOMAIN, and GWEN_PluginManager_LoadPlugin().

Referenced by createToken(), cryptWithNew(), getCryptToken(), GWEN_ConfigMgr_Factory(), GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_DBIO_GetPlugin(), and signWithNew().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginManager_GetPluginDescr()

GWEN_PLUGIN_DESCRIPTION* GWEN_PluginManager_GetPluginDescr ( GWEN_PLUGIN_MANAGER pm,
const char *  modName 
)

◆ GWEN_PluginManager_GetPluginDescrs()

GWEN_PLUGIN_DESCRIPTION_LIST2* GWEN_PluginManager_GetPluginDescrs ( GWEN_PLUGIN_MANAGER pm)

Definition at line 623 of file plugin.c.

References _combinedPluginDescrList(), _getPluginDescrsFromPluginList(), _loadPluginDescrs(), and GWEN_PluginDescription_List2_freeAll().

Referenced by GWEN_Crypt_Token_PluginManager_GetPluginDescrs(), and GWEN_PluginManager_GetPluginDescr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginManager_InsertPath()

int GWEN_PluginManager_InsertPath ( GWEN_PLUGIN_MANAGER pm,
const char *  callingLib,
const char *  path 
)

Insert a directory path to lookup plugins from. The plugin manager must already be registered with Gwen (using GWEN_PluginManager_Register) otherwise the path can not be added.

Definition at line 250 of file plugin.c.

References GWEN_PathManager_InsertPath().

Here is the call graph for this function:

◆ GWEN_PluginManager_InsertRelPath()

int GWEN_PluginManager_InsertRelPath ( GWEN_PLUGIN_MANAGER pm,
const char *  callingLib,
const char *  relpath,
GWEN_PATHMANAGER_RELMODE  rm 
)

Insert a directory path to lookup plugins from. The plugin manager must already be registered with Gwen (using GWEN_PluginManager_Register) otherwise the path can not be added. This function uses relative paths.

Definition at line 258 of file plugin.c.

References GWEN_PathManager_InsertRelPath().

Here is the call graph for this function:

◆ GWEN_PluginManager_LoadPlugin()

GWEN_PLUGIN* GWEN_PluginManager_LoadPlugin ( GWEN_PLUGIN_MANAGER pm,
const char *  modname 
)

Definition at line 340 of file plugin.c.

References _createPluginFromLibloader(), _searchAndLoadModule(), _setLibLoader(), DBG_INFO, GWEN_LibLoader_CloseLibrary(), GWEN_LibLoader_free(), GWEN_LOGDOMAIN, and NULL.

Referenced by GWEN_PluginManager_GetPlugin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginManager_LoadPluginFile()

GWEN_PLUGIN* GWEN_PluginManager_LoadPluginFile ( GWEN_PLUGIN_MANAGER pm,
const char *  modname,
const char *  fname 
)

◆ GWEN_PluginManager_new()

GWEN_PLUGIN_MANAGER* GWEN_PluginManager_new ( const char *  name,
const char *  destLib 
)
Parameters
destLibThe name of the library that this plugin is supposed to belong to.

Definition at line 192 of file plugin.c.

References DBG_MEM_INC, GWEN_INHERIT_INIT, GWEN_LIST_INIT, and GWEN_NEW_OBJECT.

Referenced by GWEN_ConfigMgr_ModuleInit(), GWEN_Crypt_Token_ModuleInit(), and GWEN_DBIO_ModuleInit().

Here is the caller graph for this function:

◆ GWEN_PluginManager_Register()

int GWEN_PluginManager_Register ( GWEN_PLUGIN_MANAGER pm)

Definition at line 561 of file plugin.c.

References DBG_ERROR, DBG_INFO, GWEN_LOGDOMAIN, GWEN_PathManager_DefinePath(), gwen_plugin_manager__list, and GWEN_PluginManager_FindPluginManager().

Referenced by GWEN_ConfigMgr_ModuleInit(), GWEN_Crypt_Token_ModuleInit(), and GWEN_DBIO_ModuleInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginManager_RemovePath()

int GWEN_PluginManager_RemovePath ( GWEN_PLUGIN_MANAGER pm,
const char *  callingLib,
const char *  s 
)

Definition at line 266 of file plugin.c.

References GWEN_PathManager_RemovePath().

Here is the call graph for this function:

◆ GWEN_PluginManager_Unregister()

int GWEN_PluginManager_Unregister ( GWEN_PLUGIN_MANAGER pm)

Definition at line 592 of file plugin.c.

References DBG_ERROR, DBG_INFO, GWEN_LOGDOMAIN, GWEN_PathManager_UndefinePath(), gwen_plugin_manager__list, and GWEN_PluginManager_FindPluginManager().

Referenced by GWEN_ConfigMgr_ModuleFini(), GWEN_Crypt_Token_ModuleFini(), and GWEN_DBIO_ModuleFini().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gwen_plugin_manager__list

GWEN_PLUGIN_MANAGER_LIST* gwen_plugin_manager__list =0
static