OSDN Git Service

b3ae5c58ebe0d792465826b7188d536cf6cda3c4
[linuxjm/LDP_man-pages.git] / draft / man3 / nl_langinfo.3
1 .\" Copyright (c) 2001 Markus Kuhn <mkuhn@acm.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 manual
10 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
11 .\"
12 .\" Corrected prototype, 2002-10-18, aeb
13 .\"
14 .\" Japanese Version Copyright (c) 2001
15 .\"          UCHIDA Norihiro all rights reserved.
16 .\" Translated Sun Jul 15 2001
17 .\"          by UCHIDA Norihiro <KY4N-UCD@asahi-net.or.jp>
18 .\"
19 .TH NL_LANGINFO 3 2010-10-03 "GNU" "Linux Programmer's Manual"
20 .\"O .SH NAME
21 .\"O nl_langinfo \- query language and locale information
22 .SH 名前
23 nl_langinfo \- 言語とロケールの情報を問い合わせる
24 .\"O .SH SYNOPSIS
25 .SH 書式
26 .nf
27 .B #include <langinfo.h>
28 .sp
29 .BI "char *nl_langinfo(nl_item " item );
30 .fi
31 .\"O .SH DESCRIPTION
32 .SH 説明
33 .\"O The
34 .\"O .BR nl_langinfo ()
35 .\"O function provides access to locale information
36 .\"O in a more flexible way than
37 .\"O .BR localeconv (3)
38 .\"O does.
39 .\"O Individual and additional elements of the locale categories can
40 .\"O be queried.
41 .BR nl_langinfo ()
42 関数は、
43 .BR localeconv (3)
44 より柔軟なロケール情報へのアクセス方法を提供する。
45 ロケールカテゴリの個々の要素や追加の要素を問い合わせることができる。
46 .PP
47 .\"O Examples for the locale elements that can be specified in \fIitem\fP
48 .\"O using the constants defined in \fI<langinfo.h>\fP are:
49 \fI<langinfo.h>\fP に定数として定義されていて、
50 \fIitem\fP に指定できるロケール要素の例を以下に示す:
51 .TP
52 .BR CODESET \ (LC_CTYPE)
53 .\"O Return a string with the name of the character encoding used in the
54 .\"O selected locale, such as "UTF-8", "ISO-8859-1", or "ANSI_X3.4-1968"
55 .\"O (better known as US-ASCII).
56 .\"O This is the same string that you get with
57 .\"O "locale charmap".
58 .\"O For a list of character encoding names,
59 .\"O try "locale \-m", cf.\&
60 .\"O .BR locale (1).
61 選択されたロケールで用いられる文字エンコード名を示す文字列を返す。
62 文字エンコード名としては、"UTF-8" や "ISO-8859-1"、"ANSI_X3.4-1968"
63 (これは US-ASCII という名前の方がよく知られている) などがある。
64 この文字列は、"locale charmap" を実行して得られるものと同じである。
65 文字エンコード名のリストを得るには、"locale \-m" を実行するとよい。
66 参考:
67 .BR locale (1)
68 .TP
69 .BR D_T_FMT \ (LC_TIME)
70 .\"O Return a string that can be used as a format string for
71 .\"O .BR strftime (3)
72 .\"O to represent time and date in a locale-specific way.
73 ロケール固有の時間と日付を表現するときに、
74 .BR strftime (3)
75 で使用できる書式付き文字列を返す。
76 .TP
77 .BR D_FMT \ (LC_TIME)
78 .\"O Return a string that can be used as a format string for
79 .\"O .BR strftime (3)
80 .\"O to represent a date in a locale-specific way.
81 ロケール固有の日付を表現するときに、
82 .BR strftime (3)
83 で使用できる書式付き文字列を返す。
84 .TP
85 .BR T_FMT \ (LC_TIME)
86 .\"O Return a string that can be used as a format string for
87 .\"O .BR strftime (3)
88 .\"O to represent a time in a locale-specific way.
89 ロケール固有の時間を表現するときに、
90 .BR strftime (3)
91 で使用できる書式付き文字列を返す。
92 .TP
93 .BR DAY_ "{1\(en7} (LC_TIME)"
94 .\"O Return name of the \fIn\fP-th day of the week. [Warning: this follows
95 .\"O the US convention DAY_1 = Sunday, not the international convention
96 .\"O (ISO 8601) that Monday is the first day of the week.]
97 曜日名 (週の \fIn\fP 番目の日の名前) を返す。[警告: この要素はアメリカの
98 慣習に従って DAY_1 が 日曜日となる。国際的な慣習 (ISO 8601) では月曜日が
99 週の最初の日である。]
100 .TP
101 .BR ABDAY_ "{1\(en7} (LC_TIME)"
102 .\"O Return abbreviated name of the \fIn\fP-th day of the week.
103 曜日 (週の \fIn\fP 番目の日) の省略名を返す。
104 .TP
105 .BR MON_ "{1\(en12} (LC_TIME)"
106 .\"O Return name of the \fIn\fP-th month.
107 \fIn\fP 番目の月の名前を返す。
108 .TP
109 .BR ABMON_ "{1\(en12} (LC_TIME)"
110 .\"O Return abbreviated name of the \fIn\fP-th month.
111 \fIn\fP 番目の月の省略名を返す。
112 .TP
113 .BR RADIXCHAR \ (LC_NUMERIC)
114 .\"O Return radix character (decimal dot, decimal comma, etc.).
115 基数記号 (小数点やコンマなど) を返す。
116 .TP
117 .BR THOUSEP \ (LC_NUMERIC)
118 .\"O Return separator character for thousands (groups of three digits).
119 千の位 (3 桁の数値) の区切り文字を返す。
120 .TP
121 .BR YESEXPR \ (LC_MESSAGES)
122 .\"O Return a regular expression that can be used with the
123 .\"O .BR regex (3)
124 .\"O function to recognize a positive response to a yes/no question.
125 yes/no の質問に対する肯定の応答を認識するために、
126 .BR regex (3)
127 関数で使用できる正規表現を返す。
128 .TP
129 .BR NOEXPR \ (LC_MESSAGES)
130 .\"O Return a regular expression that can be used with the
131 .\"O .BR regex (3)
132 .\"O function to recognize a negative response to a yes/no question.
133 yes/no の質問に対する否定の応答を認識するために
134 .BR regex (3)
135 関数で使用できる正規表現を返す。
136 .TP
137 .BR CRNCYSTR \ (LC_MONETARY)
138 .\"O Return the currency symbol, preceded by "\-" if the symbol should
139 .\"O appear before the value, "+" if the symbol should appear after the
140 .\"O value, or "." if the symbol should replace the radix character.
141 通貨記号を返す。
142 記号が数値の前に配置される場合は、"\-" が通貨記号に前置される。
143 数値の後に記号が配置される場合は "+" が、
144 記号が基数文字と置き換わる場合は "." が前置される。
145 .PP
146 .\"O The above list covers just some examples of items that can be requested.
147 .\"O For a more detailed list, consult
148 .\"O .IR "The GNU C Library Reference Manual" .
149 上記のリストは、要求できる定義のごく一部である。
150 詳細なリストは、
151 .I "GNU C ライブラリ・リファレンスマニュアル"
152 を参照してほしい。
153 .\"O .SH "RETURN VALUE"
154 .SH 返り値
155 .\"O If no locale has been selected by
156 .\"O .BR setlocale (3)
157 .\"O for the appropriate category,
158 .\"O .BR nl_langinfo ()
159 .\"O returns a pointer to the corresponding string in the
160 .\"O "C" locale.
161 適切なカテゴリのロケールが
162 .BR setlocale (3)
163 によって選択されていない場合は、
164 .BR nl_langinfo ()
165 は "C" ロケールのときに相当する文字列へのポインタを返す。
166 .PP
167 .\"O If \fIitem\fP is not valid, a pointer to an empty string is returned.
168 無効な \fIitem\fP の場合は、空文字列へのポインタが返される。
169 .PP
170 .\"O This pointer may point to static data that may be overwritten on the
171 .\"O next call to \fBnl_langinfo\fP() or
172 .\"O .BR setlocale (3).
173 このポインタは静的なデータ領域を指し、その内容は次回の
174 .BR nl_langinfo ()
175
176 .BR setlocale (3)
177 の呼び出しによって書き替わることがある。
178 .\"O .SH "CONFORMING TO"
179 .SH 準拠
180 SUSv2, POSIX.1-2001.
181 .\"O .SH "EXAMPLE"
182 .SH 例
183 .\"O The following program sets the character type locale according to the
184 .\"O environment and queries the terminal character set.
185 以下のプログラムは、環境変数に基いて文字型 (character type) のロケール
186 を設定し、端末の文字集合の問い合わせを行う。
187 .LP
188 .nf
189 #include <langinfo.h>
190 #include <locale.h>
191 #include <stdio.h>
192 #include <stdlib.h>
193
194 int
195 main(int argc, char *argv[])
196 {
197     setlocale(LC_CTYPE,"");
198     printf("%s\\n",nl_langinfo(CODESET));
199     exit(EXIT_SUCCESS);
200 }
201 .fi
202 .\"O .SH "SEE ALSO"
203 .SH 関連項目
204 .BR locale (1),
205 .BR localeconv (3),
206 .BR setlocale (3),
207 .BR charsets (7),
208 .BR locale (7)
209 .br
210 .\"O The GNU C Library Reference Manual
211 GNU C ライブラリ・リファレンスマニュアル