gwenhywfar  4.99.8beta
pathmanager.c
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Mon Mar 01 2004
3  copyright : (C) 2004 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 #ifdef HAVE_CONFIG_H
26 # include <config.h>
27 #endif
28 
29 #define DISABLE_DEBUGLOG
30 
31 
32 #include "pathmanager_p.h"
33 #include <gwenhywfar/db.h>
34 #include <gwenhywfar/debug.h>
35 #include <gwenhywfar/directory.h>
36 
37 
38 #include <stdlib.h>
39 #include <stdio.h>
40 #include <assert.h>
41 #include <string.h>
42 #include <unistd.h>
43 #include <errno.h>
44 
45 #ifdef OS_WIN32
46 # include <windows.h>
47 #endif
48 
49 
51 
52 
55 
56  return 0;
57 }
58 
59 
60 
63  gwen__paths=0;
64  return 0;
65 }
66 
67 
68 
69 int GWEN_PathManager_DefinePath(const char *destLib,
70  const char *pathName) {
71  GWEN_DB_NODE *dbT;
72 
73  assert(destLib);
74  assert(pathName);
75  assert(gwen__paths);
77  destLib);
78  assert(dbT);
79  if (GWEN_DB_GetGroup(dbT, GWEN_PATH_FLAGS_NAMEMUSTEXIST, pathName)) {
81  "Path \"%s/%s\" already exists",
82  destLib, pathName);
83  return GWEN_ERROR_INVALID;
84  }
85  dbT=GWEN_DB_GetGroup(dbT,
87  pathName);
88  return 0;
89 }
90 
91 
92 
93 int GWEN_PathManager_UndefinePath(const char *destLib,
94  const char *pathName) {
95  GWEN_DB_NODE *dbT;
96 
97  assert(destLib);
98  assert(pathName);
99  assert(gwen__paths);
101  destLib);
102  if (!dbT)
103  return GWEN_ERROR_NOT_FOUND;
104 
106  pathName);
107  if (!dbT)
108  return GWEN_ERROR_NOT_FOUND;
109  GWEN_DB_UnlinkGroup(dbT);
110  GWEN_DB_Group_free(dbT);
111  return 0;
112 }
113 
114 
115 
116 
117 int GWEN_PathManager_AddPath(const char *callingLib,
118  const char *destLib,
119  const char *pathName,
120  const char *pathValue) {
121  GWEN_DB_NODE *dbT;
122  GWEN_BUFFER *buf;
123 
124  assert(destLib);
125  assert(pathName);
126  assert(pathValue);
127  assert(gwen__paths);
129  destLib);
130  if (!dbT)
131  return GWEN_ERROR_NOT_FOUND;
133  pathName);
134  if (!dbT)
135  return GWEN_ERROR_NOT_FOUND;
137  "pair");
138  assert(dbT);
139 
140  if (callingLib) {
142  "lib", callingLib);
143  }
144 
145  buf=GWEN_Buffer_new(0, 256, 0, 1);
146  GWEN_Directory_OsifyPath(pathValue, buf, 1);
147 
149  "path",
150  GWEN_Buffer_GetStart(buf));
151  GWEN_Buffer_free(buf);
152 
153  return 0;
154 }
155 
156 
157 
158 int GWEN_PathManager_AddRelPath(const char *callingLib,
159  const char *destLib,
160  const char *pathName,
161  const char *pathValue,
163  char cwd[256];
164 
165  switch(rm) {
167  const char *pcwd;
168 
169  pcwd=getcwd(cwd, sizeof(cwd)-1);
170  if (pcwd) {
171  GWEN_BUFFER *buf;
172  int rv;
173 
174  buf=GWEN_Buffer_new(0, 256, 0, 1);
175  GWEN_Buffer_AppendString(buf, cwd);
176  if (*pathValue!=GWEN_DIR_SEPARATOR)
178  GWEN_Buffer_AppendString(buf, pathValue);
179  rv=GWEN_PathManager_AddPath(callingLib, destLib, pathName,
180  GWEN_Buffer_GetStart(buf));
181  GWEN_Buffer_free(buf);
182  return rv;
183  }
184  else {
185  DBG_ERROR(GWEN_LOGDOMAIN, "getcwd(): %s", strerror(errno));
186  return GWEN_ERROR_IO;
187  }
188  break;
189  }
190 
192  int rv;
193 
194  rv=GWEN_Directory_GetPrefixDirectory(cwd, sizeof(cwd)-1);
195  if (rv) {
196  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
197  return rv;
198  }
199  else {
200  GWEN_BUFFER *buf;
201 
202  buf=GWEN_Buffer_new(0, 256, 0, 1);
203  GWEN_Buffer_AppendString(buf, cwd);
204  if (*pathValue!=GWEN_DIR_SEPARATOR)
206  GWEN_Buffer_AppendString(buf, pathValue);
208  "Adding path [%s]",
209  GWEN_Buffer_GetStart(buf));
210  rv=GWEN_PathManager_AddPath(callingLib, destLib, pathName,
211  GWEN_Buffer_GetStart(buf));
212  GWEN_Buffer_free(buf);
213  return rv;
214  }
215  }
216 
218  GWEN_BUFFER *buf;
219  int rv;
220 
221  rv=GWEN_Directory_GetHomeDirectory(cwd, sizeof(cwd)-1);
222  if (rv) {
224  "Could not determine HOME directory (%d)",
225  rv);
226  return rv;
227  }
228  buf=GWEN_Buffer_new(0, 256, 0, 1);
229  GWEN_Buffer_AppendString(buf, cwd);
230  if (*pathValue!=GWEN_DIR_SEPARATOR)
232  GWEN_Buffer_AppendString(buf, pathValue);
233  rv=GWEN_PathManager_AddPath(callingLib, destLib, pathName,
234  GWEN_Buffer_GetStart(buf));
235  GWEN_Buffer_free(buf);
236  return rv;
237  }
238 
239  default:
240  DBG_INFO(GWEN_LOGDOMAIN, "Unknown relative mode %d", rm);
241  return GWEN_ERROR_INVALID;
242  }
243 
244 }
245 
246 
247 
248 int GWEN_PathManager_InsertPath(const char *callingLib,
249  const char *destLib,
250  const char *pathName,
251  const char *pathValue) {
252  GWEN_DB_NODE *dbT;
253 
254  assert(destLib);
255  assert(pathName);
256  assert(pathValue);
257  assert(gwen__paths);
259  destLib);
260  if (!dbT)
261  return GWEN_ERROR_NOT_FOUND;
263  pathName);
264  if (!dbT)
265  return GWEN_ERROR_NOT_FOUND;
266 
267  dbT=GWEN_DB_GetGroup(dbT,
270  "pair");
271  assert(dbT);
272 
273  if (callingLib) {
275  "lib", callingLib);
276  }
278  "path", pathValue);
279 
280  return 0;
281 }
282 
283 
284 
285 int GWEN_PathManager_InsertRelPath(const char *callingLib,
286  const char *destLib,
287  const char *pathName,
288  const char *pathValue,
290  char cwd[256];
291 
292  switch(rm) {
294  const char *pcwd;
295 
296  pcwd=getcwd(cwd, sizeof(cwd)-1);
297  if (pcwd) {
298  GWEN_BUFFER *buf;
299  int rv;
300 
301  buf=GWEN_Buffer_new(0, 256, 0, 1);
302  GWEN_Buffer_AppendString(buf, cwd);
303  if (*pathValue!=GWEN_DIR_SEPARATOR)
305  GWEN_Buffer_AppendString(buf, pathValue);
306  rv=GWEN_PathManager_InsertPath(callingLib, destLib, pathName,
307  GWEN_Buffer_GetStart(buf));
308  GWEN_Buffer_free(buf);
309  return rv;
310  }
311  else {
312  DBG_ERROR(GWEN_LOGDOMAIN, "getcwd(): %s", strerror(errno));
313  return GWEN_ERROR_IO;
314  }
315  break;
316  }
317 
319  int rv;
320 
321  rv=GWEN_Directory_GetPrefixDirectory(cwd, sizeof(cwd)-1);
322  if (rv) {
323  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
324  return rv;
325  }
326  else {
327  GWEN_BUFFER *buf;
328 
329  buf=GWEN_Buffer_new(0, 256, 0, 1);
330  GWEN_Buffer_AppendString(buf, cwd);
331  if (*pathValue!=GWEN_DIR_SEPARATOR)
333  GWEN_Buffer_AppendString(buf, pathValue);
335  "Adding path [%s]",
336  GWEN_Buffer_GetStart(buf));
337  rv=GWEN_PathManager_InsertPath(callingLib, destLib, pathName,
338  GWEN_Buffer_GetStart(buf));
339  GWEN_Buffer_free(buf);
340  return rv;
341  }
342  }
343 
345  GWEN_BUFFER *buf;
346  int rv;
347 
348  rv=GWEN_Directory_GetHomeDirectory(cwd, sizeof(cwd)-1);
349  if (rv) {
351  "Could not determine HOME directory (%d)",
352  rv);
353  return rv;
354  }
355  buf=GWEN_Buffer_new(0, 256, 0, 1);
356  GWEN_Buffer_AppendString(buf, cwd);
357  if (*pathValue!=GWEN_DIR_SEPARATOR)
359  GWEN_Buffer_AppendString(buf, pathValue);
360  rv=GWEN_PathManager_InsertPath(callingLib, destLib, pathName,
361  GWEN_Buffer_GetStart(buf));
362  GWEN_Buffer_free(buf);
363  return rv;
364  }
365 
366  default:
367  DBG_INFO(GWEN_LOGDOMAIN, "Unknown relative mode %d", rm);
368  return GWEN_ERROR_INVALID;
369  }
370 }
371 
372 
373 
374 int GWEN_PathManager_RemovePath(const char *callingLib,
375  const char *destLib,
376  const char *pathName,
377  const char *pathValue) {
378  GWEN_DB_NODE *dbT;
379  const char *s;
380  const char *p;
381 
382  assert(gwen__paths);
384  destLib);
385  if (!dbT)
386  return GWEN_ERROR_NOT_FOUND;
388  pathName);
389  if (!dbT)
390  return GWEN_ERROR_NOT_FOUND;
391 
392  dbT=GWEN_DB_FindFirstGroup(dbT, "pair");
393  while(dbT) {
394  p=GWEN_DB_GetCharValue(dbT, "path", 0, 0);
395  assert(p);
396  s=GWEN_DB_GetCharValue(dbT, "lib", 0, 0);
397 
398  if (
399  (
400  (!callingLib && !s) ||
401  (callingLib && s && strcasecmp(s, callingLib)==0)
402  ) &&
403  strcasecmp(p, pathValue)==0
404  )
405  break;
406  dbT=GWEN_DB_FindNextGroup(dbT, "pair");
407  }
408 
409  if (dbT) {
410  GWEN_DB_UnlinkGroup(dbT);
411  GWEN_DB_Group_free(dbT);
412  return 0;
413  }
414  else
415  return 1;
416 
417 }
418 
419 
420 
421 int GWEN_PathManager_RemovePaths(const char *callingLib) {
422  GWEN_DB_NODE *dbT;
423  const char *s;
424 
425  assert(gwen__paths);
426  GWEN_DB_DeleteGroup(gwen__paths, callingLib);
427 
429  while(dbT) {
430  GWEN_DB_NODE *dbN;
431 
432  dbN=GWEN_DB_GetFirstGroup(dbT);
433  while(dbN) {
434  GWEN_DB_NODE *dbNN;
435 
436  dbNN=GWEN_DB_FindFirstGroup(dbN, "pair");
437  while(dbNN) {
438  GWEN_DB_NODE *dbNext;
439 
440  dbNext=GWEN_DB_FindNextGroup(dbNN, "pair");
441  s=GWEN_DB_GetCharValue(dbNN, "lib", 0, 0);
442  assert(s);
443 
444  if (s && strcasecmp(s, callingLib)==0) {
445  GWEN_DB_UnlinkGroup(dbNN);
446  GWEN_DB_Group_free(dbNN);
447  }
448  dbNN=dbNext;
449  } /* while pairs */
450  dbN=GWEN_DB_GetNextGroup(dbN);
451  } /* while paths */
452  dbT=GWEN_DB_GetNextGroup(dbT);
453  } /* while destLibs */
454 
455  return 0;
456 }
457 
458 
459 
460 int GWEN_PathManager_PathChanged(const char *destLib,
461  const char *pathName) {
462  GWEN_DB_NODE *dbT;
463 
464  assert(gwen__paths);
466  destLib);
467  if (!dbT)
468  return GWEN_ERROR_NOT_FOUND;
469 
471  pathName);
472  if (!dbT)
473  return GWEN_ERROR_NOT_FOUND;
474 
476  return 1;
477 
478  return 0;
479 }
480 
481 
482 
484  const char *pathName) {
485  GWEN_DB_NODE *dbT;
486 
487  assert(gwen__paths);
489  destLib);
490  if (dbT) {
492  pathName);
493  if (dbT) {
494  GWEN_STRINGLIST *sl;
495  int i;
496  const char *s;
497  GWEN_DB_NODE *dbN;
498 
499  sl=GWEN_StringList_new();
500 
501  /* then add all paths from other libs */
502  dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
503  while(dbN) {
504  for (i=0; ; i++) {
505  s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
506  if (!s)
507  break;
508  GWEN_StringList_AppendString(sl, s, 0, 1);
509  }
510 
511  dbN=GWEN_DB_FindNextGroup(dbN, "pair");
512  }
513 
514  if (GWEN_StringList_Count(sl)==0) {
516  DBG_DEBUG(GWEN_LOGDOMAIN, "no entries");
517  return 0;
518  }
519 
520  return sl;
521  }
522  }
523 
524  return 0;
525 }
526 
527 
528 
529 int GWEN_PathManager_FindFile(const char *destLib,
530  const char *pathName,
531  const char *fileName,
532  GWEN_BUFFER *fbuf) {
533  GWEN_DB_NODE *dbT;
534 
535  assert(gwen__paths);
537  destLib);
538  if (dbT) {
540  pathName);
541  if (dbT) {
542  int i;
543  const char *s;
544  GWEN_DB_NODE *dbN;
545  GWEN_BUFFER *tbuf;
546 
547  tbuf=GWEN_Buffer_new(0, 256, 0, 1);
548 
549  /* check all paths */
550  dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
551  while(dbN) {
552  for (i=0; ; i++) {
553  s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
554  if (!s)
555  break;
556  else {
557  FILE *f;
558 
559  GWEN_Buffer_AppendString(tbuf, s);
561  GWEN_Buffer_AppendString(tbuf, fileName);
562  DBG_DEBUG(GWEN_LOGDOMAIN, "Trying \"%s\"",
563  GWEN_Buffer_GetStart(tbuf));
564  f=fopen(GWEN_Buffer_GetStart(tbuf), "r");
565  if (f) {
566  fclose(f);
568  "File \"%s\" found in folder \"%s\"",
569  fileName,
570  s);
571  GWEN_Buffer_AppendBuffer(fbuf, tbuf);
572  GWEN_Buffer_free(tbuf);
573  return 0;
574  }
575  GWEN_Buffer_Reset(tbuf);
576  }
577  }
578 
579  dbN=GWEN_DB_FindNextGroup(dbN, "pair");
580  }
581  GWEN_Buffer_free(tbuf);
582  }
583  }
584 
585  DBG_INFO(GWEN_LOGDOMAIN, "File \"%s\" not found", fileName);
586  return GWEN_ERROR_NOT_FOUND;
587 }
588 
589 
590 
592  const char *pathName,
593  const char *subFolderName,
594  GWEN_STRINGLIST *sl,
595  const char *mask) {
596  GWEN_DB_NODE *dbT;
597 
598  assert(gwen__paths);
600  destLib);
601  if (dbT) {
603  pathName);
604  if (dbT) {
605  int i;
606  const char *s;
607  GWEN_DB_NODE *dbN;
608  GWEN_BUFFER *tbuf;
609 
610  tbuf=GWEN_Buffer_new(0, 256, 0, 1);
611 
612  /* check all paths */
613  dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
614  while(dbN) {
615  for (i=0; ; i++) {
616  s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
617  if (!s)
618  break;
619  else {
620  GWEN_Buffer_AppendString(tbuf, s);
621  if (subFolderName && *subFolderName) {
623  GWEN_Buffer_AppendString(tbuf, subFolderName);
624  }
625 
626  DBG_DEBUG(GWEN_LOGDOMAIN, "Trying \"%s\"",
627  GWEN_Buffer_GetStart(tbuf));
629  GWEN_Buffer_Reset(tbuf);
630  }
631  }
632 
633  dbN=GWEN_DB_FindNextGroup(dbN, "pair");
634  }
635  GWEN_Buffer_free(tbuf);
636  }
637  }
638 
639  return 0;
640 }
641 
642 
643 
644 
645 
646 #ifdef OS_WIN32
647 int GWEN_PathManager_AddPathFromWinReg(const char *callingLib,
648  const char *destLib,
649  const char *pathName,
650  const char *keypath,
651  const char *varname) {
652  HKEY hkey;
653  TCHAR nbuffer[MAX_PATH];
654  BYTE vbuffer[MAX_PATH];
655  DWORD nsize;
656  DWORD vsize;
657  DWORD typ;
658  int i;
659 
660  snprintf(nbuffer, sizeof(nbuffer), keypath);
661 
662  /* open the key */
663  if (RegOpenKey(HKEY_LOCAL_MACHINE, nbuffer, &hkey)) {
664  DBG_INFO(GWEN_LOGDOMAIN, "RegOpenKey %s failed.", keypath);
665  return 1;
666  }
667 
668  /* find the variablename */
669  for (i=0;; i++) {
670  nsize=sizeof(nbuffer);
671  vsize=sizeof(vbuffer);
672  if (ERROR_SUCCESS!=RegEnumValue(hkey,
673  i, /* index */
674  nbuffer,
675  &nsize,
676  0, /* reserved */
677  &typ,
678  vbuffer,
679  &vsize))
680  break;
681  if (strcasecmp(nbuffer, varname)==0 && typ==REG_SZ) {
682  /* variable found */
683  RegCloseKey(hkey);
684  return GWEN_PathManager_AddPath(callingLib,
685  destLib,
686  pathName,
687  (char*)vbuffer);
688  }
689  } /* for */
690 
691  RegCloseKey(hkey);
693  "In RegKey \"%s\" the variable \"%s\" does not exist",
694  keypath, varname);
695  return 1;
696 }
697 
698 #else /* OS_WIN32 */
699 
700 
702  GWEN_UNUSED const char *destLib,
703  GWEN_UNUSED const char *pathName,
704  GWEN_UNUSED const char *keypath,
705  GWEN_UNUSED const char *varname) {
706  return 0;
707 }
708 
709 #endif /* OS_WIN32 */
710 
711 
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
Definition: buffer.c:223
GWENHYWFAR_API int GWEN_Directory_OsifyPath(const char *path, GWEN_BUFFER *pbuf, int transformDriveElement)
struct GWEN_DB_NODE GWEN_DB_NODE
Definition: db.h:228
#define GWEN_DB_FLAGS_INSERT
Definition: db.h:160
void GWEN_DB_Group_free(GWEN_DB_NODE *n)
Definition: db.c:369
#define GWEN_ERROR_INVALID
Definition: error.h:67
#define GWEN_DIR_SEPARATOR_S
GWENHYWFAR_API int GWEN_Directory_GetPrefixDirectory(char *buffer, unsigned int size)
GWEN_PATHMANAGER_RELMODE
Definition: pathmanager.h:38
int GWEN_PathManager_AddPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:117
uint32_t GWEN_DB_GetNodeFlags(const GWEN_DB_NODE *n)
Definition: db.c:1627
#define GWEN_PATH_FLAGS_CREATE_GROUP
Definition: path.h:96
static GWEN_DB_NODE * gwen__paths
Definition: pathmanager.c:50
int GWEN_PathManager_UndefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:93
int GWEN_PathManager_InsertRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
Definition: pathmanager.c:285
#define GWEN_LOGDOMAIN
Definition: logger.h:35
GWENHYWFAR_API int GWEN_Directory_GetMatchingFilesRecursively(const char *folder, GWEN_STRINGLIST *sl, const char *mask)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
Definition: buffer.c:38
#define GWEN_ERROR_IO
Definition: error.h:123
void GWEN_Buffer_Reset(GWEN_BUFFER *bf)
Definition: buffer.c:684
GWENHYWFAR_API int GWEN_Directory_GetHomeDirectory(char *buffer, unsigned int size)
int GWEN_PathManager_RemovePaths(const char *callingLib)
Definition: pathmanager.c:421
void GWEN_StringList_free(GWEN_STRINGLIST *sl)
Definition: stringlist.c:57
int GWEN_PathManager_ModuleInit(void)
Definition: pathmanager.c:53
int GWEN_StringList_AppendString(GWEN_STRINGLIST *sl, const char *s, int take, int checkDouble)
Definition: stringlist.c:230
#define DBG_DEBUG(dbg_logger, format, args...)
Definition: debug.h:192
int GWEN_Buffer_AppendBuffer(GWEN_BUFFER *bf, GWEN_BUFFER *sf)
Definition: buffer.c:549
#define MAX_PATH
Definition: testlib.c:120
int GWEN_DB_DeleteGroup(GWEN_DB_NODE *n, const char *path)
Definition: db.c:850
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST
Definition: stringlist.h:54
GWEN_DB_NODE * GWEN_DB_GetNextGroup(GWEN_DB_NODE *n)
Definition: db.c:406
const char * GWEN_DB_GetCharValue(GWEN_DB_NODE *n, const char *path, int idx, const char *defVal)
Definition: db.c:897
GWEN_STRINGLIST * GWEN_PathManager_GetPaths(const char *destLib, const char *pathName)
Definition: pathmanager.c:483
GWEN_DB_NODE * GWEN_DB_GetGroup(GWEN_DB_NODE *n, uint32_t flags, const char *path)
Definition: db.c:1260
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
#define GWEN_DB_NODE_FLAGS_DIRTY
Definition: db.h:207
unsigned int GWEN_StringList_Count(const GWEN_STRINGLIST *sl)
Definition: stringlist.c:382
#define DBG_ERROR(dbg_logger, format, args...)
Definition: debug.h:97
int GWEN_PathManager_PathChanged(const char *destLib, const char *pathName)
Definition: pathmanager.c:460
int GWEN_PathManager_ModuleFini(void)
Definition: pathmanager.c:61
int GWEN_DB_SetCharValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, const char *val)
Definition: db.c:922
#define GWEN_DIR_SEPARATOR
int GWEN_PathManager_AddRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
Definition: pathmanager.c:158
#define GWEN_ERROR_NOT_FOUND
Definition: error.h:89
#define DBG_INFO(dbg_logger, format, args...)
Definition: debug.h:164
int GWEN_PathManager_AddPathFromWinReg(GWEN_UNUSED const char *callingLib, GWEN_UNUSED const char *destLib, GWEN_UNUSED const char *pathName, GWEN_UNUSED const char *keypath, GWEN_UNUSED const char *varname)
Definition: pathmanager.c:701
void GWEN_DB_UnlinkGroup(GWEN_DB_NODE *n)
Definition: db.c:1427
int GWEN_PathManager_RemovePath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:374
GWEN_DB_NODE * GWEN_DB_FindFirstGroup(GWEN_DB_NODE *n, const char *name)
Definition: db.c:1692
GWEN_DB_NODE * GWEN_DB_Group_new(const char *name)
Definition: db.c:131
GWEN_DB_NODE * GWEN_DB_GetFirstGroup(GWEN_DB_NODE *n)
Definition: db.c:386
int GWEN_PathManager_InsertPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:248
int GWEN_PathManager_FindFile(const char *destLib, const char *pathName, const char *fileName, GWEN_BUFFER *fbuf)
Definition: pathmanager.c:529
GWEN_STRINGLIST * GWEN_StringList_new(void)
Definition: stringlist.c:46
#define GWEN_PATH_FLAGS_NAMEMUSTEXIST
Definition: path.h:84
GWEN_DB_NODE * GWEN_DB_FindNextGroup(GWEN_DB_NODE *n, const char *name)
Definition: db.c:1712
int GWEN_PathManager_GetMatchingFilesRecursively(const char *destLib, const char *pathName, const char *subFolderName, GWEN_STRINGLIST *sl, const char *mask)
Definition: pathmanager.c:591
#define GWEN_UNUSED
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
Definition: buffer.c:1014
#define GWEN_DB_FLAGS_DEFAULT
Definition: db.h:168
int GWEN_PathManager_DefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:69