6 static char *G__find_etc(
const char *
name)
9 const char *pathlist =
getenv(
"GRASS_ADDON_ETC");
14 if (*name == 0 || *name ==
'.')
25 for (i = 0; dirs[i]; i++) {
26 sprintf(path,
"%s/%s", dirs[i], name);
28 if (access(path, 0) == 0) {
43 sprintf(path,
"%s/etc/%s",
G_gisbase(), name);
44 if (access(path, 0) == 0)
65 return G__find_etc(name);
char * G_find_etc(const char *name)
searches for a file from the etc search list in GRASS_ADDON_ETC returns the full path to where the fi...
char ** G_tokenize(const char *, const char *)
Tokenize string.
const char * G_gisbase(void)
Get full path name of the top level module directory.
void G_free_tokens(char **)
Free memory allocated to tokens.
char * G_store(const char *)
Copy string to allocated memory.