gwenhywfar  5.10.1
plugin.c
Go to the documentation of this file.
1 /***************************************************************************
2  $RCSfile$
3  -------------------
4  cvs : $Id$
5  begin : Thu Apr 03 2003
6  copyright : (C) 2003 by Martin Preuss
7  email : martin@libchipcard.de
8 
9  ***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU Lesser General Public *
13  * License as published by the Free Software Foundation; either *
14  * version 2.1 of the License, or (at your option) any later version. *
15  * *
16  * This library is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19  * Lesser General Public License for more details. *
20  * *
21  * You should have received a copy of the GNU Lesser General Public *
22  * License along with this library; if not, write to the Free Software *
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
24  * MA 02111-1307 USA *
25  * *
26  ***************************************************************************/
27 
28 #ifdef HAVE_CONFIG_H
29 # include <config.h>
30 #endif
31 
32 #include "plugin_p.h"
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>
38 
39 #include <sys/types.h>
40 #include <sys/stat.h>
41 #ifdef HAVE_UNISTD_H
42 # include <unistd.h>
43 #endif
44 #include <errno.h>
45 #include <string.h>
46 #ifdef HAVE_STRINGS_H
47 # include <strings.h>
48 #endif
49 #include <ctype.h>
50 
51 #ifdef OS_WIN32
52 # include <windows.h>
53 #endif
54 
55 static GWEN_PLUGIN_MANAGER_LIST *gwen_plugin_manager__list=0;
56 
57 
59 GWEN_LIST_FUNCTIONS(GWEN_PLUGIN, GWEN_Plugin)
61 GWEN_LIST_FUNCTIONS(GWEN_PLUGIN_MANAGER, GWEN_PluginManager)
62 
63 
64 
66 {
67  gwen_plugin_manager__list=GWEN_PluginManager_List_new();
68  return 0;
69 }
70 
71 
72 
74 {
75  GWEN_PluginManager_List_free(gwen_plugin_manager__list);
76  return 0;
77 }
78 
79 
80 
82  const char *name,
83  const char *fileName)
84 {
85  GWEN_PLUGIN *p;
86 
87  assert(pm);
88  assert(name);
90  DBG_MEM_INC("GWEN_PLUGIN", 0);
91  p->refCount=1;
94  p->manager=pm;
95  p->name=strdup(name);
96  if (fileName)
97  p->fileName=strdup(fileName);
98 
99  return p;
100 }
101 
102 
103 
105 {
106  if (p) {
107  DBG_MEM_DEC("GWEN_PLUGIN");
108  assert(p->refCount);
109  if (--(p->refCount)==0) {
111  free(p->name);
112  free(p->fileName);
113  if (p->libLoader) {
114  GWEN_LibLoader_CloseLibrary(p->libLoader);
115  GWEN_LibLoader_free(p->libLoader);
116  }
118  GWEN_FREE_OBJECT(p);
119  } /* if refCount reaches zero */
120  } /* if p */
121 }
122 
123 
124 
126 {
127  assert(p);
128  assert(p->refCount);
129  DBG_MEM_INC("GWEN_PLUGIN", 1);
130  p->refCount++;
131 }
132 
133 
134 
136 {
137  assert(p);
138  return p->manager;
139 }
140 
141 
142 
143 const char *GWEN_Plugin_GetName(const GWEN_PLUGIN *p)
144 {
145  assert(p);
146  return p->name;
147 }
148 
149 
150 
152 {
153  assert(p);
154  return p->fileName;
155 }
156 
157 
158 
160 {
161  assert(p);
162  return p->libLoader;
163 }
164 
165 
166 
168 {
169  assert(p);
170  p->libLoader=ll;
171 }
172 
173 
174 
175 
176 
177 
178 
179 
181  const char *destLib)
182 {
184 
185  assert(name);
186  assert(destLib);
188  DBG_MEM_INC("GWEN_PLUGIN_MANAGER", 0);
191  pm->name=strdup(name);
192  pm->destLib=strdup(destLib);
193  pm->plugins=GWEN_Plugin_List_new();
194 
195  return pm;
196 }
197 
198 
199 
201 {
202  if (pm) {
203  DBG_MEM_DEC("GWEN_PLUGIN_MANAGER");
204  GWEN_Plugin_List_free(pm->plugins);
206  free(pm->destLib);
207  free(pm->name);
209  GWEN_FREE_OBJECT(pm);
210  }
211 }
212 
213 
214 
216 {
217  assert(pm);
218  return pm->name;
219 }
220 
221 
222 
224  const char *callingLib,
225  const char *s)
226 {
227  assert(pm);
228  return GWEN_PathManager_AddPath(callingLib,
229  pm->destLib,
230  pm->name,
231  s);
232 }
233 
234 
235 
237  const char *callingLib,
238  const char *s,
240 {
241  assert(pm);
242  return GWEN_PathManager_AddRelPath(callingLib,
243  pm->destLib,
244  pm->name,
245  s,
246  rm);
247 }
248 
249 
250 
252  const char *callingLib,
253  const char *s)
254 {
255  assert(pm);
256  return GWEN_PathManager_InsertPath(callingLib,
257  pm->destLib,
258  pm->name,
259  s);
260 }
261 
262 
263 
265  const char *callingLib,
266  const char *relpath,
268 {
269  assert(pm);
270  return GWEN_PathManager_InsertRelPath(callingLib,
271  pm->destLib,
272  pm->name,
273  relpath,
274  rm);
275 }
276 
277 
278 
280  const char *callingLib,
281  const char *s)
282 {
283  assert(pm);
284  return GWEN_PathManager_RemovePath(callingLib,
285  pm->destLib,
286  pm->name,
287  s);
288 }
289 
290 
291 
292 #ifdef OS_WIN32
294  const char *callingLib,
295  const char *keypath,
296  const char *varname)
297 {
298  HKEY hkey;
299  TCHAR nbuffer[MAX_PATH];
300  BYTE vbuffer[MAX_PATH];
301  DWORD nsize;
302  DWORD vsize;
303  DWORD typ;
304  int i;
305 
306  assert(pm);
307 
308  snprintf(nbuffer, sizeof(nbuffer), keypath);
309 
310  /* open the key */
311  if (RegOpenKey(HKEY_LOCAL_MACHINE, nbuffer, &hkey)) {
312  DBG_INFO(GWEN_LOGDOMAIN, "RegOpenKey %s failed.", keypath);
313  return 1;
314  }
315 
316  /* find the variablename */
317  for (i=0;; i++) {
318  nsize=sizeof(nbuffer);
319  vsize=sizeof(vbuffer);
320  if (ERROR_SUCCESS!=RegEnumValue(hkey,
321  i, /* index */
322  nbuffer,
323  &nsize,
324  0, /* reserved */
325  &typ,
326  vbuffer,
327  &vsize))
328  break;
329  if (strcasecmp(nbuffer, varname)==0 && typ==REG_SZ) {
330  /* variable found */
331  RegCloseKey(hkey);
332  return GWEN_PathManager_AddPath(callingLib,
333  pm->destLib,
334  pm->name,
335  (char *)vbuffer);
336  }
337  } /* for */
338 
339  RegCloseKey(hkey);
341  "In RegKey \"%s\" the variable \"%s\" does not exist",
342  keypath, varname);
343  return 1;
344 
345 }
346 
347 #else /* OS_WIN32 */
348 
350  GWEN_UNUSED const char *callingLib,
351  GWEN_UNUSED const char *keypath,
352  GWEN_UNUSED const char *varname)
353 {
354  return 0;
355 }
356 #endif /* OS_WIN32 */
357 
358 
359 
361  const char *modname)
362 {
363  GWEN_LIBLOADER *ll;
364  GWEN_PLUGIN *plugin;
366  void *p;
367  GWEN_BUFFER *nbuf;
368  const char *s;
369  const char *fname;
370  int err;
371  GWEN_STRINGLIST *sl;
373 
374  assert(pm);
375  ll=GWEN_LibLoader_new();
376  sl=GWEN_PathManager_GetPaths(pm->destLib, pm->name);
377  if (sl==NULL) {
378  DBG_ERROR(GWEN_LOGDOMAIN, "No paths for plugins (%s)", pm->name);
380  return NULL;
381  }
382  nbuf=GWEN_Buffer_new(0, 128, 0, 1);
383  s=modname;
384  while (*s)
385  GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
387  fname=0;
388  while (se) {
389  fname=GWEN_StringListEntry_Data(se);
390  assert(fname);
392  GWEN_Buffer_GetStart(nbuf))==0)
393  break;
394  else {
396  "Could not load plugin \"%s\" from \"%s\"", modname, fname);
397  }
399  }
400  if (!se) {
401  DBG_ERROR(GWEN_LOGDOMAIN, "Plugin \"%s\" not found.", modname);
402  GWEN_Buffer_free(nbuf);
405  return NULL;
406  }
407  GWEN_Buffer_free(nbuf);
408 
409  /* create name of init function */
410  nbuf=GWEN_Buffer_new(0, 128, 0, 1);
411  s=pm->name;
412  while (*s)
413  GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
414  GWEN_Buffer_AppendByte(nbuf, '_');
415  s=modname;
416  while (*s)
417  GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
418  GWEN_Buffer_AppendString(nbuf, "_factory");
419 
420  /* resolve name of factory function */
421  err=GWEN_LibLoader_Resolve(ll, GWEN_Buffer_GetStart(nbuf), &p);
422  if (err) {
424  GWEN_Buffer_free(nbuf);
428  return 0;
429  }
430  GWEN_Buffer_free(nbuf);
431 
432  fn=(GWEN_PLUGIN_FACTORYFN)p;
433  assert(fn);
434  plugin=fn(pm, modname, fname);
435  if (!plugin) {
436  DBG_ERROR(GWEN_LOGDOMAIN, "Error in plugin: No plugin created");
440  return 0;
441  }
442 
443  /* store libloader */
445  GWEN_Plugin_SetLibLoader(plugin, ll);
446  return plugin;
447 }
448 
449 
450 
452  const char *modname,
453  const char *fname)
454 {
455  GWEN_LIBLOADER *ll;
456  GWEN_PLUGIN *plugin;
458  void *p;
459  GWEN_BUFFER *nbuf;
460  const char *s;
461  int err;
462 
463  ll=GWEN_LibLoader_new();
464  if (GWEN_LibLoader_OpenLibrary(ll, fname)) {
466  "Could not load plugin \"%s\" (%s)", modname, fname);
468  return 0;
469  }
470 
471  /* create name of init function */
472  nbuf=GWEN_Buffer_new(0, 128, 0, 1);
473  s=pm->name;
474  while (*s)
475  GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
476  GWEN_Buffer_AppendByte(nbuf, '_');
477  s=modname;
478  while (*s)
479  GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
480  GWEN_Buffer_AppendString(nbuf, "_factory");
481 
482  /* resolve name of factory function */
483  err=GWEN_LibLoader_Resolve(ll, GWEN_Buffer_GetStart(nbuf), &p);
484  if (err) {
486  GWEN_Buffer_free(nbuf);
489  return 0;
490  }
491  GWEN_Buffer_free(nbuf);
492 
493  fn=(GWEN_PLUGIN_FACTORYFN)p;
494  assert(fn);
495  plugin=fn(pm, modname, fname);
496  if (!plugin) {
497  DBG_INFO(GWEN_LOGDOMAIN, "Error in plugin: No plugin created");
500  return 0;
501  }
502 
503  /* store libloader */
504  GWEN_Plugin_SetLibLoader(plugin, ll);
505 
506  return plugin;
507 }
508 
509 
510 
512  const char *s)
513 {
514  GWEN_PLUGIN *p;
515 
516  assert(pm);
517  p=GWEN_Plugin_List_First(pm->plugins);
518  while (p) {
519  if (strcasecmp(p->name, s)==0)
520  break;
521  p=GWEN_Plugin_List_Next(p);
522  }
523 
524  return p;
525 }
526 
527 
528 
530  const char *s)
531 {
532  GWEN_PLUGIN *p;
533 
535  if (p)
536  return p;
538  if (p) {
539  GWEN_Plugin_List_Add(p, pm->plugins);
540  return p;
541  }
542  DBG_INFO(GWEN_LOGDOMAIN, "Plugin \"%s\" not found", s);
543  return 0;
544 }
545 
546 
547 
549 {
551 
552  pm=GWEN_PluginManager_List_First(gwen_plugin_manager__list);
553  while (pm) {
554  if (strcasecmp(pm->name, s)==0)
555  break;
556  pm=GWEN_PluginManager_List_Next(pm);
557  }
558 
559  return pm;
560 }
561 
562 
563 
565 {
566  GWEN_PLUGIN_MANAGER *tpm;
567  int rv;
568 
570  assert(pm);
572  if (tpm) {
574  "Plugin type \"%s\" already registered",
575  pm->name);
576  return -1;
577  }
578 
579  rv=GWEN_PathManager_DefinePath(pm->destLib, pm->name);
580  if (rv) {
581  DBG_INFO(GWEN_LOGDOMAIN, "Could not define path for plugin [%s:%s]",
582  pm->destLib, pm->name);
583  return rv;
584  }
585 
586  GWEN_PluginManager_List_Add(pm, gwen_plugin_manager__list);
588  "Plugin type \"%s\" registered",
589  pm->name);
590  return 0;
591 }
592 
593 
594 
596 {
597  GWEN_PLUGIN_MANAGER *tpm;
598  int rv;
599 
601  assert(pm);
603  if (!tpm) {
605  "Plugin type \"%s\" not registered",
606  pm->name);
607  return -1;
608  }
609 
610  rv=GWEN_PathManager_UndefinePath(pm->destLib, pm->name);
611  if (rv) {
612  DBG_INFO(GWEN_LOGDOMAIN, "Could not undefine path for plugin [%s:%s]",
613  pm->destLib, pm->name);
614  return rv;
615  }
616 
617  GWEN_PluginManager_List_Del(pm);
619  "Plugin type \"%s\" unregistered",
620  pm->name);
621  return 0;
622 }
623 
624 
625 
627 {
629  GWEN_STRINGLIST *sl;
631 
632  sl=GWEN_PathManager_GetPaths(pm->destLib, pm->name);
633  if (sl==NULL) {
634  DBG_ERROR(GWEN_LOGDOMAIN, "No paths for plugins (%s)", pm->name);
635  return NULL;
636  }
638  if (!se) {
639  DBG_ERROR(GWEN_LOGDOMAIN, "No paths given");
641  return 0;
642  }
643 
645  while (se) {
646  int rv;
647  const char *path;
648 
649  path=GWEN_StringListEntry_Data(se);
650  assert(path);
651  rv=GWEN_LoadPluginDescrsByType(path, pm->name, pl);
652  if (rv) {
654  "Error loading plugin description in \"%s\"", path);
655  }
657  } /* while */
658 
662  return 0;
663  }
664 
666  return pl;
667 }
668 
669 
671 {
672  assert(pm);
673  return GWEN_PathManager_GetPaths(pm->destLib, pm->name);
674 }
675 
676 
677 
679  const char *modName)
680 {
682 
684  if (dl==0)
685  return 0;
686  else {
688 
690  if (dit) {
692 
694  while (d) {
695  if (strcasecmp(GWEN_PluginDescription_GetName(d), modName)==0)
696  break;
698  }
700 
701  if (d) {
704  return d;
705  }
706  }
708  }
709 
710  return 0;
711 }
712 
713 
714 
716 {
717 #if 0
718  DBG_ERROR(0, "Adding plugin [%s] of type [%s]",
719  p->name, pm->name);
720 #endif
721  GWEN_Plugin_List_Add(p, pm->plugins);
722 }
723 
724 
725 
726 
727 
728 
int GWEN_Plugin_ModuleFini(void)
Definition: plugin.c:73
GWEN_PLUGIN_DESCRIPTION_LIST2 * GWEN_PluginManager_GetPluginDescrs(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:626
void GWEN_Plugin_free(GWEN_PLUGIN *p)
Definition: plugin.c:104
struct GWEN_PLUGIN_MANAGER GWEN_PLUGIN_MANAGER
Definition: plugin.h:40
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
Definition: buffer.c:235
struct GWEN_STRINGLISTENTRYSTRUCT GWEN_STRINGLISTENTRY
Definition: stringlist.h:53
struct GWEN_PLUGIN GWEN_PLUGIN
Definition: plugin.h:39
#define GWEN_INHERIT_FINI(t, element)
Definition: inherit.h:238
#define DBG_MEM_INC(o, attach)
Definition: debug.h:87
GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR * GWEN_PluginDescription_List2_First(GWEN_PLUGIN_DESCRIPTION_LIST2 *l)
GWEN_LIBLOADER * GWEN_Plugin_GetLibLoader(const GWEN_PLUGIN *p)
Definition: plugin.c:159
static GWEN_PLUGIN_MANAGER_LIST * gwen_plugin_manager__list
Definition: plugin.c:55
GWEN_PATHMANAGER_RELMODE
Definition: pathmanager.h:38
struct GWEN_PLUGIN_DESCRIPTION GWEN_PLUGIN_DESCRIPTION
Definition: plugindescr.h:41
int GWEN_PathManager_AddPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:121
GWENHYWFAR_API int GWEN_LibLoader_OpenLibrary(GWEN_LIBLOADER *h, const char *name)
int GWEN_PluginManager_AddRelPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s, GWEN_PATHMANAGER_RELMODE rm)
Definition: plugin.c:236
#define GWEN_FREE_OBJECT(varname)
Definition: memory.h:61
#define NULL
Definition: binreloc.c:300
void GWEN_PluginManager_free(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:200
int GWEN_PathManager_UndefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:96
struct GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR
Definition: listdoc.h:6393
#define DBG_ERROR_ERR(dbg_logger, dbg_err)
Definition: debug.h:113
int GWEN_PathManager_InsertRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
Definition: pathmanager.c:292
GWEN_PLUGIN * GWEN_PluginManager_GetPlugin(GWEN_PLUGIN_MANAGER *pm, const char *s)
Definition: plugin.c:529
#define GWEN_LOGDOMAIN
Definition: logger.h:35
void GWEN_PluginDescription_List2_freeAll(GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
Definition: plugindescr.c:200
int GWEN_PluginManager_InsertPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
Definition: plugin.c:251
GWENHYWFAR_API int GWEN_LibLoader_OpenLibraryWithPath(GWEN_LIBLOADER *h, const char *path, const char *name)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
Definition: buffer.c:42
GWEN_PLUGIN_MANAGER * GWEN_PluginManager_FindPluginManager(const char *s)
Definition: plugin.c:548
GWEN_STRINGLISTENTRY * GWEN_StringList_FirstEntry(const GWEN_STRINGLIST *sl)
Definition: stringlist.c:390
void GWEN_PluginDescription_List2Iterator_free(GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *li)
const char * GWEN_StringListEntry_Data(const GWEN_STRINGLISTENTRY *se)
Definition: stringlist.c:406
struct GWEN_LIBLOADER GWEN_LIBLOADER
Definition: libloader.h:60
int GWEN_Plugin_ModuleInit(void)
Definition: plugin.c:65
void GWEN_StringList_free(GWEN_STRINGLIST *sl)
Definition: stringlist.c:62
GWEN_PLUGIN_DESCRIPTION_LIST2 * GWEN_PluginDescription_List2_new()
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_List2Iterator_Next(GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *li)
#define GWEN_NEW_OBJECT(typ, varname)
Definition: memory.h:55
void GWEN_PluginManager_AddPlugin(GWEN_PLUGIN_MANAGER *pm, GWEN_PLUGIN *p)
Definition: plugin.c:715
#define DBG_DEBUG(dbg_logger, format, args...)
Definition: debug.h:214
unsigned int GWEN_PluginDescription_List2_GetSize(GWEN_PLUGIN_DESCRIPTION_LIST2 *l)
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: plugin.c:349
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_dup(const GWEN_PLUGIN_DESCRIPTION *pd)
Definition: plugindescr.c:143
#define MAX_PATH
Definition: testlib.c:124
int GWEN_LoadPluginDescrsByType(const char *path, const char *type, GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
Definition: plugindescr.c:452
void GWEN_PluginDescription_List2_free(GWEN_PLUGIN_DESCRIPTION_LIST2 *l)
GWEN_PLUGIN_MANAGER * GWEN_PluginManager_new(const char *name, const char *destLib)
Definition: plugin.c:180
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST
Definition: stringlist.h:56
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginManager_GetPluginDescr(GWEN_PLUGIN_MANAGER *pm, const char *modName)
Definition: plugin.c:678
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_List2Iterator_Data(GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *li)
const char * GWEN_Plugin_GetName(const GWEN_PLUGIN *p)
Definition: plugin.c:143
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
Definition: buffer.c:394
const char * GWEN_Plugin_GetFileName(const GWEN_PLUGIN *p)
Definition: plugin.c:151
#define GWEN_INHERIT_INIT(t, element)
Definition: inherit.h:223
int GWEN_PluginManager_Register(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:564
GWEN_PLUGIN *(* GWEN_PLUGIN_FACTORYFN)(GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
Definition: plugin.h:62
GWEN_STRINGLIST * GWEN_PathManager_GetPaths(const char *destLib, const char *pathName)
Definition: pathmanager.c:494
GWENHYWFAR_API void GWEN_LibLoader_free(GWEN_LIBLOADER *h)
struct GWEN_PLUGIN_DESCRIPTION_LIST2 GWEN_PLUGIN_DESCRIPTION_LIST2
Definition: listdoc.h:6388
void GWEN_Buffer_free(GWEN_BUFFER *bf)
Definition: buffer.c:89
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:38
GWENHYWFAR_API int GWEN_LibLoader_CloseLibrary(GWEN_LIBLOADER *h)
GWEN_PLUGIN * GWEN_PluginManager_LoadPlugin(GWEN_PLUGIN_MANAGER *pm, const char *modname)
Definition: plugin.c:360
GWENHYWFAR_API int GWEN_LibLoader_Resolve(GWEN_LIBLOADER *h, const char *name, void **p)
GWENHYWFAR_API GWEN_LIBLOADER * GWEN_LibLoader_new(void)
void GWEN_Plugin_Attach(GWEN_PLUGIN *p)
Definition: plugin.c:125
GWEN_PLUGIN * GWEN_PluginManager__FindPlugin(GWEN_PLUGIN_MANAGER *pm, const char *s)
Definition: plugin.c:511
#define DBG_ERROR(dbg_logger, format, args...)
Definition: debug.h:97
#define DBG_INFO_ERR(dbg_logger, dbg_err)
Definition: debug.h:196
GWEN_STRINGLISTENTRY * GWEN_StringListEntry_Next(const GWEN_STRINGLISTENTRY *se)
Definition: stringlist.c:398
GWEN_STRINGLIST * GWEN_PluginManager_GetPaths(const GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:670
int GWEN_PathManager_AddRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
Definition: pathmanager.c:163
const char * GWEN_PluginDescription_GetName(const GWEN_PLUGIN_DESCRIPTION *pd)
Definition: plugindescr.c:232
#define DBG_INFO(dbg_logger, format, args...)
Definition: debug.h:181
GWEN_PLUGIN * GWEN_PluginManager_LoadPluginFile(GWEN_PLUGIN_MANAGER *pm, const char *modname, const char *fname)
Definition: plugin.c:451
int GWEN_PluginManager_RemovePath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
Definition: plugin.c:279
int GWEN_PathManager_RemovePath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:382
#define GWEN_LIST_INIT(t, element)
Definition: list1.h:465
int GWEN_PluginManager_Unregister(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:595
int GWEN_PluginManager_AddPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
Definition: plugin.c:223
GWEN_PLUGIN_MANAGER * GWEN_Plugin_GetManager(const GWEN_PLUGIN *p)
Definition: plugin.c:135
int GWEN_PathManager_InsertPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:254
#define GWEN_LIST_FUNCTIONS(t, pr)
Definition: list1.h:366
const char * GWEN_PluginManager_GetName(const GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:215
int GWEN_PluginManager_InsertRelPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *relpath, GWEN_PATHMANAGER_RELMODE rm)
Definition: plugin.c:264
void GWEN_Plugin_SetLibLoader(GWEN_PLUGIN *p, GWEN_LIBLOADER *ll)
Definition: plugin.c:167
#define DBG_MEM_DEC(o)
Definition: debug.h:88
#define GWEN_LIST_FINI(t, element)
Definition: list1.h:474
#define GWEN_INHERIT_FUNCTIONS(t)
Definition: inherit.h:163
GWEN_PLUGIN * GWEN_Plugin_new(GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
Definition: plugin.c:81
#define GWEN_UNUSED
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
Definition: buffer.c:989
int GWEN_PathManager_DefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:71