isposix

Un outil pour savoir si une commande est posix - retour accueil

git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |

localedef.html (19903B)


      1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved -->
      2 <!DOCTYPE HTML>
      3 <html lang="en">
      4 <head>
      5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0">
      6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 -->
      8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved -->
      9 <title>localedef</title>
     10 </head>
     11 <body bgcolor="white">
     12 <div class="NAVHEADER">
     13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
     14 <tr class="nav">
     15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/locale.html" accesskey="P">&lt;&lt;&lt;
     16 Previous</a></td>
     17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
     18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/logger.html" accesskey="N">Next
     19 &gt;&gt;&gt;</a></td>
     20 </tr>
     21 </table>
     22 <hr align="left" width="100%"></div>
     23 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3">
     24 <center><font size="2">The Open Group Base Specifications Issue 8<br>
     25 IEEE Std 1003.1-2024<br>
     26 Copyright © 2001-2024 The IEEE and The Open Group</font></center>
     27 <hr size="2" noshade>
     28 <a name="top" id="top"></a> <a name="localedef" id="localedef"></a> <a name="tag_20_69" id="tag_20_69"></a><!-- localedef -->
     29 <h4 class="mansect"><a name="tag_20_69_01" id="tag_20_69_01"></a>NAME</h4>
     30 <blockquote>localedef — define locale environment</blockquote>
     31 <h4 class="mansect"><a name="tag_20_69_02" id="tag_20_69_02"></a>SYNOPSIS</h4>
     32 <blockquote class="synopsis">
     33 <p><code><tt>localedef</tt> <b>[</b><tt>-c</tt><b>] [</b><tt>-f</tt> <i>charmap</i><b>] [</b><tt>-i</tt> <i>sourcefile</i><b>]
     34 [</b><tt>-u</tt> <i>code_set_name</i><b>]</b> <i>name</i></code></p>
     35 </blockquote>
     36 <h4 class="mansect"><a name="tag_20_69_03" id="tag_20_69_03"></a>DESCRIPTION</h4>
     37 <blockquote>
     38 <p>The <i>localedef</i> utility shall convert source definitions for locale categories into a format usable by the functions and
     39 utilities whose operational behavior is determined by the setting of the locale environment variables defined in XBD <a href=
     40 "../basedefs/V1_chap07.html#tag_07"><i>7. Locale</i></a> . It is implementation-defined whether users have the capability to create
     41 new locales, in addition to those supplied by the implementation. If the symbolic constant POSIX2_LOCALEDEF is defined, the system
     42 supports the creation of new locales. <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif"
     43 alt="[Option Start]" border="0"> &nbsp;On XSI-conformant systems, the symbolic constant POSIX2_LOCALEDEF shall be defined.
     44 <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
     45 <p>The utility shall read source definitions for one or more locale categories belonging to the same locale from the file named in
     46 the <b>-i</b> option (if specified) or from standard input.</p>
     47 <p>The <i>name</i> operand identifies the target locale. The utility shall support the creation of <i>public</i>, or generally
     48 accessible locales, as well as <i>private</i>, or restricted-access locales. Implementations may restrict the capability to create
     49 or modify public locales to users with appropriate privileges.</p>
     50 <p>Each category source definition shall be identified by the corresponding environment variable name and terminated by an
     51 <b>END</b> <i>category-name</i> statement. The following categories shall be supported. In addition, the input may contain source
     52 for implementation-defined categories.</p>
     53 <dl compact>
     54 <dd></dd>
     55 <dt><i>LC_CTYPE</i></dt>
     56 <dd>Defines character classification and case conversion.</dd>
     57 <dt><i>LC_COLLATE</i></dt>
     58 <dd><br>
     59 Defines collation rules.</dd>
     60 <dt><i>LC_MONETARY</i></dt>
     61 <dd><br>
     62 Defines the format and symbols used in formatting of monetary information.</dd>
     63 <dt><i>LC_NUMERIC</i></dt>
     64 <dd><br>
     65 Defines the decimal delimiter, grouping, and grouping symbol for non-monetary numeric editing.</dd>
     66 <dt><i>LC_TIME</i></dt>
     67 <dd>Defines the format and content of date and time information.</dd>
     68 <dt><i>LC_MESSAGES</i></dt>
     69 <dd><br>
     70 Defines the format and values of affirmative and negative responses.</dd>
     71 </dl>
     72 <p>If the <i>LC_COLLATE</i> category defines a collation sequence that does not have a total ordering of all characters,
     73 <i>localedef</i> shall write a warning message to standard error and, if the exit status would otherwise have been zero, shall exit
     74 with status 1.</p>
     75 </blockquote>
     76 <h4 class="mansect"><a name="tag_20_69_04" id="tag_20_69_04"></a>OPTIONS</h4>
     77 <blockquote>
     78 <p>The <i>localedef</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     79 Guidelines</i></a> .</p>
     80 <p>The following options shall be supported:</p>
     81 <dl compact>
     82 <dd></dd>
     83 <dt><b>-c</b></dt>
     84 <dd>Create permanent output even if warning messages have been issued.</dd>
     85 <dt><b>-f&nbsp;</b><i>charmap</i></dt>
     86 <dd>Specify the pathname of a file containing a mapping of character symbols and collating element symbols to actual character
     87 encodings. The format of the <i>charmap</i> is described in XBD <a href="../basedefs/V1_chap06.html#tag_06_04"><i>6.4 Character Set
     88 Description File</i></a> . The application shall ensure that this option is specified if symbolic names (other than collating
     89 symbols defined in a <b>collating-symbol</b> keyword) are used. If the <b>-f</b> option is not present, an implementation-defined
     90 character mapping shall be used.</dd>
     91 <dt><b>-i&nbsp;</b><i>inputfile</i></dt>
     92 <dd>The pathname of a file containing the source definitions. If this option is not present, source definitions shall be read from
     93 standard input. The format of the <i>inputfile</i> is described in XBD <a href="../basedefs/V1_chap07.html#tag_07_03"><i>7.3 Locale
     94 Definition</i></a> .</dd>
     95 <dt><b>-u&nbsp;</b><i>code_set_name</i></dt>
     96 <dd><br>
     97 Specify the name of a codeset used as the target mapping of character symbols and collating element symbols whose encoding values
     98 are defined in terms of the ISO/IEC&nbsp;10646-1:2020 standard position constant values.</dd>
     99 </dl>
    100 </blockquote>
    101 <h4 class="mansect"><a name="tag_20_69_05" id="tag_20_69_05"></a>OPERANDS</h4>
    102 <blockquote>
    103 <p>The following operand shall be supported:</p>
    104 <dl compact>
    105 <dd></dd>
    106 <dt><i>name</i></dt>
    107 <dd>Identifies the locale; see XBD <a href="../basedefs/V1_chap07.html#tag_07"><i>7. Locale</i></a> for a description of the use of
    108 this name. If the name contains one or more &lt;slash&gt; characters, <i>name</i> shall be interpreted as a pathname where the
    109 created locale definitions shall be stored. If <i>name</i> does not contain any &lt;slash&gt; characters, the interpretation of the
    110 name is implementation-defined and the locale shall be public. The ability to create public locales in this way may be restricted
    111 to users with appropriate privileges. (As a consequence of specifying one <i>name</i>, although several categories can be processed
    112 in one execution, only categories belonging to the same locale can be processed.)</dd>
    113 </dl>
    114 </blockquote>
    115 <h4 class="mansect"><a name="tag_20_69_06" id="tag_20_69_06"></a>STDIN</h4>
    116 <blockquote>
    117 <p>Unless the <b>-i</b> option is specified, the standard input shall be a text file containing one or more locale category source
    118 definitions, as described in XBD <a href="../basedefs/V1_chap07.html#tag_07_03"><i>7.3 Locale Definition</i></a> . When lines are
    119 continued using the escape character mechanism, there is no limit to the length of the accumulated continued line.</p>
    120 </blockquote>
    121 <h4 class="mansect"><a name="tag_20_69_07" id="tag_20_69_07"></a>INPUT FILES</h4>
    122 <blockquote>
    123 <p>The character set mapping file specified as the <i>charmap</i> option-argument is described in XBD <a href=
    124 "../basedefs/V1_chap06.html#tag_06_04"><i>6.4 Character Set Description File</i></a> . If a locale category source definition
    125 contains a <b>copy</b> statement, as defined in XBD <a href="../basedefs/V1_chap07.html#tag_07"><i>7. Locale</i></a> , and the
    126 <b>copy</b> statement names a valid, existing locale, then <i>localedef</i> shall behave as if the source definition had contained
    127 a valid category source definition for the named locale.</p>
    128 </blockquote>
    129 <h4 class="mansect"><a name="tag_20_69_08" id="tag_20_69_08"></a>ENVIRONMENT VARIABLES</h4>
    130 <blockquote>
    131 <p>The following environment variables shall affect the execution of <i>localedef</i>:</p>
    132 <dl compact>
    133 <dd></dd>
    134 <dt><i>LANG</i></dt>
    135 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
    136 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
    137 variables used to determine the values of locale categories.)</dd>
    138 <dt><i>LC_ALL</i></dt>
    139 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
    140 <dt><i>LC_COLLATE</i></dt>
    141 <dd><br>
    142 (This variable has no affect on <i>localedef</i>; the POSIX locale is used for this category.)</dd>
    143 <dt><i>LC_CTYPE</i></dt>
    144 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
    145 opposed to multi-byte characters in arguments and input files). This variable has no affect on the processing of <i>localedef</i>
    146 input data; the POSIX locale is used for this purpose, regardless of the value of this variable.</dd>
    147 <dt><i>LC_MESSAGES</i></dt>
    148 <dd><br>
    149 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
    150 <dt><i>NLSPATH</i></dt>
    151 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    152 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
    153 "0"></dd>
    154 </dl>
    155 </blockquote>
    156 <h4 class="mansect"><a name="tag_20_69_09" id="tag_20_69_09"></a>ASYNCHRONOUS EVENTS</h4>
    157 <blockquote>
    158 <p>Default.</p>
    159 </blockquote>
    160 <h4 class="mansect"><a name="tag_20_69_10" id="tag_20_69_10"></a>STDOUT</h4>
    161 <blockquote>
    162 <p>The utility shall report all categories successfully processed, in an unspecified format.</p>
    163 </blockquote>
    164 <h4 class="mansect"><a name="tag_20_69_11" id="tag_20_69_11"></a>STDERR</h4>
    165 <blockquote>
    166 <p>The standard error shall be used only for diagnostic messages.</p>
    167 </blockquote>
    168 <h4 class="mansect"><a name="tag_20_69_12" id="tag_20_69_12"></a>OUTPUT FILES</h4>
    169 <blockquote>
    170 <p>The format of the created output is unspecified. If the <i>name</i> operand does not contain a &lt;slash&gt;, the existence of
    171 an output file for the locale is unspecified.</p>
    172 </blockquote>
    173 <h4 class="mansect"><a name="tag_20_69_13" id="tag_20_69_13"></a>EXTENDED DESCRIPTION</h4>
    174 <blockquote>
    175 <p>When the <b>-u</b> option is used, the <i>code_set_name</i> option-argument shall be interpreted as an implementation-defined
    176 name of a codeset to which the ISO/IEC&nbsp;10646-1:2020 standard position constant values shall be converted via an
    177 implementation-defined method. Both the ISO/IEC&nbsp;10646-1:2020 standard position constant values and other formats (decimal,
    178 hexadecimal, or octal) shall be valid as encoding values within the <i>charmap</i> file. The codeset represented by the
    179 implementation-defined name can be any codeset that is supported by the implementation.</p>
    180 <p>When conflicts occur between the <i>charmap</i> specification of &lt;<i>code_set_name</i>&gt;, &lt;<i>mb_cur_max</i>&gt;, or
    181 &lt;<i>mb_cur_min</i>&gt; and the implementation-defined interpretation of these respective items for the codeset represented by
    182 the <b>-u</b> option-argument <i>code_set_name</i>, the result is unspecified.</p>
    183 <p>When conflicts (including omissions) occur between the <i>charmap</i> encoding values specified for symbolic names of characters
    184 of the portable character set and the implementation-defined assignment of character encoding values, the result is unspecified. If
    185 the result is that <i>localedef</i> creates the specified locale, any attempted use of that locale by an application or utility
    186 results in undefined behavior.</p>
    187 <p>If a non-printable character in the <i>charmap</i> has a width specified that is not <b>-1</b>, the result is undefined.</p>
    188 </blockquote>
    189 <h4 class="mansect"><a name="tag_20_69_14" id="tag_20_69_14"></a>EXIT STATUS</h4>
    190 <blockquote>
    191 <p>The following exit values shall be returned:</p>
    192 <dl compact>
    193 <dd></dd>
    194 <dt>&nbsp;0</dt>
    195 <dd>No errors occurred and the locales were successfully created.</dd>
    196 <dt>&nbsp;1</dt>
    197 <dd>Warnings occurred and the locales were successfully created.</dd>
    198 <dt>&nbsp;2</dt>
    199 <dd>The locale specification exceeded implementation limits or the coded character set or sets used were not supported by the
    200 implementation, and no locale was created.</dd>
    201 <dt>&nbsp;3</dt>
    202 <dd>The capability to create new locales is not supported by the implementation.</dd>
    203 <dt>&gt;3</dt>
    204 <dd>Warnings or errors occurred and no output was created.</dd>
    205 </dl>
    206 </blockquote>
    207 <h4 class="mansect"><a name="tag_20_69_15" id="tag_20_69_15"></a>CONSEQUENCES OF ERRORS</h4>
    208 <blockquote>
    209 <p>If an error is detected, no permanent output shall be created.</p>
    210 <p>If warnings occur, permanent output shall be created if the <b>-c</b> option was specified. The following conditions shall cause
    211 warning messages to be issued:</p>
    212 <ul>
    213 <li>
    214 <p>If a symbolic name not found in the <i>charmap</i> file is used for the descriptions of the <i>LC_CTYPE</i> or <i>LC_COLLATE</i>
    215 categories (for other categories, this shall be an error condition).</p>
    216 </li>
    217 <li>
    218 <p>If the number of operands to the <b>order</b> keyword exceeds the {COLL_WEIGHTS_MAX} limit.</p>
    219 </li>
    220 <li>
    221 <p>If optional keywords not supported by the implementation are present in the source.</p>
    222 </li>
    223 </ul>
    224 <p>Other implementation-defined conditions may also cause warnings.</p>
    225 </blockquote>
    226 <hr>
    227 <div class="box"><em>The following sections are informative.</em></div>
    228 <h4 class="mansect"><a name="tag_20_69_16" id="tag_20_69_16"></a>APPLICATION USAGE</h4>
    229 <blockquote>
    230 <p>The <i>charmap</i> definition is optional, and is contained outside the locale definition. This allows both completely
    231 self-defined source files, and generic sources (applicable to more than one codeset). To aid portability, all <i>charmap</i>
    232 definitions must use the same symbolic names for the portable character set. As explained in XBD <a href=
    233 "../basedefs/V1_chap06.html#tag_06_04"><i>6.4 Character Set Description File</i></a> , it is implementation-defined whether or not
    234 users or applications can provide additional character set description files. Therefore, the <b>-f</b> option might be operable
    235 only when an implementation-defined <i>charmap</i> is named.</p>
    236 </blockquote>
    237 <h4 class="mansect"><a name="tag_20_69_17" id="tag_20_69_17"></a>EXAMPLES</h4>
    238 <blockquote>
    239 <p>None.</p>
    240 </blockquote>
    241 <h4 class="mansect"><a name="tag_20_69_18" id="tag_20_69_18"></a>RATIONALE</h4>
    242 <blockquote>
    243 <p>The output produced by the <i>localedef</i> utility is implementation-defined. The <i>name</i> operand is used to identify the
    244 specific locale. (As a consequence, although several categories can be processed in one execution, only categories belonging to the
    245 same locale can be processed.)</p>
    246 <p>When conflicts (including omissions) occur between the <i>charmap</i> encoding values specified for symbolic names of characters
    247 of the portable character set and the implementation-defined assignment of character encoding values, it is recommended that
    248 <i>localedef</i> treats this as an error in order to prevent the undefined behavior that results if <i>localedef</i> creates the
    249 specified locale and an application or utility attempts to use it.</p>
    250 </blockquote>
    251 <h4 class="mansect"><a name="tag_20_69_19" id="tag_20_69_19"></a>FUTURE DIRECTIONS</h4>
    252 <blockquote>
    253 <p>If this utility is directed to create a new directory entry that contains any bytes that have the encoded value of a
    254 &lt;newline&gt; character, implementations are encouraged to treat this as an error. A future version of this standard may require
    255 implementations to treat this as an error.</p>
    256 </blockquote>
    257 <h4 class="mansect"><a name="tag_20_69_20" id="tag_20_69_20"></a>SEE ALSO</h4>
    258 <blockquote>
    259 <p><a href="../utilities/locale.html#"><i>locale</i></a></p>
    260 <p>XBD <a href="../basedefs/V1_chap06.html#tag_06_04"><i>6.4 Character Set Description File</i></a> , <a href=
    261 "../basedefs/V1_chap07.html#tag_07"><i>7. Locale</i></a> , <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment
    262 Variables</i></a> , <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    263 </blockquote>
    264 <h4 class="mansect"><a name="tag_20_69_21" id="tag_20_69_21"></a>CHANGE HISTORY</h4>
    265 <blockquote>
    266 <p>First released in Issue 4.</p>
    267 </blockquote>
    268 <h4 class="mansect"><a name="tag_20_69_22" id="tag_20_69_22"></a>Issue 6</h4>
    269 <blockquote>
    270 <p>The <b>-u</b> option is added, as specified in the IEEE&nbsp;P1003.2b draft standard.</p>
    271 <p>The normative text is reworded to avoid use of the term &quot;must&quot; for application requirements.</p>
    272 <p>IEEE&nbsp;Std&nbsp;1003.1-2001/Cor&nbsp;2-2004, item XCU/TC2/D6/15 is applied, rewording text in the OPERANDS section describing
    273 the ability to create public locales.</p>
    274 <p>IEEE&nbsp;Std&nbsp;1003.1-2001/Cor&nbsp;2-2004, item XCU/TC2/D6/16 is applied, making the text consistent with the descriptions
    275 of <b>WIDTH</b> and <b>WIDTH_DEFAULT</b> in the Base Definitions volume of POSIX.1-2024.</p>
    276 </blockquote>
    277 <h4 class="mansect"><a name="tag_20_69_23" id="tag_20_69_23"></a>Issue 7</h4>
    278 <blockquote>
    279 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p>
    280 </blockquote>
    281 <h4 class="mansect"><a name="tag_20_69_24" id="tag_20_69_24"></a>Issue 8</h4>
    282 <blockquote>
    283 <p>Austin Group Defect 251 is applied, encouraging implementations to disallow the creation of filenames containing any bytes that
    284 have the encoded value of a &lt;newline&gt; character.</p>
    285 <p>Austin Group Defect 1070 is applied, requiring that <i>localedef</i> issues a warning if the <i>LC_COLLATE</i> category defines
    286 a collation sequence that does not have a total ordering of all characters.</p>
    287 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    288 <p>Austin Group Defect 1609 is applied, clarifying the behavior when conflicts (including omissions) occur between the
    289 <i>charmap</i> encoding values specified for symbolic names of characters of the portable character set and the
    290 implementation-defined assignment of character encoding values.</p>
    291 </blockquote>
    292 <div class="box"><em>End of informative text.</em></div>
    293 <hr>
    294 <p>&nbsp;</p>
    295 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    296 <hr size="2" noshade>
    297 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    298 POSIX™ is a Trademark of The IEEE.<br>
    299 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    300 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    301 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    302 ]</font></center>
    303 <hr size="2" noshade>
    304 <div class="NAVHEADER">
    305 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    306 <tr class="nav">
    307 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/locale.html" accesskey="P">&lt;&lt;&lt;
    308 Previous</a></td>
    309 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    310 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/logger.html" accesskey="N">Next
    311 &gt;&gt;&gt;</a></td>
    312 </tr>
    313 </table>
    314 <hr align="left" width="100%"></div>
    315 </body>
    316 </html>