MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / setenv

Function setenv

src/utilities/core/test/ApplicationPathHelpers_GTest.cpp:27–34  ·  view source on GitHub ↗

A wrapper to implement setenv on Windows like on Unix, using _putenv internally

Source from the content-addressed store, hash-verified

25
26// A wrapper to implement setenv on Windows like on Unix, using _putenv internally
27int setenv(const char* name, const char* value, int overwrite) {
28 if (!overwrite) {
29 size_t envsize = 0;
30 int errcode = getenv_s(&envsize, NULL, 0, name);
31 if (errcode || envsize) return errcode;
32 }
33 return _putenv_s(name, value);
34}
35
36void unsetenv(const char* name) {
37 _putenv_s(name, "");

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected