17#include <grass/glocale.h>
19#include "gis_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);
120 if (ret == -1 && errno != EEXIST)
void G_initialize_done(int *p)
int G_is_initialized(int *p)
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
const char * G__home(void)
Get user's home directory (internal use only)
const char * G_home(void)
Get user's home directory.
const char * G_config_path(void)
Get user's config path directory.
int G_mkdir(const char *path)
Creates a new directory.
char * G_store(const char *s)
Copy string to allocated memory.