#include "plugin_p.h"
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/directory.h>
#include <gwenhywfar/pathmanager.h>
#include <gwenhywfar/gwenhywfar.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
Go to the source code of this file.
void GWEN_Plugin_Attach | ( | GWEN_PLUGIN * | p | ) |
void GWEN_Plugin_free | ( | GWEN_PLUGIN * | p | ) |
Definition at line 101 of file plugin.c.
References DBG_MEM_DEC, GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, GWEN_LibLoader_CloseLibrary(), GWEN_LibLoader_free(), and GWEN_LIST_FINI.
const char* GWEN_Plugin_GetFileName | ( | const GWEN_PLUGIN * | p | ) |
GWEN_LIBLOADER* GWEN_Plugin_GetLibLoader | ( | const GWEN_PLUGIN * | p | ) |
GWEN_PLUGIN_MANAGER* GWEN_Plugin_GetManager | ( | const GWEN_PLUGIN * | p | ) |
const char* GWEN_Plugin_GetName | ( | const GWEN_PLUGIN * | p | ) |
int GWEN_Plugin_ModuleFini | ( | ) |
Definition at line 72 of file plugin.c.
References gwen_plugin_manager__list.
Referenced by GWEN_Fini().
int GWEN_Plugin_ModuleInit | ( | ) |
Definition at line 65 of file plugin.c.
References gwen_plugin_manager__list.
Referenced by GWEN_Init().
GWEN_PLUGIN* GWEN_Plugin_new | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | name, | |||
const char * | fileName | |||
) |
Definition at line 79 of file plugin.c.
References DBG_MEM_INC, GWEN_INHERIT_INIT, GWEN_LIST_INIT, and GWEN_NEW_OBJECT.
Referenced by GWEN_Crypt_Token_Plugin_new(), and GWEN_DBIO_Plugin_new().
void GWEN_Plugin_SetLibLoader | ( | GWEN_PLUGIN * | p, | |
GWEN_LIBLOADER * | ll | |||
) |
Definition at line 158 of file plugin.c.
Referenced by GWEN_PluginManager_LoadPlugin(), and GWEN_PluginManager_LoadPluginFile().
GWEN_PLUGIN* GWEN_PluginManager__FindPlugin | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | s | |||
) |
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 210 of file plugin.c.
References GWEN_PathManager_AddPath().
Referenced by GWEN_Crypt_Token_ModuleInit(), and GWEN_DBIO_ModuleInit().
int GWEN_PluginManager_AddPathFromWinReg | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | callingLib, | |||
const char * | keypath, | |||
const char * | varname | |||
) |
Add a directory path from the windows registry HKEY_LOCAL_MACHINE, to lookup plugins from. On Non-Windows systems, this function does nothing and returns zero.
Note: Gwenhywfar-2.6.0 and older used to lookup the paths under HKEY_CURRENT_USER, but with gwen-2.6.1 this was changed to HKEY_LOCAL_MACHINE because we're talking about installation paths as opposed to per-user configuration settings.
The plugin manager must already be registered with Gwen (using GWEN_PluginManager_Register) otherwise the path can not be added.
pm | The PluginManager | |
keypath | The path to the registry key, e.g. "Software\\MySoftware\\Whatever" | |
varname | The key name (variable name?) inside the given registry key, e.g. "myvariable". |
Definition at line 260 of file plugin.c.
References DBG_INFO, GWEN_LOGDOMAIN, GWEN_PathManager_AddPath(), and MAX_PATH.
int GWEN_PluginManager_AddRelPath | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | callingLib, | |||
const char * | s, | |||
GWEN_PATHMANAGER_RELMODE | rm | |||
) |
GWEN_PLUGIN_MANAGER* GWEN_PluginManager_FindPluginManager | ( | const char * | s | ) |
Definition at line 498 of file plugin.c.
References gwen_plugin_manager__list.
Referenced by GWEN_Crypt_Token_ModuleFini(), GWEN_DBIO_GetPlugin(), GWEN_DBIO_ModuleFini(), GWEN_PluginManager_Register(), and GWEN_PluginManager_Unregister().
void GWEN_PluginManager_free | ( | GWEN_PLUGIN_MANAGER * | pm | ) |
Definition at line 189 of file plugin.c.
References DBG_MEM_DEC, GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, and GWEN_LIST_FINI.
Referenced by GWEN_Crypt_Token_ModuleFini(), and GWEN_DBIO_ModuleFini().
const char* GWEN_PluginManager_GetName | ( | const GWEN_PLUGIN_MANAGER * | pm | ) |
GWEN_STRINGLIST* GWEN_PluginManager_GetPaths | ( | const GWEN_PLUGIN_MANAGER * | pm | ) |
Returns the list of all search paths of the given PluginManager.
Definition at line 617 of file plugin.c.
References GWEN_PathManager_GetPaths().
GWEN_PLUGIN* GWEN_PluginManager_GetPlugin | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | s | |||
) |
Definition at line 480 of file plugin.c.
References DBG_INFO, GWEN_LOGDOMAIN, GWEN_PluginManager__FindPlugin(), and GWEN_PluginManager_LoadPlugin().
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), and GWEN_DBIO_GetPlugin().
GWEN_PLUGIN_DESCRIPTION* GWEN_PluginManager_GetPluginDescr | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | modName | |||
) |
Definition at line 625 of file plugin.c.
References GWEN_PluginDescription_dup(), GWEN_PluginDescription_GetName(), GWEN_PluginDescription_List2_First(), GWEN_PluginDescription_List2_freeAll(), GWEN_PluginDescription_List2Iterator_Data(), GWEN_PluginDescription_List2Iterator_free(), GWEN_PluginDescription_List2Iterator_Next(), and GWEN_PluginManager_GetPluginDescrs().
GWEN_PLUGIN_DESCRIPTION_LIST2* GWEN_PluginManager_GetPluginDescrs | ( | GWEN_PLUGIN_MANAGER * | pm | ) |
Definition at line 574 of file plugin.c.
References DBG_ERROR, DBG_INFO, GWEN_LoadPluginDescrsByType(), GWEN_LOGDOMAIN, GWEN_PathManager_GetPaths(), GWEN_PluginDescription_List2_free(), GWEN_PluginDescription_List2_GetSize(), GWEN_PluginDescription_List2_new(), GWEN_StringList_FirstEntry(), GWEN_StringList_free(), GWEN_StringListEntry_Data(), GWEN_StringListEntry_Next(), and NULL.
Referenced by GWEN_Crypt_Token_PluginManager_GetPluginDescrs(), and GWEN_PluginManager_GetPluginDescr().
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 236 of file plugin.c.
References GWEN_PathManager_InsertPath().
GWEN_PLUGIN* GWEN_PluginManager_LoadPlugin | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | modname | |||
) |
Definition at line 319 of file plugin.c.
References DBG_DEBUG, DBG_ERROR, DBG_ERROR_ERR, GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_LibLoader_CloseLibrary(), GWEN_LibLoader_free(), GWEN_LibLoader_new(), GWEN_LibLoader_OpenLibraryWithPath(), GWEN_LibLoader_Resolve(), GWEN_LOGDOMAIN, GWEN_PathManager_GetPaths(), GWEN_Plugin_SetLibLoader(), GWEN_StringList_FirstEntry(), GWEN_StringList_free(), GWEN_StringListEntry_Data(), GWEN_StringListEntry_Next(), and NULL.
Referenced by GWEN_PluginManager_GetPlugin().
GWEN_PLUGIN* GWEN_PluginManager_LoadPluginFile | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | modname, | |||
const char * | fname | |||
) |
Definition at line 406 of file plugin.c.
References DBG_INFO, DBG_INFO_ERR, GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_LibLoader_CloseLibrary(), GWEN_LibLoader_free(), GWEN_LibLoader_new(), GWEN_LibLoader_OpenLibrary(), GWEN_LibLoader_Resolve(), GWEN_LOGDOMAIN, and GWEN_Plugin_SetLibLoader().
GWEN_PLUGIN_MANAGER* GWEN_PluginManager_new | ( | const char * | name, | |
const char * | destLib | |||
) |
destLib | The name of the library that this plugin is supposed to belong to. |
Definition at line 170 of file plugin.c.
References DBG_MEM_INC, GWEN_INHERIT_INIT, GWEN_LIST_INIT, and GWEN_NEW_OBJECT.
Referenced by GWEN_Crypt_Token_ModuleInit(), and GWEN_DBIO_ModuleInit().
int GWEN_PluginManager_Register | ( | GWEN_PLUGIN_MANAGER * | pm | ) |
Definition at line 513 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_Crypt_Token_ModuleInit(), and GWEN_DBIO_ModuleInit().
int GWEN_PluginManager_RemovePath | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | callingLib, | |||
const char * | s | |||
) |
int GWEN_PluginManager_Unregister | ( | GWEN_PLUGIN_MANAGER * | pm | ) |
Definition at line 543 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_Crypt_Token_ModuleFini(), and GWEN_DBIO_ModuleFini().
GWEN_PLUGIN_MANAGER_LIST* gwen_plugin_manager__list = 0 [static] |
Definition at line 55 of file plugin.c.
Referenced by GWEN_Plugin_ModuleFini(), GWEN_Plugin_ModuleInit(), GWEN_PluginManager_FindPluginManager(), GWEN_PluginManager_Register(), and GWEN_PluginManager_Unregister().