gwenhywfar  5.14.1
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 # include <winreg.h>
48 #endif
49 
50 
52 
53 
55 {
57 
58  return 0;
59 }
60 
61 
62 
64 {
66  gwen__paths=0;
67  return 0;
68 }
69 
70 
71 
72 int GWEN_PathManager_DefinePath(const char *destLib,
73  const char *pathName)
74 {
75  GWEN_DB_NODE *dbT;
76 
77  assert(destLib);
78  assert(pathName);
79  assert(gwen__paths);
81  destLib);
82  assert(dbT);
83  if (GWEN_DB_GetGroup(dbT, GWEN_PATH_FLAGS_NAMEMUSTEXIST, pathName)) {
85  "Path \"%s/%s\" already exists",
86  destLib, pathName);
87  return GWEN_ERROR_INVALID;
88  }
89  dbT=GWEN_DB_GetGroup(dbT,
91  pathName);
92  return 0;
93 }
94 
95 
96 
97 int GWEN_PathManager_UndefinePath(const char *destLib,
98  const char *pathName)
99 {
100  GWEN_DB_NODE *dbT;
101 
102  assert(destLib);
103  assert(pathName);
104  assert(gwen__paths);
106  destLib);
107  if (!dbT)
108  return GWEN_ERROR_NOT_FOUND;
109 
111  pathName);
112  if (!dbT)
113  return GWEN_ERROR_NOT_FOUND;
114  GWEN_DB_UnlinkGroup(dbT);
115  GWEN_DB_Group_free(dbT);
116  return 0;
117 }
118 
119 
120 
121 
122 int GWEN_PathManager_AddPath(const char *callingLib,
123  const char *destLib,
124  const char *pathName,
125  const char *pathValue)
126 {
127  GWEN_DB_NODE *dbT;
128  GWEN_BUFFER *buf;
129 
130  assert(destLib);
131  assert(pathName);
132  assert(pathValue);
133  assert(gwen__paths);
135  destLib);
136  if (!dbT)
137  return GWEN_ERROR_NOT_FOUND;
139  pathName);
140  if (!dbT)
141  return GWEN_ERROR_NOT_FOUND;
143  "pair");
144  assert(dbT);
145 
146  if (callingLib) {
148  "lib", callingLib);
149  }
150 
151  buf=GWEN_Buffer_new(0, 256, 0, 1);
152  GWEN_Directory_OsifyPath(pathValue, buf, 1);
153 
155  "path",
156  GWEN_Buffer_GetStart(buf));
157  GWEN_Buffer_free(buf);
158 
159  return 0;
160 }
161 
162 
163 
164 int GWEN_PathManager_AddRelPath(const char *callingLib,
165  const char *destLib,
166  const char *pathName,
167  const char *pathValue,
169 {
170  char cwd[256];
171 
172  switch (rm) {
174  const char *pcwd;
175 
176  pcwd=getcwd(cwd, sizeof(cwd)-1);
177  if (pcwd) {
178  GWEN_BUFFER *buf;
179  int rv;
180 
181  buf=GWEN_Buffer_new(0, 256, 0, 1);
182  GWEN_Buffer_AppendString(buf, cwd);
183  if (*pathValue!=GWEN_DIR_SEPARATOR)
185  GWEN_Buffer_AppendString(buf, pathValue);
186  rv=GWEN_PathManager_AddPath(callingLib, destLib, pathName,
187  GWEN_Buffer_GetStart(buf));
188  GWEN_Buffer_free(buf);
189  return rv;
190  }
191  else {
192  DBG_ERROR(GWEN_LOGDOMAIN, "getcwd(): %s", strerror(errno));
193  return GWEN_ERROR_IO;
194  }
195  break;
196  }
197 
199  int rv;
200 
201  rv=GWEN_Directory_GetPrefixDirectory(cwd, sizeof(cwd)-1);
202  if (rv) {
203  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
204  return rv;
205  }
206  else {
207  GWEN_BUFFER *buf;
208 
209  buf=GWEN_Buffer_new(0, 256, 0, 1);
210  GWEN_Buffer_AppendString(buf, cwd);
211  if (*pathValue!=GWEN_DIR_SEPARATOR)
213  GWEN_Buffer_AppendString(buf, pathValue);
215  "Adding path [%s]",
216  GWEN_Buffer_GetStart(buf));
217  rv=GWEN_PathManager_AddPath(callingLib, destLib, pathName,
218  GWEN_Buffer_GetStart(buf));
219  GWEN_Buffer_free(buf);
220  return rv;
221  }
222  }
223 
225  GWEN_BUFFER *buf;
226  int rv;
227 
228  rv=GWEN_Directory_GetHomeDirectory(cwd, sizeof(cwd)-1);
229  if (rv) {
231  "Could not determine HOME directory (%d)",
232  rv);
233  return rv;
234  }
235  buf=GWEN_Buffer_new(0, 256, 0, 1);
236  GWEN_Buffer_AppendString(buf, cwd);
237  if (*pathValue!=GWEN_DIR_SEPARATOR)
239  GWEN_Buffer_AppendString(buf, pathValue);
240  rv=GWEN_PathManager_AddPath(callingLib, destLib, pathName,
241  GWEN_Buffer_GetStart(buf));
242  GWEN_Buffer_free(buf);
243  return rv;
244  }
245 
246  default:
247  DBG_INFO(GWEN_LOGDOMAIN, "Unknown relative mode %d", rm);
248  return GWEN_ERROR_INVALID;
249  }
250 
251 }
252 
253 
254 
255 int GWEN_PathManager_InsertPath(const char *callingLib,
256  const char *destLib,
257  const char *pathName,
258  const char *pathValue)
259 {
260  GWEN_DB_NODE *dbT;
261 
262  assert(destLib);
263  assert(pathName);
264  assert(pathValue);
265  assert(gwen__paths);
267  destLib);
268  if (!dbT)
269  return GWEN_ERROR_NOT_FOUND;
271  pathName);
272  if (!dbT)
273  return GWEN_ERROR_NOT_FOUND;
274 
275  dbT=GWEN_DB_GetGroup(dbT,
278  "pair");
279  assert(dbT);
280 
281  if (callingLib) {
283  "lib", callingLib);
284  }
286  "path", pathValue);
287 
288  return 0;
289 }
290 
291 
292 
293 int GWEN_PathManager_InsertRelPath(const char *callingLib,
294  const char *destLib,
295  const char *pathName,
296  const char *pathValue,
298 {
299  char cwd[256];
300 
301  switch (rm) {
303  const char *pcwd;
304 
305  pcwd=getcwd(cwd, sizeof(cwd)-1);
306  if (pcwd) {
307  GWEN_BUFFER *buf;
308  int rv;
309 
310  buf=GWEN_Buffer_new(0, 256, 0, 1);
311  GWEN_Buffer_AppendString(buf, cwd);
312  if (*pathValue!=GWEN_DIR_SEPARATOR)
314  GWEN_Buffer_AppendString(buf, pathValue);
315  rv=GWEN_PathManager_InsertPath(callingLib, destLib, pathName,
316  GWEN_Buffer_GetStart(buf));
317  GWEN_Buffer_free(buf);
318  return rv;
319  }
320  else {
321  DBG_ERROR(GWEN_LOGDOMAIN, "getcwd(): %s", strerror(errno));
322  return GWEN_ERROR_IO;
323  }
324  break;
325  }
326 
328  int rv;
329 
330  rv=GWEN_Directory_GetPrefixDirectory(cwd, sizeof(cwd)-1);
331  if (rv) {
332  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
333  return rv;
334  }
335  else {
336  GWEN_BUFFER *buf;
337 
338  buf=GWEN_Buffer_new(0, 256, 0, 1);
339  GWEN_Buffer_AppendString(buf, cwd);
340  if (*pathValue!=GWEN_DIR_SEPARATOR)
342  GWEN_Buffer_AppendString(buf, pathValue);
344  "Adding path [%s]",
345  GWEN_Buffer_GetStart(buf));
346  rv=GWEN_PathManager_InsertPath(callingLib, destLib, pathName,
347  GWEN_Buffer_GetStart(buf));
348  GWEN_Buffer_free(buf);
349  return rv;
350  }
351  }
352 
354  GWEN_BUFFER *buf;
355  int rv;
356 
357  rv=GWEN_Directory_GetHomeDirectory(cwd, sizeof(cwd)-1);
358  if (rv) {
360  "Could not determine HOME directory (%d)",
361  rv);
362  return rv;
363  }
364  buf=GWEN_Buffer_new(0, 256, 0, 1);
365  GWEN_Buffer_AppendString(buf, cwd);
366  if (*pathValue!=GWEN_DIR_SEPARATOR)
368  GWEN_Buffer_AppendString(buf, pathValue);
369  rv=GWEN_PathManager_InsertPath(callingLib, destLib, pathName,
370  GWEN_Buffer_GetStart(buf));
371  GWEN_Buffer_free(buf);
372  return rv;
373  }
374 
375  default:
376  DBG_INFO(GWEN_LOGDOMAIN, "Unknown relative mode %d", rm);
377  return GWEN_ERROR_INVALID;
378  }
379 }
380 
381 
382 
383 int GWEN_PathManager_RemovePath(const char *callingLib,
384  const char *destLib,
385  const char *pathName,
386  const char *pathValue)
387 {
388  GWEN_DB_NODE *dbT;
389  const char *s;
390  const char *p;
391 
392  assert(gwen__paths);
394  destLib);
395  if (!dbT)
396  return GWEN_ERROR_NOT_FOUND;
398  pathName);
399  if (!dbT)
400  return GWEN_ERROR_NOT_FOUND;
401 
402  dbT=GWEN_DB_FindFirstGroup(dbT, "pair");
403  while (dbT) {
404  p=GWEN_DB_GetCharValue(dbT, "path", 0, 0);
405  assert(p);
406  s=GWEN_DB_GetCharValue(dbT, "lib", 0, 0);
407 
408  if (
409  (
410  (!callingLib && !s) ||
411  (callingLib && s && strcasecmp(s, callingLib)==0)
412  ) &&
413  strcasecmp(p, pathValue)==0
414  )
415  break;
416  dbT=GWEN_DB_FindNextGroup(dbT, "pair");
417  }
418 
419  if (dbT) {
420  GWEN_DB_UnlinkGroup(dbT);
421  GWEN_DB_Group_free(dbT);
422  return 0;
423  }
424  else
425  return 1;
426 
427 }
428 
429 
430 
431 int GWEN_PathManager_RemovePaths(const char *callingLib)
432 {
433  GWEN_DB_NODE *dbT;
434  const char *s;
435 
436  assert(gwen__paths);
437  GWEN_DB_DeleteGroup(gwen__paths, callingLib);
438 
440  while (dbT) {
441  GWEN_DB_NODE *dbN;
442 
443  dbN=GWEN_DB_GetFirstGroup(dbT);
444  while (dbN) {
445  GWEN_DB_NODE *dbNN;
446 
447  dbNN=GWEN_DB_FindFirstGroup(dbN, "pair");
448  while (dbNN) {
449  GWEN_DB_NODE *dbNext;
450 
451  dbNext=GWEN_DB_FindNextGroup(dbNN, "pair");
452  s=GWEN_DB_GetCharValue(dbNN, "lib", 0, 0);
453  assert(s);
454 
455  if (s && strcasecmp(s, callingLib)==0) {
456  GWEN_DB_UnlinkGroup(dbNN);
457  GWEN_DB_Group_free(dbNN);
458  }
459  dbNN=dbNext;
460  } /* while pairs */
461  dbN=GWEN_DB_GetNextGroup(dbN);
462  } /* while paths */
463  dbT=GWEN_DB_GetNextGroup(dbT);
464  } /* while destLibs */
465 
466  return 0;
467 }
468 
469 
470 
471 int GWEN_PathManager_PathChanged(const char *destLib,
472  const char *pathName)
473 {
474  GWEN_DB_NODE *dbT;
475 
476  assert(gwen__paths);
478  destLib);
479  if (!dbT)
480  return GWEN_ERROR_NOT_FOUND;
481 
483  pathName);
484  if (!dbT)
485  return GWEN_ERROR_NOT_FOUND;
486 
488  return 1;
489 
490  return 0;
491 }
492 
493 
494 
496  const char *pathName)
497 {
498  GWEN_DB_NODE *dbT;
499 
500  assert(gwen__paths);
502  destLib);
503  if (dbT) {
505  pathName);
506  if (dbT) {
507  GWEN_STRINGLIST *sl;
508  int i;
509  const char *s;
510  GWEN_DB_NODE *dbN;
511 
512  sl=GWEN_StringList_new();
513 
514  /* then add all paths from other libs */
515  dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
516  while (dbN) {
517  for (i=0; ; i++) {
518  s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
519  if (!s)
520  break;
521  GWEN_StringList_AppendString(sl, s, 0, 1);
522  }
523 
524  dbN=GWEN_DB_FindNextGroup(dbN, "pair");
525  }
526 
527  if (GWEN_StringList_Count(sl)==0) {
529  DBG_DEBUG(GWEN_LOGDOMAIN, "no entries");
530  return 0;
531  }
532 
533  return sl;
534  }
535  }
536 
537  return 0;
538 }
539 
540 
541 
542 int GWEN_PathManager_FindFile(const char *destLib,
543  const char *pathName,
544  const char *fileName,
545  GWEN_BUFFER *fbuf)
546 {
547  GWEN_DB_NODE *dbT;
548 
549  assert(gwen__paths);
551  destLib);
552  if (dbT) {
554  pathName);
555  if (dbT) {
556  int i;
557  const char *s;
558  GWEN_DB_NODE *dbN;
559  GWEN_BUFFER *tbuf;
560 
561  tbuf=GWEN_Buffer_new(0, 256, 0, 1);
562 
563  /* check all paths */
564  dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
565  while (dbN) {
566  for (i=0; ; i++) {
567  s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
568  if (!s)
569  break;
570  else {
571  FILE *f;
572 
573  GWEN_Buffer_AppendString(tbuf, s);
575  GWEN_Buffer_AppendString(tbuf, fileName);
576  DBG_INFO(GWEN_LOGDOMAIN, "Trying \"%s\"",
577  GWEN_Buffer_GetStart(tbuf));
578  f=fopen(GWEN_Buffer_GetStart(tbuf), "r");
579  if (f) {
580  fclose(f);
582  "File \"%s\" found in folder \"%s\"",
583  fileName,
584  s);
585  GWEN_Buffer_AppendBuffer(fbuf, tbuf);
586  GWEN_Buffer_free(tbuf);
587  return 0;
588  }
589  GWEN_Buffer_Reset(tbuf);
590  }
591  }
592 
593  dbN=GWEN_DB_FindNextGroup(dbN, "pair");
594  }
595  GWEN_Buffer_free(tbuf);
596  }
597  }
598 
599  DBG_INFO(GWEN_LOGDOMAIN, "File \"%s\" not found", fileName);
600  return GWEN_ERROR_NOT_FOUND;
601 }
602 
603 
604 
606  const char *pathName,
607  const char *subFolderName,
608  GWEN_STRINGLIST *sl,
609  const char *mask)
610 {
611  GWEN_DB_NODE *dbT;
612 
613  assert(gwen__paths);
615  destLib);
616  if (dbT) {
618  pathName);
619  if (dbT) {
620  int i;
621  const char *s;
622  GWEN_DB_NODE *dbN;
623  GWEN_BUFFER *tbuf;
624 
625  tbuf=GWEN_Buffer_new(0, 256, 0, 1);
626 
627  /* check all paths */
628  dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
629  while (dbN) {
630  for (i=0; ; i++) {
631  s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
632  if (!s)
633  break;
634  else {
635  GWEN_Buffer_AppendString(tbuf, s);
636  if (subFolderName && *subFolderName) {
638  GWEN_Buffer_AppendString(tbuf, subFolderName);
639  }
640 
641  DBG_DEBUG(GWEN_LOGDOMAIN, "Trying \"%s\"",
642  GWEN_Buffer_GetStart(tbuf));
644  GWEN_Buffer_Reset(tbuf);
645  }
646  }
647 
648  dbN=GWEN_DB_FindNextGroup(dbN, "pair");
649  }
650  GWEN_Buffer_free(tbuf);
651  }
652  }
653 
654  return 0;
655 }
656 
657 
658 
659 
660 
661 #ifdef OS_WIN32
662 int GWEN_PathManager_AddPathFromWinReg(const char *callingLib,
663  const char *destLib,
664  const char *pathName,
665  const char *keypath,
666  const char *varname)
667 {
668  HKEY hkey;
669  TCHAR nbuffer[MAX_PATH];
670  BYTE vbuffer[MAX_PATH];
671  DWORD nsize;
672  DWORD vsize;
673  DWORD typ;
674  int i;
675 
676  snprintf(nbuffer, sizeof(nbuffer), keypath);
677 
678  /* open the key */
679  if (RegOpenKey(HKEY_LOCAL_MACHINE, nbuffer, &hkey)) {
680  DBG_INFO(GWEN_LOGDOMAIN, "RegOpenKey %s failed.", keypath);
681  return 1;
682  }
683 
684  /* find the variablename */
685  for (i=0;; i++) {
686  nsize=sizeof(nbuffer);
687  vsize=sizeof(vbuffer);
688  if (ERROR_SUCCESS!=RegEnumValue(hkey,
689  i, /* index */
690  nbuffer,
691  &nsize,
692  0, /* reserved */
693  &typ,
694  vbuffer,
695  &vsize))
696  break;
697  if (strcasecmp(nbuffer, varname)==0 && typ==REG_SZ) {
698  /* variable found */
699  RegCloseKey(hkey);
700  return GWEN_PathManager_AddPath(callingLib,
701  destLib,
702  pathName,
703  (char *)vbuffer);
704  }
705  } /* for */
706 
707  RegCloseKey(hkey);
709  "In RegKey \"%s\" the variable \"%s\" does not exist",
710  keypath, varname);
711  return 1;
712 }
713 
714 #else /* OS_WIN32 */
715 
716 
718  GWEN_UNUSED const char *destLib,
719  GWEN_UNUSED const char *pathName,
720  GWEN_UNUSED const char *keypath,
721  GWEN_UNUSED const char *varname)
722 {
723  return 0;
724 }
725 
726 #endif /* OS_WIN32 */
727 
728 
#define DBG_ERROR(dbg_logger, format,...)
Definition: debug.h:97
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
Definition: buffer.c:235
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:421
#define GWEN_ERROR_INVALID
Definition: error.h:67
#define DBG_DEBUG(dbg_logger, format,...)
Definition: debug.h:214
#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:122
uint32_t GWEN_DB_GetNodeFlags(const GWEN_DB_NODE *n)
Definition: db.c:1770
#define GWEN_PATH_FLAGS_CREATE_GROUP
Definition: path.h:96
static GWEN_DB_NODE * gwen__paths
Definition: pathmanager.c:51
int GWEN_PathManager_UndefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:97
int GWEN_PathManager_InsertRelPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue, GWEN_PATHMANAGER_RELMODE rm)
Definition: pathmanager.c:293
#define GWEN_LOGDOMAIN
Definition: logger.h:32
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:42
#define GWEN_ERROR_IO
Definition: error.h:123
void GWEN_Buffer_Reset(GWEN_BUFFER *bf)
Definition: buffer.c:653
GWENHYWFAR_API int GWEN_Directory_GetHomeDirectory(char *buffer, unsigned int size)
int GWEN_PathManager_RemovePaths(const char *callingLib)
Definition: pathmanager.c:431
void GWEN_StringList_free(GWEN_STRINGLIST *sl)
Definition: stringlist.c:62
int GWEN_PathManager_ModuleInit(void)
Definition: pathmanager.c:54
int GWEN_StringList_AppendString(GWEN_STRINGLIST *sl, const char *s, int take, int checkDouble)
Definition: stringlist.c:245
int GWEN_Buffer_AppendBuffer(GWEN_BUFFER *bf, GWEN_BUFFER *sf)
Definition: buffer.c:506
#define MAX_PATH
Definition: testlib.c:128
int GWEN_DB_DeleteGroup(GWEN_DB_NODE *n, const char *path)
Definition: db.c:922
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST
Definition: stringlist.h:56
GWEN_DB_NODE * GWEN_DB_GetNextGroup(GWEN_DB_NODE *n)
Definition: db.c:461
const char * GWEN_DB_GetCharValue(GWEN_DB_NODE *n, const char *path, int idx, const char *defVal)
Definition: db.c:971
GWEN_STRINGLIST * GWEN_PathManager_GetPaths(const char *destLib, const char *pathName)
Definition: pathmanager.c:495
GWEN_DB_NODE * GWEN_DB_GetGroup(GWEN_DB_NODE *n, uint32_t flags, const char *path)
Definition: db.c:1381
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
#define GWEN_DB_NODE_FLAGS_DIRTY
Definition: db.h:207
unsigned int GWEN_StringList_Count(const GWEN_STRINGLIST *sl)
Definition: stringlist.c:427
int GWEN_PathManager_PathChanged(const char *destLib, const char *pathName)
Definition: pathmanager.c:471
int GWEN_PathManager_ModuleFini(void)
Definition: pathmanager.c:63
int GWEN_DB_SetCharValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, const char *val)
Definition: db.c:997
#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:164
#define GWEN_ERROR_NOT_FOUND
Definition: error.h:89
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:717
void GWEN_DB_UnlinkGroup(GWEN_DB_NODE *n)
Definition: db.c:1554
int GWEN_PathManager_RemovePath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:383
GWEN_DB_NODE * GWEN_DB_FindFirstGroup(GWEN_DB_NODE *n, const char *name)
Definition: db.c:1840
GWEN_DB_NODE * GWEN_DB_Group_new(const char *name)
Definition: db.c:173
GWEN_DB_NODE * GWEN_DB_GetFirstGroup(GWEN_DB_NODE *n)
Definition: db.c:440
int GWEN_PathManager_InsertPath(const char *callingLib, const char *destLib, const char *pathName, const char *pathValue)
Definition: pathmanager.c:255
#define DBG_INFO(dbg_logger, format,...)
Definition: debug.h:181
int GWEN_PathManager_FindFile(const char *destLib, const char *pathName, const char *fileName, GWEN_BUFFER *fbuf)
Definition: pathmanager.c:542
GWEN_STRINGLIST * GWEN_StringList_new(void)
Definition: stringlist.c:50
#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:1861
int GWEN_PathManager_GetMatchingFilesRecursively(const char *destLib, const char *pathName, const char *subFolderName, GWEN_STRINGLIST *sl, const char *mask)
Definition: pathmanager.c:605
#define GWEN_UNUSED
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
Definition: buffer.c:992
#define GWEN_DB_FLAGS_DEFAULT
Definition: db.h:168
int GWEN_PathManager_DefinePath(const char *destLib, const char *pathName)
Definition: pathmanager.c:72