33#include <gwenhywfar/buffer.h>
34#include <gwenhywfar/debug.h>
35#include <gwenhywfar/directory.h>
36#include <gwenhywfar/pathmanager.h>
37#include <gwenhywfar/gwenhywfar.h>
97 p->fileName=strdup(fileName);
109 if (--(p->refCount)==0) {
191 pm->name=strdup(name);
192 pm->destLib=strdup(destLib);
193 pm->plugins=GWEN_Plugin_List_new();
204 GWEN_Plugin_List_free(pm->plugins);
224 const char *callingLib,
237 const char *callingLib,
252 const char *callingLib,
265 const char *callingLib,
280 const char *callingLib,
294 const char *callingLib,
308 snprintf(nbuffer,
sizeof(nbuffer), keypath);
311 if (RegOpenKey(HKEY_LOCAL_MACHINE, nbuffer, &hkey)) {
318 nsize=
sizeof(nbuffer);
319 vsize=
sizeof(vbuffer);
320 if (ERROR_SUCCESS!=RegEnumValue(hkey,
329 if (strcasecmp(nbuffer, varname)==0 && typ==REG_SZ) {
341 "In RegKey \"%s\" the variable \"%s\" does not exist",
396 "Could not load plugin \"%s\" from \"%s\"", modname, fname);
434 plugin=fn(pm, modname, fname);
466 "Could not load plugin \"%s\" (%s)", modname, fname);
495 plugin=fn(pm, modname, fname);
517 p=GWEN_Plugin_List_First(pm->plugins);
519 if (strcasecmp(p->name, s)==0)
521 p=GWEN_Plugin_List_Next(p);
539 GWEN_Plugin_List_Add(p, pm->plugins);
554 if (strcasecmp(pm->name, s)==0)
556 pm=GWEN_PluginManager_List_Next(pm);
574 "Plugin type \"%s\" already registered",
582 pm->destLib, pm->name);
588 "Plugin type \"%s\" registered",
605 "Plugin type \"%s\" not registered",
613 pm->destLib, pm->name);
617 GWEN_PluginManager_List_Del(pm);
619 "Plugin type \"%s\" unregistered",
654 "Error loading plugin description in \"%s\"", path);
718 DBG_ERROR(0,
"Adding plugin [%s] of type [%s]",
721 GWEN_Plugin_List_Add(p, pm->plugins);
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
#define DBG_MEM_INC(o, attach)
#define DBG_DEBUG(dbg_logger, format, args...)
#define DBG_INFO_ERR(dbg_logger, dbg_err)
#define DBG_ERROR_ERR(dbg_logger, dbg_err)
#define DBG_INFO(dbg_logger, format, args...)
#define DBG_ERROR(dbg_logger, format, args...)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
#define GWEN_INHERIT_FUNCTIONS(t)
#define GWEN_INHERIT_INIT(t, element)
#define GWEN_INHERIT_FINI(t, element)
GWENHYWFAR_API int GWEN_LibLoader_OpenLibraryWithPath(GWEN_LIBLOADER *h, const char *path, const char *name)
GWENHYWFAR_API GWEN_LIBLOADER * GWEN_LibLoader_new(void)
GWENHYWFAR_API int GWEN_LibLoader_OpenLibrary(GWEN_LIBLOADER *h, const char *name)
GWENHYWFAR_API int GWEN_LibLoader_CloseLibrary(GWEN_LIBLOADER *h)
GWENHYWFAR_API int GWEN_LibLoader_Resolve(GWEN_LIBLOADER *h, const char *name, void **p)
GWENHYWFAR_API void GWEN_LibLoader_free(GWEN_LIBLOADER *h)
struct GWEN_LIBLOADER GWEN_LIBLOADER
#define GWEN_LIST_FINI(t, element)
#define GWEN_LIST_FUNCTIONS(t, pr)
#define GWEN_LIST_INIT(t, element)
struct GWEN_PLUGIN_DESCRIPTION_LIST2 GWEN_PLUGIN_DESCRIPTION_LIST2
unsigned int GWEN_PluginDescription_List2_GetSize(GWEN_PLUGIN_DESCRIPTION_LIST2 *l)
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_List2Iterator_Data(GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *li)
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_List2Iterator_Next(GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *li)
GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR * GWEN_PluginDescription_List2_First(GWEN_PLUGIN_DESCRIPTION_LIST2 *l)
struct GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR
void GWEN_PluginDescription_List2Iterator_free(GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *li)
void GWEN_PluginDescription_List2_free(GWEN_PLUGIN_DESCRIPTION_LIST2 *l)
GWEN_PLUGIN_DESCRIPTION_LIST2 * GWEN_PluginDescription_List2_new()
#define GWEN_FREE_OBJECT(varname)
#define GWEN_NEW_OBJECT(typ, varname)
int GWEN_PathManager_AddRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
int GWEN_PathManager_InsertPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
GWEN_STRINGLIST * GWEN_PathManager_GetPaths(const char *destLib, const char *pathName)
int GWEN_PathManager_RemovePath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
int GWEN_PathManager_UndefinePath(const char *destLib, const char *pathName)
int GWEN_PathManager_AddPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
int GWEN_PathManager_InsertRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
int GWEN_PathManager_DefinePath(const char *destLib, const char *pathName)
int GWEN_Plugin_ModuleFini(void)
GWEN_PLUGIN_MANAGER * GWEN_PluginManager_new(const char *name, const char *destLib)
GWEN_PLUGIN_DESCRIPTION_LIST2 * GWEN_PluginManager_GetPluginDescrs(GWEN_PLUGIN_MANAGER *pm)
const char * GWEN_PluginManager_GetName(const GWEN_PLUGIN_MANAGER *pm)
int GWEN_PluginManager_RemovePath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
GWEN_LIBLOADER * GWEN_Plugin_GetLibLoader(const GWEN_PLUGIN *p)
void GWEN_PluginManager_AddPlugin(GWEN_PLUGIN_MANAGER *pm, GWEN_PLUGIN *p)
GWEN_PLUGIN * GWEN_PluginManager_LoadPluginFile(GWEN_PLUGIN_MANAGER *pm, const char *modname, const char *fname)
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_free(GWEN_PLUGIN_MANAGER *pm)
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 *s)
int GWEN_PluginManager_InsertPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
GWEN_PLUGIN_MANAGER * GWEN_PluginManager_FindPluginManager(const char *s)
int GWEN_PluginManager_Unregister(GWEN_PLUGIN_MANAGER *pm)
int GWEN_Plugin_ModuleInit(void)
GWEN_PLUGIN * GWEN_PluginManager_GetPlugin(GWEN_PLUGIN_MANAGER *pm, const char *s)
void GWEN_Plugin_SetLibLoader(GWEN_PLUGIN *p, GWEN_LIBLOADER *ll)
GWEN_PLUGIN_MANAGER * GWEN_Plugin_GetManager(const GWEN_PLUGIN *p)
static GWEN_PLUGIN_MANAGER_LIST * gwen_plugin_manager__list
int GWEN_PluginManager_InsertRelPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *relpath, GWEN_PATHMANAGER_RELMODE rm)
void GWEN_Plugin_Attach(GWEN_PLUGIN *p)
GWEN_PLUGIN * GWEN_Plugin_new(GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
void GWEN_Plugin_free(GWEN_PLUGIN *p)
const char * GWEN_Plugin_GetName(const GWEN_PLUGIN *p)
const char * GWEN_Plugin_GetFileName(const GWEN_PLUGIN *p)
GWEN_STRINGLIST * GWEN_PluginManager_GetPaths(const GWEN_PLUGIN_MANAGER *pm)
int GWEN_PluginManager_Register(GWEN_PLUGIN_MANAGER *pm)
int GWEN_PluginManager_AddRelPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s, GWEN_PATHMANAGER_RELMODE rm)
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginManager_GetPluginDescr(GWEN_PLUGIN_MANAGER *pm, const char *modName)
GWEN_PLUGIN * GWEN_PluginManager_LoadPlugin(GWEN_PLUGIN_MANAGER *pm, const char *modname)
struct GWEN_PLUGIN_MANAGER GWEN_PLUGIN_MANAGER
GWEN_PLUGIN *(* GWEN_PLUGIN_FACTORYFN)(GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
struct GWEN_PLUGIN GWEN_PLUGIN
void GWEN_PluginDescription_List2_freeAll(GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
int GWEN_LoadPluginDescrsByType(const char *path, const char *type, GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
const char * GWEN_PluginDescription_GetName(const GWEN_PLUGIN_DESCRIPTION *pd)
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_dup(const GWEN_PLUGIN_DESCRIPTION *pd)
struct GWEN_PLUGIN_DESCRIPTION GWEN_PLUGIN_DESCRIPTION
void GWEN_StringList_free(GWEN_STRINGLIST *sl)
const char * GWEN_StringListEntry_Data(const GWEN_STRINGLISTENTRY *se)
GWEN_STRINGLISTENTRY * GWEN_StringListEntry_Next(const GWEN_STRINGLISTENTRY *se)
GWEN_STRINGLISTENTRY * GWEN_StringList_FirstEntry(const GWEN_STRINGLIST *sl)
struct GWEN_STRINGLISTENTRYSTRUCT GWEN_STRINGLISTENTRY
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST