16 #include <grass/gis.h> 17 #include <grass/glocale.h> 19 #include "local_proto.h" 39 G_fatal_error(_(
"Unable to determine user's home directory"));
55 static int initialized;
56 static const char *home = 0;
66 home = getenv(
"USERPROFILE");
69 sprintf(buf,
"%s%s", getenv(
"HOMEDRIVE"), getenv(
"HOMEPATH"));
76 home = getenv(
"HOME");
79 home = getenv(
"HOME");
100 static int initialized_config;
101 static const char *config_path = 0;
108 sprintf(buf,
"%s%c%s", getenv(
"APPDATA"), HOST_DIRSEP, CONFIG_DIR);
110 sprintf(buf,
"%s%c%s",
G_home(), HOST_DIRSEP, CONFIG_DIR);
119 if (ret == -1 && errno != EEXIST)
const char * G__home(void)
Get user's home directory (internal use only)
int G_mkdir(const char *path)
Creates a new directory.
char * G_store(const char *s)
Copy string to allocated memory.
int G_is_initialized(int *p)
void G_initialize_done(int *p)
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
const char * G_config_path(void)
Get user's config path directory.
const char * G_home(void)
Get user's home directory.