java_props_md.c revision 3082
2362N/A * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A#
error "The macro ARCHPROPNAME has not been defined" 0N/A/* Take an array of string pairs (map of key->value) and a string (key). 0N/A * Examine each pair in the map to see if the first string (key) matches the 0N/A * string. If so, store the second string of the pair (value) in the value and 0N/A * return 1. Otherwise do nothing and return 0. The end of the map is 0N/A * indicated by an empty string at the start of a pair (key of ""). 0N/A/* This function sets an environment variable using envstring. 0N/A * The format of envstring is "name=value". 0N/A * If the name has already existed, it will append value to the name. 0N/A return;
/* not a valid environment setting */ 0N/A /* copy first part as environment name */ 0N/A value++;
/* set value point to value of the envstring */ 0N/A /* value is not found in current environment, append it */ 0N/A /* else the value has already been set, do nothing */ 0N/A /* environment variable is not found */ 2700N/A /* Query the locale set for the category */ 2700N/A * Workaround for Solaris bug 4201684: Xlib doesn't like @euro 2700N/A * locales. Since we don't depend on the libc @euro behavior, 2700N/A * we just remove the qualifier. 2700N/A * On Linux, the bug doesn't occur; on the other hand, @euro 2700N/A * is needed there because it's a shortcut that also determines 2700N/A * the encoding - without it, we wouldn't get ISO-8859-15. 2700N/A * Therefore, this code section is Solaris-specific. 2700N/A * locale string format in Solaris is 2700N/A * <language name>_<country name>.<encoding name>@<variant name> 2700N/A * <country name>, <encoding name>, and <variant name> are optional. 2700N/A /* Parse the language, country, encoding, and variant from the 2700N/A * locale. Any of the elements may be missing, but they must occur 2700N/A * in the order language_country.encoding@variant, and must be 2700N/A * preceded by their delimiter (except for language). 2700N/A * If the locale name (without .encoding@variant, if any) matches 2700N/A * any of the names in the locale_aliases list, map it to the 2700N/A * corresponding full locale name. Most of the entries in the 2700N/A * locale_aliases list are locales that include a language name but 2700N/A * no country name, and this facility is used to map each language 2700N/A * to a default country if that's possible. It's also used to map 2700N/A * the Solaris locale aliases to their proper Java locale IDs. 2976N/A // check the "encoding_variant" again, if any. 2700N/A /* Normalize the language name */ 2700N/A /* Normalize the country name */ 2976N/A /* Normalize the script and variant name. Note that we only use 2976N/A * variants listed in the mapping array; others are ignored. 2700N/A /* Normalize the encoding name. Note that we IGNORE the string 2700N/A * 'encoding' extracted from the locale name above. Instead, we use the 2700N/A * more reliable method of calling nl_langinfo(CODESET). This function 2700N/A * returns an empty string if no encoding is set for the given locale 2700N/A * (e.g., the C or POSIX locales); we use the default ISO 8859-1 2700N/A * converter for such locales. 2700N/A /* OK, not so reliable - nl_langinfo() gives wrong answers on 2700N/A * Euro locales, in particular. */ 2700N/A /* Convert the bare "646" used on Solaris to a proper IANA name */ 2700N/A /* return same result nl_langinfo would return for en_UK, 2700N/A * in order to use optimizations. */ 2700N/A * Remap the encoding string to a different value for japanese 2700N/A * locales on linux so that customized converters are used instead 2700N/A * of the default converter for "EUC-JP". The customized converters 2700N/A * omit support for the JIS0212 encoding which is not supported by 2700N/A * the variant of "EUC-JP" encoding used on linux 2700N/A /* For Solaris use customized vendor defined character 2700N/A * customized EUC-JP converter 2700N/A * Remap the encoding string to Big5_Solaris which augments 2700N/A * the default converter for Solaris Big5 locales to include 2700N/A * seven additional ideographic characters beyond those included 2700N/A * in the Java "Big5" converter. 0N/A/* This function gets called very early, before VM_CALLS are setup. 0N/A * Do not use any of the VM_CALLS entries!!! 0N/A char *v;
/* tmp var */ 0N/A /* Printing properties */ 0N/A /* Java 2D properties */ 0N/A /* This is used only for debugging of font problems. */ 0N/A /* supported instruction sets */ 0N/A /* endianness of platform */ 0N/A /* Determine the language, country, variant, and encoding from the host, 0N/A * and store these in the user.language, user.country, user.variant and 0N/A * file.encoding system properties. */ 0N/A /* user properties */ 0N/A * We defer setting up timezone until it's actually necessary. 0N/A * Refer to TimeZone.getDefault(). However, the system 0N/A * property is necessary to be able to be set by the command 0N/A * line interface -D. Here temporarily set a null string to 0N/A /* Current directory */ 0N/A "Properties init: Could not determine current working directory.");
0N/A /* Append CDE message and resource search path to NLSPATH and 0N/A * XFILESEARCHPATH, in order to pick localized message for 0N/A * FileSelectionDialog window (Bug 4173641).