MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / getEnvironment

Function getEnvironment

client/vglclient.cpp:266–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264
265
266void getEnvironment(void)
267{
268 char *env = NULL; int temp;
269 if((env = getenv("VGLCLIENT_DRAWMODE")) != NULL && strlen(env) > 0)
270 {
271 if(!strnicmp(env, "o", 1)) drawMethod = RR_DRAWOGL;
272 else if(!strncmp(env, "x", 1)) drawMethod = RR_DRAWX11;
273 }
274 if((env = getenv("VGLCLIENT_LOG")) != NULL && strlen(env) > 0)
275 {
276 logFile = env;
277 FILE *f = fopen(logFile, "a");
278 if(!f)
279 {
280 vglout.println("Could not open log file %s", logFile);
281 THROW_UNIX();
282 }
283 else fclose(f);
284 }
285 if((env = getenv("VGLCLIENT_PORT")) != NULL && strlen(env) > 0
286 && (temp = atoi(env)) > 0 && temp < 65536)
287 port = (unsigned short)temp;
288 if((env = getenv("VGLCLIENT_IPV6")) != NULL && strlen(env) > 0
289 && (temp = atoi(env)) == 1)
290 ipv6 = true;
291}
292
293
294int main(int argc, char *argv[])

Callers 1

mainFunction · 0.85

Calls 2

getenvFunction · 0.85
printlnMethod · 0.80

Tested by

no test coverage detected