.\" Copyright (c) 2001 Markus Kuhn .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" References consulted: .\" GNU glibc-2 manual .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" .\" Corrected prototype, 2002-10-18, aeb .\" .\" Japanese Version Copyright (c) 2001 .\" UCHIDA Norihiro all rights reserved. .\" Translated Sun Jul 15 2001 .\" by UCHIDA Norihiro .\" .TH NL_LANGINFO 3 2010-10-03 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .\"O nl_langinfo \- query language and locale information .SH 名前 nl_langinfo \- 言語とロケールの情報を問い合わせる .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "char *nl_langinfo(nl_item " item ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR nl_langinfo () .\"O function provides access to locale information .\"O in a more flexible way than .\"O .BR localeconv (3) .\"O does. .\"O Individual and additional elements of the locale categories can .\"O be queried. .BR nl_langinfo () 関数は、 .BR localeconv (3) より柔軟なロケール情報へのアクセス方法を提供する。 ロケールカテゴリの個々の要素や追加の要素を問い合わせることができる。 .PP .\"O Examples for the locale elements that can be specified in \fIitem\fP .\"O using the constants defined in \fI\fP are: \fI\fP に定数として定義されていて、 \fIitem\fP に指定できるロケール要素の例を以下に示す: .TP .BR CODESET \ (LC_CTYPE) .\"O Return a string with the name of the character encoding used in the .\"O selected locale, such as "UTF-8", "ISO-8859-1", or "ANSI_X3.4-1968" .\"O (better known as US-ASCII). .\"O This is the same string that you get with .\"O "locale charmap". .\"O For a list of character encoding names, .\"O try "locale \-m", cf.\& .\"O .BR locale (1). 選択されたロケールで用いられる文字エンコード名を示す文字列を返す。 文字エンコード名としては、"UTF-8" や "ISO-8859-1"、"ANSI_X3.4-1968" (これは US-ASCII という名前の方がよく知られている) などがある。 この文字列は、"locale charmap" を実行して得られるものと同じである。 文字エンコード名のリストを得るには、"locale \-m" を実行するとよい。 参考: .BR locale (1) .TP .BR D_T_FMT \ (LC_TIME) .\"O Return a string that can be used as a format string for .\"O .BR strftime (3) .\"O to represent time and date in a locale-specific way. ロケール固有の時間と日付を表現するときに、 .BR strftime (3) で使用できる書式付き文字列を返す。 .TP .BR D_FMT \ (LC_TIME) .\"O Return a string that can be used as a format string for .\"O .BR strftime (3) .\"O to represent a date in a locale-specific way. ロケール固有の日付を表現するときに、 .BR strftime (3) で使用できる書式付き文字列を返す。 .TP .BR T_FMT \ (LC_TIME) .\"O Return a string that can be used as a format string for .\"O .BR strftime (3) .\"O to represent a time in a locale-specific way. ロケール固有の時間を表現するときに、 .BR strftime (3) で使用できる書式付き文字列を返す。 .TP .BR DAY_ "{1\(en7} (LC_TIME)" .\"O Return name of the \fIn\fP-th day of the week. [Warning: this follows .\"O the US convention DAY_1 = Sunday, not the international convention .\"O (ISO 8601) that Monday is the first day of the week.] 曜日名 (週の \fIn\fP 番目の日の名前) を返す。[警告: この要素はアメリカの 慣習に従って DAY_1 が 日曜日となる。国際的な慣習 (ISO 8601) では月曜日が 週の最初の日である。] .TP .BR ABDAY_ "{1\(en7} (LC_TIME)" .\"O Return abbreviated name of the \fIn\fP-th day of the week. 曜日 (週の \fIn\fP 番目の日) の省略名を返す。 .TP .BR MON_ "{1\(en12} (LC_TIME)" .\"O Return name of the \fIn\fP-th month. \fIn\fP 番目の月の名前を返す。 .TP .BR ABMON_ "{1\(en12} (LC_TIME)" .\"O Return abbreviated name of the \fIn\fP-th month. \fIn\fP 番目の月の省略名を返す。 .TP .BR RADIXCHAR \ (LC_NUMERIC) .\"O Return radix character (decimal dot, decimal comma, etc.). 基数記号 (小数点やコンマなど) を返す。 .TP .BR THOUSEP \ (LC_NUMERIC) .\"O Return separator character for thousands (groups of three digits). 千の位 (3 桁の数値) の区切り文字を返す。 .TP .BR YESEXPR \ (LC_MESSAGES) .\"O Return a regular expression that can be used with the .\"O .BR regex (3) .\"O function to recognize a positive response to a yes/no question. yes/no の質問に対する肯定の応答を認識するために、 .BR regex (3) 関数で使用できる正規表現を返す。 .TP .BR NOEXPR \ (LC_MESSAGES) .\"O Return a regular expression that can be used with the .\"O .BR regex (3) .\"O function to recognize a negative response to a yes/no question. yes/no の質問に対する否定の応答を認識するために .BR regex (3) 関数で使用できる正規表現を返す。 .TP .BR CRNCYSTR \ (LC_MONETARY) .\"O Return the currency symbol, preceded by "\-" if the symbol should .\"O appear before the value, "+" if the symbol should appear after the .\"O value, or "." if the symbol should replace the radix character. 通貨記号を返す。 記号が数値の前に配置される場合は、"\-" が通貨記号に前置される。 数値の後に記号が配置される場合は "+" が、 記号が基数文字と置き換わる場合は "." が前置される。 .PP .\"O The above list covers just some examples of items that can be requested. .\"O For a more detailed list, consult .\"O .IR "The GNU C Library Reference Manual" . 上記のリストは、要求できる定義のごく一部である。 詳細なリストは、 .I "GNU C ライブラリ・リファレンスマニュアル" を参照してほしい。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O If no locale has been selected by .\"O .BR setlocale (3) .\"O for the appropriate category, .\"O .BR nl_langinfo () .\"O returns a pointer to the corresponding string in the .\"O "C" locale. 適切なカテゴリのロケールが .BR setlocale (3) によって選択されていない場合は、 .BR nl_langinfo () は "C" ロケールのときに相当する文字列へのポインタを返す。 .PP .\"O If \fIitem\fP is not valid, a pointer to an empty string is returned. 無効な \fIitem\fP の場合は、空文字列へのポインタが返される。 .PP .\"O This pointer may point to static data that may be overwritten on the .\"O next call to \fBnl_langinfo\fP() or .\"O .BR setlocale (3). このポインタは静的なデータ領域を指し、その内容は次回の .BR nl_langinfo () や .BR setlocale (3) の呼び出しによって書き替わることがある。 .\"O .SH "CONFORMING TO" .SH 準拠 SUSv2, POSIX.1-2001. .\"O .SH "EXAMPLE" .SH 例 .\"O The following program sets the character type locale according to the .\"O environment and queries the terminal character set. 以下のプログラムは、環境変数に基いて文字型 (character type) のロケール を設定し、端末の文字集合の問い合わせを行う。 .LP .nf #include #include #include #include int main(int argc, char *argv[]) { setlocale(LC_CTYPE,""); printf("%s\\n",nl_langinfo(CODESET)); exit(EXIT_SUCCESS); } .fi .\"O .SH "SEE ALSO" .SH 関連項目 .BR locale (1), .BR localeconv (3), .BR setlocale (3), .BR charsets (7), .BR locale (7) .br .\"O The GNU C Library Reference Manual GNU C ライブラリ・リファレンスマニュアル