388 /* endianness of platform */ 389 { 390 unsigned int endianTest = 0xff000000; 391 if (((char*)(&endianTest))[0] != 0) 392 sprops.cpu_endian = "big"; 393 else 394 sprops.cpu_endian = "little"; 395 } 396 397 /* os properties */ 398 { 399 struct utsname name; 400 uname(&name); 401 sprops.os_name = strdup(name.sysname); 402 sprops.os_version = strdup(name.release); 403 404 sprops.os_arch = ARCHPROPNAME; 405 406 if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL) { 407 sprops.desktop = "gnome"; 408 } 409 else { 410 sprops.desktop = NULL; 411 } 412 } 413 414 /* Determine the language, country, variant, and encoding from the host, 415 * and store these in the user.language, user.country, user.variant and 416 * file.encoding system properties. */ 417 setlocale(LC_ALL, ""); 418 if (ParseLocale(LC_CTYPE, 419 &(sprops.format_language), 420 &(sprops.format_script), 421 &(sprops.format_country), 422 &(sprops.format_variant), 423 &(sprops.encoding))) { 424 ParseLocale(LC_MESSAGES, 425 &(sprops.language), 426 &(sprops.script), 427 &(sprops.country), 428 &(sprops.variant), 429 NULL); | 388 /* endianness of platform */ 389 { 390 unsigned int endianTest = 0xff000000; 391 if (((char*)(&endianTest))[0] != 0) 392 sprops.cpu_endian = "big"; 393 else 394 sprops.cpu_endian = "little"; 395 } 396 397 /* os properties */ 398 { 399 struct utsname name; 400 uname(&name); 401 sprops.os_name = strdup(name.sysname); 402 sprops.os_version = strdup(name.release); 403 404 sprops.os_arch = ARCHPROPNAME; 405 406 if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL) { 407 sprops.desktop = "gnome"; 408 } else if ((strcmp(getenv("DESKTOP_SESSION"), "xfce") == 0) || 409 (strcmp(getenv("DESKTOP_SESSION"), "xfce4") == 0)) { 410 sprops.desktop = "xfce"; 411 } else { 412 sprops.desktop = NULL; 413 } 414 } 415 416 /* Determine the language, country, variant, and encoding from the host, 417 * and store these in the user.language, user.country, user.variant and 418 * file.encoding system properties. */ 419 setlocale(LC_ALL, ""); 420 if (ParseLocale(LC_CTYPE, 421 &(sprops.format_language), 422 &(sprops.format_script), 423 &(sprops.format_country), 424 &(sprops.format_variant), 425 &(sprops.encoding))) { 426 ParseLocale(LC_MESSAGES, 427 &(sprops.language), 428 &(sprops.script), 429 &(sprops.country), 430 &(sprops.variant), 431 NULL); |