gwenhywfar  5.11.1beta
Typedefs | Functions
plugin.h File Reference
#include <gwenhywfar/inherit.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/error.h>
#include <gwenhywfar/libloader.h>
#include <gwenhywfar/plugindescr.h>
#include <gwenhywfar/stringlist.h>
#include <gwenhywfar/pathmanager.h>

Go to the source code of this file.

Typedefs

typedef struct GWEN_PLUGIN GWEN_PLUGIN
 
typedef GWEN_PLUGIN *(* GWEN_PLUGIN_FACTORYFN) (GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
 
typedef struct GWEN_PLUGIN_MANAGER GWEN_PLUGIN_MANAGER
 

Functions

GWENHYWFAR_API void GWEN_Plugin_free (GWEN_PLUGIN *p)
 
GWENHYWFAR_API const char * GWEN_Plugin_GetFileName (const GWEN_PLUGIN *p)
 
GWENHYWFAR_API GWEN_LIBLOADERGWEN_Plugin_GetLibLoader (const GWEN_PLUGIN *p)
 
GWENHYWFAR_API GWEN_PLUGIN_MANAGERGWEN_Plugin_GetManager (const GWEN_PLUGIN *p)
 
GWENHYWFAR_API const char * GWEN_Plugin_GetName (const GWEN_PLUGIN *p)
 
GWENHYWFAR_API const GWEN_PLUGIN_DESCRIPTIONGWEN_Plugin_GetPluginDescription (const GWEN_PLUGIN *p)
 
GWENHYWFAR_API GWEN_PLUGINGWEN_Plugin_new (GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
 
GWENHYWFAR_API void GWEN_Plugin_SetPluginDescription (GWEN_PLUGIN *p, GWEN_PLUGIN_DESCRIPTION *pd)
 
GWENHYWFAR_API int GWEN_PluginManager_AddPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *path)
 
GWENHYWFAR_API int GWEN_PluginManager_AddPathFromWinReg (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *keypath, const char *varname)
 
GWENHYWFAR_API void GWEN_PluginManager_AddPlugin (GWEN_PLUGIN_MANAGER *pm, GWEN_PLUGIN *p)
 
GWENHYWFAR_API int GWEN_PluginManager_AddRelPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *relpath, GWEN_PATHMANAGER_RELMODE rm)
 
GWENHYWFAR_API GWEN_PLUGIN_MANAGERGWEN_PluginManager_FindPluginManager (const char *s)
 
GWENHYWFAR_API void GWEN_PluginManager_free (GWEN_PLUGIN_MANAGER *pm)
 
GWENHYWFAR_API const char * GWEN_PluginManager_GetName (const GWEN_PLUGIN_MANAGER *pm)
 
GWENHYWFAR_API GWEN_STRINGLISTGWEN_PluginManager_GetPaths (const GWEN_PLUGIN_MANAGER *pm)
 
GWENHYWFAR_API GWEN_PLUGINGWEN_PluginManager_GetPlugin (GWEN_PLUGIN_MANAGER *pm, const char *s)
 
GWENHYWFAR_API GWEN_PLUGIN_DESCRIPTIONGWEN_PluginManager_GetPluginDescr (GWEN_PLUGIN_MANAGER *pm, const char *modName)
 
GWENHYWFAR_API GWEN_PLUGIN_DESCRIPTION_LIST2GWEN_PluginManager_GetPluginDescrs (GWEN_PLUGIN_MANAGER *pm)
 
GWENHYWFAR_API int GWEN_PluginManager_InsertPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *path)
 
GWENHYWFAR_API int GWEN_PluginManager_InsertRelPath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *relpath, GWEN_PATHMANAGER_RELMODE rm)
 
GWENHYWFAR_API GWEN_PLUGINGWEN_PluginManager_LoadPlugin (GWEN_PLUGIN_MANAGER *pm, const char *modName)
 
GWENHYWFAR_API GWEN_PLUGINGWEN_PluginManager_LoadPluginFile (GWEN_PLUGIN_MANAGER *pm, const char *modName, const char *fname)
 
GWENHYWFAR_API GWEN_PLUGIN_MANAGERGWEN_PluginManager_new (const char *name, const char *destLib)
 
GWENHYWFAR_API int GWEN_PluginManager_Register (GWEN_PLUGIN_MANAGER *pm)
 
GWENHYWFAR_API int GWEN_PluginManager_RemovePath (GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *path)
 
GWENHYWFAR_API int GWEN_PluginManager_Unregister (GWEN_PLUGIN_MANAGER *pm)
 

Typedef Documentation

◆ GWEN_PLUGIN

typedef struct GWEN_PLUGIN GWEN_PLUGIN

Definition at line 1 of file plugin.h.

◆ GWEN_PLUGIN_FACTORYFN

typedef GWEN_PLUGIN*(* GWEN_PLUGIN_FACTORYFN) (GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)

Definition at line 59 of file plugin.h.

◆ GWEN_PLUGIN_MANAGER

Definition at line 1 of file plugin.h.

Function Documentation

◆ GWEN_Plugin_free()

GWENHYWFAR_API void GWEN_Plugin_free ( GWEN_PLUGIN p)

◆ GWEN_Plugin_GetFileName()

GWENHYWFAR_API const char* GWEN_Plugin_GetFileName ( const GWEN_PLUGIN p)

◆ GWEN_Plugin_GetLibLoader()

GWENHYWFAR_API GWEN_LIBLOADER* GWEN_Plugin_GetLibLoader ( const GWEN_PLUGIN p)

◆ GWEN_Plugin_GetManager()

GWENHYWFAR_API GWEN_PLUGIN_MANAGER* GWEN_Plugin_GetManager ( const GWEN_PLUGIN p)

◆ GWEN_Plugin_GetName()

GWENHYWFAR_API const char* GWEN_Plugin_GetName ( const GWEN_PLUGIN p)

◆ GWEN_Plugin_GetPluginDescription()

GWENHYWFAR_API const GWEN_PLUGIN_DESCRIPTION* GWEN_Plugin_GetPluginDescription ( const GWEN_PLUGIN p)

◆ GWEN_Plugin_new()

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

◆ GWEN_Plugin_SetPluginDescription()

GWENHYWFAR_API void GWEN_Plugin_SetPluginDescription ( GWEN_PLUGIN p,
GWEN_PLUGIN_DESCRIPTION pd 
)

◆ GWEN_PluginManager_AddPath()

GWENHYWFAR_API 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

◆ GWEN_PluginManager_AddPathFromWinReg()

GWENHYWFAR_API 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.

Returns
Zero on success, and non-zero on error.
Parameters
pmThe PluginManager
keypathThe path to the registry key, e.g. "Software\\MySoftware\\Whatever"
varnameThe key name (variable name?) inside the given registry key, e.g. "myvariable".

◆ GWEN_PluginManager_AddPlugin()

GWENHYWFAR_API 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)

◆ GWEN_PluginManager_AddRelPath()

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

◆ GWEN_PluginManager_FindPluginManager()

GWENHYWFAR_API GWEN_PLUGIN_MANAGER* GWEN_PluginManager_FindPluginManager ( const char *  s)

◆ GWEN_PluginManager_free()

GWENHYWFAR_API void GWEN_PluginManager_free ( GWEN_PLUGIN_MANAGER pm)

◆ GWEN_PluginManager_GetName()

GWENHYWFAR_API const char* GWEN_PluginManager_GetName ( const GWEN_PLUGIN_MANAGER pm)

◆ GWEN_PluginManager_GetPaths()

GWENHYWFAR_API GWEN_STRINGLIST* GWEN_PluginManager_GetPaths ( const GWEN_PLUGIN_MANAGER pm)

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

◆ GWEN_PluginManager_GetPlugin()

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

◆ GWEN_PluginManager_GetPluginDescr()

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

◆ GWEN_PluginManager_GetPluginDescrs()

GWENHYWFAR_API GWEN_PLUGIN_DESCRIPTION_LIST2* GWEN_PluginManager_GetPluginDescrs ( GWEN_PLUGIN_MANAGER pm)

◆ GWEN_PluginManager_InsertPath()

GWENHYWFAR_API 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.

◆ GWEN_PluginManager_InsertRelPath()

GWENHYWFAR_API 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.

◆ GWEN_PluginManager_LoadPlugin()

GWENHYWFAR_API GWEN_PLUGIN* GWEN_PluginManager_LoadPlugin ( GWEN_PLUGIN_MANAGER pm,
const char *  modName 
)

◆ GWEN_PluginManager_LoadPluginFile()

GWENHYWFAR_API GWEN_PLUGIN* GWEN_PluginManager_LoadPluginFile ( GWEN_PLUGIN_MANAGER pm,
const char *  modName,
const char *  fname 
)

◆ GWEN_PluginManager_new()

GWENHYWFAR_API 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.

◆ GWEN_PluginManager_Register()

GWENHYWFAR_API int GWEN_PluginManager_Register ( GWEN_PLUGIN_MANAGER pm)

◆ GWEN_PluginManager_RemovePath()

GWENHYWFAR_API int GWEN_PluginManager_RemovePath ( GWEN_PLUGIN_MANAGER pm,
const char *  callingLib,
const char *  path 
)

◆ GWEN_PluginManager_Unregister()

GWENHYWFAR_API int GWEN_PluginManager_Unregister ( GWEN_PLUGIN_MANAGER pm)