31 typedef int (_cdecl * PUTENVPROC) (
const char *);
32 static const char *
const modulenames[] = {
63 envcpy = strdup(envval);
66 cp = strchr(envcpy,
'=');
81 if (!SetEnvironmentVariable(envcpy, cp))
96 for (
i = 0; modulenames[
i];
i++)
98 HMODULE hmodule = NULL;
99 BOOL
res = GetModuleHandleEx(0, modulenames[
i], &hmodule);
101 if (
res != 0 && hmodule != NULL)
103 PUTENVPROC putenvFunc;
105 putenvFunc = (PUTENVPROC) (
pg_funcptr_t) GetProcAddress(hmodule,
"_putenv");
108 FreeLibrary(hmodule);
117 return _putenv(envval);
127 if (
name == NULL ||
name[0] ==
'\0' || strchr(
name,
'=') != NULL ||
void(* pg_funcptr_t)(void)
static void PGresult * res
static void overwrite(PGconn *conn, Oid lobjId, int start, int len)
int pgwin32_unsetenv(const char *name)
int pgwin32_putenv(const char *envval)
int pgwin32_setenv(const char *name, const char *value, int overwrite)