Files
oldlinux-files/Ref-docs/POSIX/susv3/basedefs/langinfo.h.html
2024-02-19 00:21:47 -05:00

826 lines
17 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>&lt;langinfo.h&gt;</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="&lt;langinfo.h&gt;"></a> <a name="tag_13_22"></a><!-- &lt;langinfo.h&gt; -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_13_22_01"></a>NAME</h4>
<blockquote>langinfo.h - language information constants</blockquote>
<h4><a name="tag_13_22_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
"[Option Start]" border="0"> #include &lt;langinfo.h&gt; <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></div>
</blockquote>
<h4><a name="tag_13_22_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>&lt;langinfo.h&gt;</i> header contains the constants used to identify items of <i>langinfo</i> data (see <a href=
"../functions/nl_langinfo.html"><i>nl_langinfo</i>()</a>). The type of the constant, <b>nl_item</b>, shall be defined as described
in <a href="nl_types.h.html"><i>&lt;nl_types.h&gt;</i></a> .</p>
<p>The following constants shall be defined. The entries under <b>Category</b> indicate in which <a href=
"../functions/setlocale.html"><i>setlocale</i>()</a> category each item is defined.</p>
<center>
<table border="1" cellpadding="3" align="center">
<tr valign="top">
<th align="center">
<p class="tent"><b>Constant</b></p>
</th>
<th align="center">
<p class="tent"><b>Category</b></p>
</th>
<th align="center">
<p class="tent"><b>Meaning</b></p>
</th>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">CODESET</p>
</td>
<td align="left">
<p class="tent"><i>LC_CTYPE</i></p>
</td>
<td align="left">
<p class="tent">Codeset name.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">D_T_FMT</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">String for formatting date and time.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">D_FMT</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Date format string.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">T_FMT</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Time format string.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">T_FMT_AMPM</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">a.m. or p.m. time format string.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">AM_STR</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Ante-meridiem affix.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">PM_STR</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Post-meridiem affix.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">DAY_1</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the first day of the week (for example, Sunday).</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">DAY_2</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the second day of the week (for example, Monday).</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">DAY_3</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the third day of the week (for example, Tuesday).</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">DAY_4</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the fourth day of the week</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent"></p>
</td>
<td align="left">
<p class="tent"><i>&nbsp;</i></p>
</td>
<td align="left">
<p class="tent">(for example, Wednesday).</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">DAY_5</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the fifth day of the week (for example, Thursday).</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">DAY_6</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the sixth day of the week (for example, Friday).</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">DAY_7</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the seventh day of the week</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent"></p>
</td>
<td align="left">
<p class="tent"><i>&nbsp;</i></p>
</td>
<td align="left">
<p class="tent">(for example, Saturday).</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABDAY_1</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the first day of the week.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABDAY_2</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the second day of the week.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABDAY_3</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the third day of the week.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABDAY_4</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the fourth day of the week.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABDAY_5</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the fifth day of the week.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABDAY_6</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the sixth day of the week.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABDAY_7</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the seventh day of the week.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_1</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the first month of the year.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_2</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the second month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_3</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the third month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_4</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the fourth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_5</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the fifth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_6</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the sixth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_7</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the seventh month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_8</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the eighth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_9</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the ninth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_10</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the tenth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_11</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the eleventh month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">MON_12</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Name of the twelfth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_1</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the first month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_2</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the second month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_3</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the third month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_4</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the fourth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_5</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the fifth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_6</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the sixth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_7</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the seventh month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_8</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the eighth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_9</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the ninth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_10</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the tenth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_11</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the eleventh month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ABMON_12</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Abbreviated name of the twelfth month.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ERA</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Era description segments.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ERA_D_FMT</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Era date format string.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ERA_D_T_FMT</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Era date and time format string.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ERA_T_FMT</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Era time format string.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">ALT_DIGITS</p>
</td>
<td align="left">
<p class="tent"><i>LC_TIME</i></p>
</td>
<td align="left">
<p class="tent">Alternative symbols for digits.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">RADIXCHAR</p>
</td>
<td align="left">
<p class="tent"><i>LC_NUMERIC</i></p>
</td>
<td align="left">
<p class="tent">Radix character.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">THOUSEP</p>
</td>
<td align="left">
<p class="tent"><i>LC_NUMERIC</i></p>
</td>
<td align="left">
<p class="tent">Separator for thousands.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">YESEXPR</p>
</td>
<td align="left">
<p class="tent"><i>LC_MESSAGES</i></p>
</td>
<td align="left">
<p class="tent">Affirmative response expression.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">NOEXPR</p>
</td>
<td align="left">
<p class="tent"><i>LC_MESSAGES</i></p>
</td>
<td align="left">
<p class="tent">Negative response expression.</p>
</td>
</tr>
<tr valign="top">
<td align="left">
<p class="tent">CRNCYSTR</p>
</td>
<td align="left">
<p class="tent"><i>LC_MONETARY</i></p>
</td>
<td align="left">
<p class="tent">Local currency symbol, preceded by <tt>'-'</tt> if the symbol should appear before the value, <tt>'+'</tt> if the
symbol should appear after the value, or <tt>'.'</tt> if the symbol should replace the radix character.</p>
</td>
</tr>
</table>
</center>
<p>If the locale's values for <b>p_cs_precedes</b> and <b>n_cs_precedes</b> do not match, the value of <i>nl_langinfo</i>(CRNCYSTR)
is unspecified.</p>
<p>The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided.</p>
<pre>
<tt>char *nl_langinfo(nl_item);
</tt>
</pre>
<p>Inclusion of the <i>&lt;langinfo.h&gt;</i> header may also make visible all symbols from <a href=
"../basedefs/nl_types.h.html"><i>&lt;nl_types.h&gt;</i></a>.</p>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_13_22_04"></a>APPLICATION USAGE</h4>
<blockquote>
<p>Wherever possible, users are advised to use functions compatible with those in the ISO&nbsp;C standard to access items of
<i>langinfo</i> data. In particular, the <a href="../functions/strftime.html"><i>strftime</i>()</a> function should be used to
access date and time information defined in category <i>LC_TIME .</i> The <a href=
"../functions/localeconv.html"><i>localeconv</i>()</a> function should be used to access information corresponding to RADIXCHAR,
THOUSEP, and CRNCYSTR.</p>
</blockquote>
<h4><a name="tag_13_22_05"></a>RATIONALE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_22_06"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_22_07"></a>SEE ALSO</h4>
<blockquote>
<p>The System Interfaces volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../functions/nl_langinfo.html"><i>nl_langinfo</i>()</a>, <a href="../functions/localeconv.html"><i>localeconv</i>()</a>, <a href=
"../functions/strfmon.html"><i>strfmon</i>()</a>, <a href="../functions/strftime.html"><i>strftime</i>()</a>, <a href=
"xbd_chap07.html#tag_07"><i>Locale</i></a></p>
</blockquote>
<h4><a name="tag_13_22_08"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 2.</p>
</blockquote>
<h4><a name="tag_13_22_09"></a>Issue 5</h4>
<blockquote>
<p>The constants YESSTR and NOSTR are marked LEGACY.</p>
</blockquote>
<h4><a name="tag_13_22_10"></a>Issue 6</h4>
<blockquote>
<p>The constants YESSTR and NOSTR are removed.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>