src/solaris/native/java/lang/java_props_md.c

Print this page




 497     {
 498 #ifdef MACOSX
 499         setOSNameAndVersion(&sprops);
 500 #else
 501         struct utsname name;
 502         uname(&name);
 503         sprops.os_name = strdup(name.sysname);
 504         sprops.os_version = strdup(name.release);
 505 #endif
 506 
 507         sprops.os_arch = ARCHPROPNAME;
 508 
 509         if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL) {
 510             sprops.desktop = "gnome";
 511         }
 512         else {
 513             sprops.desktop = NULL;
 514         }
 515     }
 516 





 517     /* Determine the language, country, variant, and encoding from the host,
 518      * and store these in the user.language, user.country, user.variant and
 519      * file.encoding system properties. */
 520     setlocale(LC_ALL, "");
 521     if (ParseLocale(env, LC_CTYPE,
 522                     &(sprops.format_language),
 523                     &(sprops.format_script),
 524                     &(sprops.format_country),
 525                     &(sprops.format_variant),
 526                     &(sprops.encoding))) {
 527         ParseLocale(env, LC_MESSAGES,
 528                     &(sprops.language),
 529                     &(sprops.script),
 530                     &(sprops.country),
 531                     &(sprops.variant),
 532                     NULL);
 533     } else {
 534         sprops.language = "en";
 535         sprops.encoding = "ISO8859-1";
 536     }




 497     {
 498 #ifdef MACOSX
 499         setOSNameAndVersion(&sprops);
 500 #else
 501         struct utsname name;
 502         uname(&name);
 503         sprops.os_name = strdup(name.sysname);
 504         sprops.os_version = strdup(name.release);
 505 #endif
 506 
 507         sprops.os_arch = ARCHPROPNAME;
 508 
 509         if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL) {
 510             sprops.desktop = "gnome";
 511         }
 512         else {
 513             sprops.desktop = NULL;
 514         }
 515     }
 516 
 517     /* ABI property (optional) */
 518 #ifdef ARCHABIPROPNAME
 519     sprops.sun_arch_abi = ARCHABIPROPNAME;
 520 #endif
 521 
 522     /* Determine the language, country, variant, and encoding from the host,
 523      * and store these in the user.language, user.country, user.variant and
 524      * file.encoding system properties. */
 525     setlocale(LC_ALL, "");
 526     if (ParseLocale(env, LC_CTYPE,
 527                     &(sprops.format_language),
 528                     &(sprops.format_script),
 529                     &(sprops.format_country),
 530                     &(sprops.format_variant),
 531                     &(sprops.encoding))) {
 532         ParseLocale(env, LC_MESSAGES,
 533                     &(sprops.language),
 534                     &(sprops.script),
 535                     &(sprops.country),
 536                     &(sprops.variant),
 537                     NULL);
 538     } else {
 539         sprops.language = "en";
 540         sprops.encoding = "ISO8859-1";
 541     }