46 #include "../lib/memdebug.h"
50 char *GetEnv(
const char *
variable,
char do_expand)
54 char buf1[1024], buf2[1024];
60 rc = GetEnvironmentVariable(variable, buf1,
sizeof(buf1));
61 if (rc > 0 && rc <
sizeof(buf1)) {
65 if (do_expand && strchr(variable,
'%')) {
67 rc = ExpandEnvironmentStrings (variable, buf2,
sizeof(buf2));
68 if (rc > 0 && rc <
sizeof(buf2) &&
75 env = getenv(variable);
76 if (env &&
strcmp(
"HOME",variable) == 0) {
77 env = decc$translate_vms(env);
81 env = getenv(variable);
90 char *home = GetEnv(
"HOME",
FALSE);
94 #if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
96 struct passwd *pw = getpwuid(geteuid());
100 home = decc$translate_vms(pw->pw_dir);
110 home = GetEnv(
"APPDATA",
TRUE);
112 home = GetEnv(
"%USERPROFILE%\\Application Data",
TRUE);
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red