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