gwenhywfar  4.99.8beta
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  gwen_plugin_manager__list=GWEN_PluginManager_List_new();
67  return 0;
68 }
69 
70 
71 
73  GWEN_PluginManager_List_free(gwen_plugin_manager__list);
74  return 0;
75 }
76 
77 
78 
80  const char *name,
81  const char *fileName) {
82  GWEN_PLUGIN *p;
83 
84  assert(pm);
85  assert(name);
87  DBG_MEM_INC("GWEN_PLUGIN", 0);
88  p->refCount=1;
91  p->manager=pm;
92  p->name=strdup(name);
93  if (fileName)
94  p->fileName=strdup(fileName);
95 
96  return p;
97 }
98 
99 
100 
102  if (p) {
103  DBG_MEM_DEC("GWEN_PLUGIN");
104  assert(p->refCount);
105  if (--(p->refCount)==0) {
107  free(p->name);
108  free(p->fileName);
109  if (p->libLoader) {
110  GWEN_LibLoader_CloseLibrary(p->libLoader);
111  GWEN_LibLoader_free(p->libLoader);
112  }
114  GWEN_FREE_OBJECT(p);
115  } /* if refCount reaches zero */
116  } /* if p */
117 }
118 
119 
120 
122  assert(p);
123  assert(p->refCount);
124  DBG_MEM_INC("GWEN_PLUGIN", 1);
125  p->refCount++;
126 }
127 
128 
129 
131  assert(p);
132  return p->manager;
133 }
134 
135 
136 
137 const char *GWEN_Plugin_GetName(const GWEN_PLUGIN *p) {
138  assert(p);
139  return p->name;
140 }
141 
142 
143 
144 const char *GWEN_Plugin_GetFileName(const GWEN_PLUGIN *p) {
145  assert(p);
146  return p->fileName;
147 }
148 
149 
150 
152  assert(p);
153  return p->libLoader;
154 }
155 
156 
157 
159  assert(p);
160  p->libLoader=ll;
161 }
162 
163 
164 
165 
166 
167 
168 
169 
171  const char *destLib) {
173 
174  assert(name);
175  assert(destLib);
177  DBG_MEM_INC("GWEN_PLUGIN_MANAGER", 0);
180  pm->name=strdup(name);
181  pm->destLib=strdup(destLib);
182  pm->plugins=GWEN_Plugin_List_new();
183 
184  return pm;
185 }
186 
187 
188 
190  if (pm) {
191  DBG_MEM_DEC("GWEN_PLUGIN_MANAGER");
192  GWEN_Plugin_List_free(pm->plugins);
194  free(pm->destLib);
195  free(pm->name);
197  GWEN_FREE_OBJECT(pm);
198  }
199 }
200 
201 
202 
204  assert(pm);
205  return pm->name;
206 }
207 
208 
209 
211  const char *callingLib,
212  const char *s) {
213  assert(pm);
214  return GWEN_PathManager_AddPath(callingLib,
215  pm->destLib,
216  pm->name,
217  s);
218 }
219 
220 
221 
223  const char *callingLib,
224  const char *s,
226  assert(pm);
227  return GWEN_PathManager_AddRelPath(callingLib,
228  pm->destLib,
229  pm->name,
230  s,
231  rm);
232 }
233 
234 
235 
237  const char *callingLib,
238  const char *s) {
239  assert(pm);
240  return GWEN_PathManager_InsertPath(callingLib,
241  pm->destLib,
242  pm->name,
243  s);
244 }
245 
246 
247 
249  const char *callingLib,
250  const char *relpath,
252  assert(pm);
253  return GWEN_PathManager_InsertRelPath(callingLib,
254  pm->destLib,
255  pm->name,
256  relpath,
257  rm);
258 }
259 
260 
261 
263  const char *callingLib,
264  const char *s) {
265  assert(pm);
266  return GWEN_PathManager_RemovePath(callingLib,
267  pm->destLib,
268  pm->name,
269  s);
270 }
271 
272 
273 
274 #ifdef OS_WIN32
276  const char *callingLib,
277  const char *keypath,
278  const char *varname) {
279  HKEY hkey;
280  TCHAR nbuffer[MAX_PATH];
281  BYTE vbuffer[MAX_PATH];
282  DWORD nsize;
283  DWORD vsize;
284  DWORD typ;
285  int i;
286 
287  assert(pm);
288 
289  snprintf(nbuffer, sizeof(nbuffer), keypath);
290 
291  /* open the key */
292  if (RegOpenKey(HKEY_LOCAL_MACHINE, nbuffer, &hkey)) {
293  DBG_INFO(GWEN_LOGDOMAIN, "RegOpenKey %s failed.", keypath);
294  return 1;
295  }
296 
297  /* find the variablename */
298  for (i=0;; i++) {
299  nsize=sizeof(nbuffer);
300  vsize=sizeof(vbuffer);
301  if (ERROR_SUCCESS!=RegEnumValue(hkey,
302  i, /* index */
303  nbuffer,
304  &nsize,
305  0, /* reserved */
306  &typ,
307  vbuffer,
308  &vsize))
309  break;
310  if (strcasecmp(nbuffer, varname)==0 && typ==REG_SZ) {
311  /* variable found */
312  RegCloseKey(hkey);
313  return GWEN_PathManager_AddPath(callingLib,
314  pm->destLib,
315  pm->name,
316  (char*)vbuffer);
317  }
318  } /* for */
319 
320  RegCloseKey(hkey);
322  "In RegKey \"%s\" the variable \"%s\" does not exist",
323  keypath, varname);
324  return 1;
325 
326 }
327 
328 #else /* OS_WIN32 */
329 
331  GWEN_UNUSED const char *callingLib,
332  GWEN_UNUSED const char *keypath,
333  GWEN_UNUSED const char *varname) {
334  return 0;
335 }
336 #endif /* OS_WIN32 */
337 
338 
339 
341  const char *modname) {
342  GWEN_LIBLOADER *ll;
343  GWEN_PLUGIN *plugin;
345  void *p;
346  GWEN_BUFFER *nbuf;
347  const char *s;
348  const char *fname;
349  int err;
350  GWEN_STRINGLIST *sl;
352 
353  assert(pm);
354  ll=GWEN_LibLoader_new();
355  sl=GWEN_PathManager_GetPaths(pm->destLib, pm->name);
356  if (sl==NULL) {
357  DBG_ERROR(GWEN_LOGDOMAIN, "No paths for plugins (%s)", pm->name);
359  return NULL;
360  }
361  nbuf=GWEN_Buffer_new(0, 128, 0, 1);
362  s=modname;
363  while(*s) GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
365  fname=0;
366  while(se) {
367  fname=GWEN_StringListEntry_Data(se);
368  assert(fname);
370  GWEN_Buffer_GetStart(nbuf))==0)
371  break;
372  else {
374  "Could not load plugin \"%s\" from \"%s\"", modname, fname);
375  }
377  }
378  if (!se) {
379  DBG_ERROR(GWEN_LOGDOMAIN, "Plugin \"%s\" not found.", modname);
380  GWEN_Buffer_free(nbuf);
383  return NULL;
384  }
385  GWEN_Buffer_free(nbuf);
386 
387  /* create name of init function */
388  nbuf=GWEN_Buffer_new(0, 128, 0, 1);
389  s=pm->name;
390  while(*s) GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
391  GWEN_Buffer_AppendByte(nbuf, '_');
392  s=modname;
393  while(*s) GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
394  GWEN_Buffer_AppendString(nbuf, "_factory");
395 
396  /* resolve name of factory function */
397  err=GWEN_LibLoader_Resolve(ll, GWEN_Buffer_GetStart(nbuf), &p);
398  if (err) {
400  GWEN_Buffer_free(nbuf);
404  return 0;
405  }
406  GWEN_Buffer_free(nbuf);
407 
408  fn=(GWEN_PLUGIN_FACTORYFN)p;
409  assert(fn);
410  plugin=fn(pm, modname, fname);
411  if (!plugin) {
412  DBG_ERROR(GWEN_LOGDOMAIN, "Error in plugin: No plugin created");
416  return 0;
417  }
418 
419  /* store libloader */
421  GWEN_Plugin_SetLibLoader(plugin, ll);
422  return plugin;
423 }
424 
425 
426 
428  const char *modname,
429  const char *fname) {
430  GWEN_LIBLOADER *ll;
431  GWEN_PLUGIN *plugin;
433  void *p;
434  GWEN_BUFFER *nbuf;
435  const char *s;
436  int err;
437 
438  ll=GWEN_LibLoader_new();
439  if (GWEN_LibLoader_OpenLibrary(ll, fname)) {
441  "Could not load plugin \"%s\" (%s)", modname, fname);
443  return 0;
444  }
445 
446  /* create name of init function */
447  nbuf=GWEN_Buffer_new(0, 128, 0, 1);
448  s=pm->name;
449  while(*s) GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
450  GWEN_Buffer_AppendByte(nbuf, '_');
451  s=modname;
452  while(*s) GWEN_Buffer_AppendByte(nbuf, tolower(*(s++)));
453  GWEN_Buffer_AppendString(nbuf, "_factory");
454 
455  /* resolve name of factory function */
456  err=GWEN_LibLoader_Resolve(ll, GWEN_Buffer_GetStart(nbuf), &p);
457  if (err) {
459  GWEN_Buffer_free(nbuf);
462  return 0;
463  }
464  GWEN_Buffer_free(nbuf);
465 
466  fn=(GWEN_PLUGIN_FACTORYFN)p;
467  assert(fn);
468  plugin=fn(pm, modname, fname);
469  if (!plugin) {
470  DBG_INFO(GWEN_LOGDOMAIN, "Error in plugin: No plugin created");
473  return 0;
474  }
475 
476  /* store libloader */
477  GWEN_Plugin_SetLibLoader(plugin, ll);
478 
479  return plugin;
480 }
481 
482 
483 
485  const char *s) {
486  GWEN_PLUGIN *p;
487 
488  assert(pm);
489  p=GWEN_Plugin_List_First(pm->plugins);
490  while(p) {
491  if (strcasecmp(p->name, s)==0)
492  break;
493  p=GWEN_Plugin_List_Next(p);
494  }
495 
496  return p;
497 }
498 
499 
500 
502  const char *s) {
503  GWEN_PLUGIN *p;
504 
506  if (p)
507  return p;
509  if (p) {
510  GWEN_Plugin_List_Add(p, pm->plugins);
511  return p;
512  }
513  DBG_INFO(GWEN_LOGDOMAIN, "Plugin \"%s\" not found", s);
514  return 0;
515 }
516 
517 
518 
521 
522  pm=GWEN_PluginManager_List_First(gwen_plugin_manager__list);
523  while(pm) {
524  if (strcasecmp(pm->name, s)==0)
525  break;
526  pm=GWEN_PluginManager_List_Next(pm);
527  }
528 
529  return pm;
530 }
531 
532 
533 
535  GWEN_PLUGIN_MANAGER *tpm;
536  int rv;
537 
539  assert(pm);
541  if (tpm) {
543  "Plugin type \"%s\" already registered",
544  pm->name);
545  return -1;
546  }
547 
548  rv=GWEN_PathManager_DefinePath(pm->destLib, pm->name);
549  if (rv) {
550  DBG_INFO(GWEN_LOGDOMAIN, "Could not define path for plugin [%s:%s]",
551  pm->destLib, pm->name);
552  return rv;
553  }
554 
555  GWEN_PluginManager_List_Add(pm, gwen_plugin_manager__list);
557  "Plugin type \"%s\" registered",
558  pm->name);
559  return 0;
560 }
561 
562 
563 
565  GWEN_PLUGIN_MANAGER *tpm;
566  int rv;
567 
569  assert(pm);
571  if (!tpm) {
573  "Plugin type \"%s\" not registered",
574  pm->name);
575  return -1;
576  }
577 
578  rv=GWEN_PathManager_UndefinePath(pm->destLib, pm->name);
579  if (rv) {
580  DBG_INFO(GWEN_LOGDOMAIN, "Could not undefine path for plugin [%s:%s]",
581  pm->destLib, pm->name);
582  return rv;
583  }
584 
585  GWEN_PluginManager_List_Del(pm);
587  "Plugin type \"%s\" unregistered",
588  pm->name);
589  return 0;
590 }
591 
592 
593 
597  GWEN_STRINGLIST *sl;
599 
600  sl=GWEN_PathManager_GetPaths(pm->destLib, pm->name);
601  if (sl==NULL) {
602  DBG_ERROR(GWEN_LOGDOMAIN, "No paths for plugins (%s)", pm->name);
603  return NULL;
604  }
606  if (!se) {
607  DBG_ERROR(GWEN_LOGDOMAIN, "No paths given");
609  return 0;
610  }
611 
613  while(se) {
614  int rv;
615  const char *path;
616 
617  path=GWEN_StringListEntry_Data(se);
618  assert(path);
619  rv=GWEN_LoadPluginDescrsByType(path, pm->name, pl);
620  if (rv) {
622  "Error loading plugin description in \"%s\"", path);
623  }
625  } /* while */
626 
630  return 0;
631  }
632 
634  return pl;
635 }
636 
637 
639  assert(pm);
640  return GWEN_PathManager_GetPaths(pm->destLib, pm->name);
641 }
642 
643 
644 
647  const char *modName) {
649 
651  if (dl==0)
652  return 0;
653  else {
655 
657  if (dit) {
659 
661  while(d) {
662  if (strcasecmp(GWEN_PluginDescription_GetName(d), modName)==0)
663  break;
665  }
667 
668  if (d) {
671  return d;
672  }
673  }
675  }
676 
677  return 0;
678 }
679 
680 
681 
683 #if 0
684  DBG_ERROR(0, "Adding plugin [%s] of type [%s]",
685  p->name, pm->name);
686 #endif
687  GWEN_Plugin_List_Add(p, pm->plugins);
688 }
689 
690 
691 
692 
693 
694 
int GWEN_Plugin_ModuleFini(void)
Definition: plugin.c:72
GWEN_PLUGIN_DESCRIPTION_LIST2 * GWEN_PluginManager_GetPluginDescrs(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:595
void GWEN_Plugin_free(GWEN_PLUGIN *p)
Definition: plugin.c:101
struct GWEN_PLUGIN_MANAGER GWEN_PLUGIN_MANAGER
Definition: plugin.h:40
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
Definition: buffer.c:223
struct GWEN_STRINGLISTENTRYSTRUCT GWEN_STRINGLISTENTRY
Definition: stringlist.h:51
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:151
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:117
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:222
#define GWEN_FREE_OBJECT(varname)
Definition: memory.h:92
#define NULL
Definition: binreloc.c:290
void GWEN_PluginManager_free(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:189
int GWEN_PathManager_UndefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:93
struct GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR
Definition: listdoc.h:6243
#define DBG_ERROR_ERR(dbg_logger, dbg_err)
Definition: debug.h:108
int GWEN_PathManager_InsertRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
Definition: pathmanager.c:285
GWEN_PLUGIN * GWEN_PluginManager_GetPlugin(GWEN_PLUGIN_MANAGER *pm, const char *s)
Definition: plugin.c:501
#define GWEN_LOGDOMAIN
Definition: logger.h:35
void GWEN_PluginDescription_List2_freeAll(GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
Definition: plugindescr.c:188
int GWEN_PluginManager_InsertPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
Definition: plugin.c:236
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:38
GWEN_PLUGIN_MANAGER * GWEN_PluginManager_FindPluginManager(const char *s)
Definition: plugin.c:519
GWEN_STRINGLISTENTRY * GWEN_StringList_FirstEntry(const GWEN_STRINGLIST *sl)
Definition: stringlist.c:352
void GWEN_PluginDescription_List2Iterator_free(GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *li)
const char * GWEN_StringListEntry_Data(const GWEN_STRINGLISTENTRY *se)
Definition: stringlist.c:366
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:57
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:86
void GWEN_PluginManager_AddPlugin(GWEN_PLUGIN_MANAGER *pm, GWEN_PLUGIN *p)
Definition: plugin.c:682
#define DBG_DEBUG(dbg_logger, format, args...)
Definition: debug.h:192
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:330
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_dup(const GWEN_PLUGIN_DESCRIPTION *pd)
Definition: plugindescr.c:141
#define MAX_PATH
Definition: testlib.c:120
int GWEN_LoadPluginDescrsByType(const char *path, const char *type, GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
Definition: plugindescr.c:427
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:170
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST
Definition: stringlist.h:54
GWEN_PLUGIN_DESCRIPTION * GWEN_PluginManager_GetPluginDescr(GWEN_PLUGIN_MANAGER *pm, const char *modName)
Definition: plugin.c:646
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:137
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
Definition: buffer.c:380
const char * GWEN_Plugin_GetFileName(const GWEN_PLUGIN *p)
Definition: plugin.c:144
#define GWEN_INHERIT_INIT(t, element)
Definition: inherit.h:223
int GWEN_PluginManager_Register(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:534
GWEN_STRINGLIST * GWEN_PathManager_GetPaths(const char *destLib, const char *pathName)
Definition: pathmanager.c:483
GWENHYWFAR_API void GWEN_LibLoader_free(GWEN_LIBLOADER *h)
struct GWEN_PLUGIN_DESCRIPTION_LIST2 GWEN_PLUGIN_DESCRIPTION_LIST2
Definition: listdoc.h:6238
void GWEN_Buffer_free(GWEN_BUFFER *bf)
Definition: buffer.c:83
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:41
GWENHYWFAR_API int GWEN_LibLoader_CloseLibrary(GWEN_LIBLOADER *h)
GWEN_PLUGIN * GWEN_PluginManager_LoadPlugin(GWEN_PLUGIN_MANAGER *pm, const char *modname)
Definition: plugin.c:340
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:121
GWEN_PLUGIN * GWEN_PluginManager__FindPlugin(GWEN_PLUGIN_MANAGER *pm, const char *s)
Definition: plugin.c:484
#define DBG_ERROR(dbg_logger, format, args...)
Definition: debug.h:97
#define DBG_INFO_ERR(dbg_logger, dbg_err)
Definition: debug.h:176
GWEN_STRINGLISTENTRY * GWEN_StringListEntry_Next(const GWEN_STRINGLISTENTRY *se)
Definition: stringlist.c:359
GWEN_STRINGLIST * GWEN_PluginManager_GetPaths(const GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:638
int GWEN_PathManager_AddRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
Definition: pathmanager.c:158
const char * GWEN_PluginDescription_GetName(const GWEN_PLUGIN_DESCRIPTION *pd)
Definition: plugindescr.c:215
#define DBG_INFO(dbg_logger, format, args...)
Definition: debug.h:164
GWEN_PLUGIN * GWEN_PluginManager_LoadPluginFile(GWEN_PLUGIN_MANAGER *pm, const char *modname, const char *fname)
Definition: plugin.c:427
int GWEN_PluginManager_RemovePath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
Definition: plugin.c:262
int GWEN_PathManager_RemovePath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:374
#define GWEN_LIST_INIT(t, element)
Definition: list1.h:465
int GWEN_PluginManager_Unregister(GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:564
int GWEN_PluginManager_AddPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *s)
Definition: plugin.c:210
GWEN_PLUGIN_MANAGER * GWEN_Plugin_GetManager(const GWEN_PLUGIN *p)
Definition: plugin.c:130
int GWEN_PathManager_InsertPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:248
#define GWEN_LIST_FUNCTIONS(t, pr)
Definition: list1.h:366
const char * GWEN_PluginManager_GetName(const GWEN_PLUGIN_MANAGER *pm)
Definition: plugin.c:203
int GWEN_PluginManager_InsertRelPath(GWEN_PLUGIN_MANAGER *pm, const char *callingLib, const char *relpath, GWEN_PATHMANAGER_RELMODE rm)
Definition: plugin.c:248
GWEN_PLUGIN *(* GWEN_PLUGIN_FACTORYFN)(GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
Definition: plugin.h:62
void GWEN_Plugin_SetLibLoader(GWEN_PLUGIN *p, GWEN_LIBLOADER *ll)
Definition: plugin.c:158
#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:79
#define GWEN_UNUSED
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
Definition: buffer.c:1014
int GWEN_PathManager_DefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:69