environ.5int

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 5INT 代码 · 共 293 行

5INT
293
字号
.TH environ 5int.SH Name environ \- natural language support (NLS) environment variables .SH Description .NXR "environment" "variables".NXR "NLS (natural language support) environment" "variables"The international environment variables are defined for the ULTRIXsystem and are additional to those described in the ULTRIX reference pages, Sections 2 (system calls) and 3 (routines),and the .MS environ 7 reference page.The international variables are made available to a process by.PN exec ..PPThis reference page is divided into two sections.  The first sectiondescribes environment variables that can control the locale setting.  Thesecond section describes the variables that control where the.PN catopenfunction searches for message catalogs and where the.PN setlocalefunction searches for language databases..SS "Environment Variables That Control the Locale Setting"The LANG, LC_COLLATE, LC_TYPE, LC_NUMERIC, LC_TIME, and LC_MONETARYenvironment variables can control the locale setting.  You definethese variables using the same format as the .I localeargument to the.PN setlocale function.  The following shows the format you use:.EXlanguage[_territory[.codeset]][@modifier].EEIn .IR language , you specify the native language of theuser.  You can optionally specify the user's dialect and codeset using.I _territory and .IR codeset .For example, the following definition of LANG specifies the French native language, as spoken inFrance (as opposed to in Switzerland), and the Digital MultinationalCharacter Set:.EX 0LANG = FRE_FR.MCS.EEIn .IR @modifier , you specify a specific instance of localization data within a single category. For example, using .IR @modifier  , you can specify telephone directory ordering of data, as opposed to dictionary ordering of data.  You cannot use .I @modifierto define the LANG variable..PPThe following list describes the environment variables that controlthe locale setting:.IP LANG 15Identifies the user's requirements for native language, local customs,and coded character set. At run time, you can bind the user's language requirements, as specified by the setting of.PN LANG ,to the execution of a program by calling.PN setlocale ,as follows:.EXsetlocale (LC_ALL, "");.EE.IPIf .PN LANGis not defined in the current environment, the locale defaults to the C locale. For more information on the C locale, see the.I POSIX Conformance Document. .IPSystem administrators can define .PN LANGto provide a  default setting for the system as a whole, or user's can define.PN LANGindividually using standard command interpreter facilities.  .IP LC_COLLATEContains the user's requirements for language, territory, and codeset for the character collation format..PN LC_COLLATEaffects the behavior of regular expressions and the string collationfunctions in.PN strcolland.PN strxfrm .If .PN LC_COLLATEis not defined in the current environment,.PN LANGprovides the necessary default..IP LC_CTYPEContains the user's requirements for language, territory, and codeset forthe character classification and conversion format..PN LC_CTYPEaffects the behavior of the character-handling functions in.PN convand.PN ctype .If .PN LC_CTYPEis not defined in the current environment,.PN LANGprovides the necessary default..IP LC_MONETARYContains the user's requirements for language, territory, and codeset forthe monetary format..PN LC_MONETARYaffects the currency string in .PN nl_langinfo .If .PN LC_MONETARYis not defined in the current environment,.PN LANGprovides the necessary default..IP LC_NUMERICContains the user's requirements for language, territory, and codeset forthe numeric data presentation format..PN LC_NUMERICaffects the radix and thousands separator character for theformatted I/O functions in.PN printf ,.PN scanf ,.PN nl_printf ,.PN nl_scanf ,and the string conversion functions in.PN ecvtand.PN atol .If .PN LC_NUMERICis not defined in the current environment,.PN LANGprovides the necessary default..IP LC_TIMEContains the user's requirements for language, territory, and codeset forthe time format..PN LC_TIMEaffects the behavior of the time functions in.PN strftime .If .PN LC_TIMEis not defined in the current environment,.PN LANGprovides the necessary default..SS Environment Variables That Specify LocationsThe NLSPATH and INTLINFO environment variables control where the.PN catopenand .PN setlocalefunctions search for message catalogs and the language databases.You define these variables using a pathname or set of pathnames.  Thepathnames can contain variable elements, called substitution fields,that allow your program or the setting of other environment variables to affect the setting of NLSPATH and INTLINFO.  The following shows the format you use to define these variables:.EX\fIvariable-name\fP="[:][/\fIdirectory\fP][/\fIsubstitution field\fP]           [/\fIfile-name\fP][:\fIalternate-pathname\fP][:...".EEYou specify either NLSPATH or INTLINFO in place of.IR variable-name ..PPA colon (:) that precedes other parts of any pathname in the definitionspecifies the current directory..PPIn .IR directory , you can specify a specific directory in which thefunction searches.  If you need the environment variable to beflexible, you can use a substitution field in place of or withdirectory names.  A substitution field consists of a percent sign (%),followed by a code letter.  The substitution fields you can use are as follows:.IP %N 5The value of the.I nameargument you pass to.PN catopen .IP %LThe value ofthe LANG environment variable.IP %lThe.I languageelement from LANG.IP %tThe.I territoryelement from LANG.IP %cThe.I codesetelement from LANG.IP %%A literal percent sign.PPIf a substitution field you specify is currently undefined, .PN catopenor.PN setlocalesubstitutes a null string.  Neither function includes the underscore(_) or period (.) separator in .PN %t or .PN %csubstitutions..PPYou can specify more than one pathname when you define theseenvironment variables.  You separate each pathname from the one thatfollows it using a colon (:).  If you need to specify the currentdirectory in a pathname other than the first pathname in the list, usea double colon (::).  The functions interpret the first colon as aseparator between pathnames and the second colon as specifying thecurrent directory..PPThe following describes the ICONV, INTLINFO, and NLSPATH environmentvariables:.IP ICONV 10The ICONV environment variable stores the directory pathname for the conversion codesets used by the .PN iconvcommand. If this variable is undefined, .PN iconvsearches the .PN /usr/lib/intln/convdirectory.  .IPThe following example shows how to define ICONV:.EXICONV=/usr/lib/international/conversions.EEIn this example, .PN ICONVis defined as the directory pathname.PN /usr/users/international/conversions ..IP INTLINFOThe INTLINFO environment variable stores the location of the languagedatabase. The.PN setlocalefunction reads INTLINFO when it searches for the database.  .IPThe following example shows how to define INTLINFO:.EXINTLINFO = ":%L:/usr/lib/intln/%L:/usr/lib/intln/ENG_%t.%c".EEIn this example, the.PN setlocalefunction searches for the language database named in the LANG environmentvariable. The function searches for the variable in the currentdirectory. If the database is not in the current directory, .PN setlocalesearches in the.PN /usr/lib/intlndirectory for that same database. Finally, if the database specifiedby LANG is unavailable, .PN setlocalesearches in.PN /usr/lib/intlnfor the English language database that matches the current territoryand codeset..IP NLSPATHThe NLSPATH environment variable controls where the.PN catopen function searches for a message catalog..IPThe following example shows defines NLSPATH:.EXNLSPATH=":%N.cat:/nlslib/%N.cat:nlslib/program.cat".EEThis definition causes.PN catopento search in the current directory for the message catalog named in the .I nameargument you pass.  If the function cannot find themessage catalog in the current directory, it searches in the.PN /nlslibdirectory.  If the catalog is not in that directory, .PN catopenopens the .PN /nlslib/program.catmessage catalog..SH See Also exec(2), catopen(3int), intro(3int), setlocale(3), lang(5int).br.I Guide to Developing International Software

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?