X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=draft%2Fman3%2Fnl_langinfo.3;h=9bc399ae18cf95c87ade3405d064ce917af83d26;hb=c1dfa2f6ab1bbed84992d3c59ee9925f4d453668;hp=62634d41600b65a26ff3b54910de80f76e87fe27;hpb=633a2252e0be3c867dce264a180a89ce8181d36f;p=linuxjm%2FLDP_man-pages.git diff --git a/draft/man3/nl_langinfo.3 b/draft/man3/nl_langinfo.3 index 62634d41..9bc399ae 100644 --- a/draft/man3/nl_langinfo.3 +++ b/draft/man3/nl_langinfo.3 @@ -1,186 +1,116 @@ .\" Copyright (c) 2001 Markus Kuhn .\" +.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA) .\" 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. +.\" %%%LICENSE_END .\" .\" References consulted: .\" GNU glibc-2 manual -.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html +.\" 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 2001-05-11 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O nl_langinfo \- query language and locale information -.SH ̾Á° -nl_langinfo \- ¸À¸ì¤È¥í¥±¡¼¥ë¤Î¾ðÊó¤òÌ䤤¹ç¤ï¤»¤ë -.\"O .SH SYNOPSIS -.SH ½ñ¼° +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH NL_LANGINFO 3 2010\-10\-03 GNU "Linux Programmer's Manual" +.SH 名前 +nl_langinfo \- 言語とロケールの情報を問い合わせる +.SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *nl_langinfo(nl_item " item ); +\fBchar *nl_langinfo(nl_item \fP\fIitem\fP\fB);\fP .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) -¤è¤ê½ÀÆð¤Ê¥í¥±¡¼¥ë¾ðÊó¤Ø¤Î¥¢¥¯¥»¥¹ÊýË¡¤òÄ󶡤¹¤ë¡£ -¥í¥±¡¼¥ë¥«¥Æ¥´¥ê¤Î¸Ä¡¹¤ÎÍ×ÁǤäÄɲäÎÍ×ÁǤòÌ䤤¹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ +.SH 説明 +\fBnl_langinfo\fP() 関数は、 \fBlocaleconv\fP(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. -Ä̲ߵ­¹æ¤òÊÖ¤¹¡£ -µ­¹æ¤¬¿ôÃͤÎÁ°¤ËÇÛÃÖ¤µ¤ì¤ë¾ì¹ç¤Ï¡¢"\-" ¤¬Ä̲ߵ­¹æ¤ËÁ°ÃÖ¤µ¤ì¤ë¡£ -¿ôÃͤθå¤Ëµ­¹æ¤¬ÇÛÃÖ¤µ¤ì¤ë¾ì¹ç¤Ï "+" ¤¬¡¢ -µ­¹æ¤¬´ð¿ôʸ»ú¤ÈÃÖ¤­´¹¤ï¤ë¾ì¹ç¤Ï "." ¤¬Á°ÃÖ¤µ¤ì¤ë¡£ +\fI\fP に定数として定義されていて、 \fIitem\fP に指定できるロケール要素の例を以下に示す: +.TP +\fBCODESET\fP\ (LC_CTYPE) +選択されたロケールで用いられる文字エンコード名を示す文字列を返す。 文字エンコード名としては、"UTF\-8" や +"ISO\-8859\-1"、"ANSI_X3.4\-1968" (これは US\-ASCII という名前の方がよく知られている) などがある。 +この文字列は、"locale charmap" を実行して得られるものと同じである。 文字エンコード名のリストを得るには、"locale \-m" +を実行するとよい。 参考: \fBlocale\fP(1) +.TP +\fBD_T_FMT\fP\ (LC_TIME) +ロケール固有の時間と日付を表現するときに、 \fBstrftime\fP(3) で使用できる書式付き文字列を返す。 +.TP +\fBD_FMT\fP\ (LC_TIME) +ロケール固有の日付を表現するときに、 \fBstrftime\fP(3) で使用できる書式付き文字列を返す。 +.TP +\fBT_FMT\fP\ (LC_TIME) +ロケール固有の時間を表現するときに、 \fBstrftime\fP(3) で使用できる書式付き文字列を返す。 +.TP +\fBDAY_\fP{1\(en7} (LC_TIME) +曜日名 (週の \fIn\fP 番目の日の名前) を返す。[警告: この要素はアメリカの 慣習に従って DAY_1 が 日曜日となる。国際的な慣習 (ISO +8601) では月曜日が 週の最初の日である。] +.TP +\fBABDAY_\fP{1\(en7} (LC_TIME) +曜日 (週の \fIn\fP 番目の日) の省略名を返す。 +.TP +\fBMON_\fP{1\(en12} (LC_TIME) +\fIn\fP 番目の月の名前を返す。 +.TP +\fBABMON_\fP{1\(en12} (LC_TIME) +\fIn\fP 番目の月の省略名を返す。 +.TP +\fBRADIXCHAR\fP\ (LC_NUMERIC) +基数記号 (小数点やコンマなど) を返す。 +.TP +\fBTHOUSEP\fP\ (LC_NUMERIC) +千の位 (3 桁の数値) の区切り文字を返す。 +.TP +\fBYESEXPR\fP\ (LC_MESSAGES) +yes/no の質問に対する肯定の応答を認識するために、 \fBregex\fP(3) 関数で使用できる正規表現を返す。 +.TP +\fBNOEXPR\fP\ (LC_MESSAGES) +yes/no の質問に対する否定の応答を認識するために \fBregex\fP(3) 関数で使用できる正規表現を返す。 +.TP +\fBCRNCYSTR\fP\ (LC_MONETARY) +通貨記号を返す。 記号が数値の前に配置される場合は、"\-" が通貨記号に前置される。 数値の後に記号が配置される場合は "+" が、 +記号が基数文字と置き換わる場合は "." が前置される。 .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 for the appropriate category, -.\"O .BR nl_langinfo () -.\"O returns a pointer to the corresponding string in the -.\"O "C" locale. -ŬÀڤʥ«¥Æ¥´¥ê¤Î¥í¥±¡¼¥ë¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ -.BR nl_langinfo () -¤Ï "C" ¥í¥±¡¼¥ë¤Î¤È¤­¤ËÁêÅö¤¹¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ +上記のリストは、要求できる定義のごく一部である。 詳細なリストは、 \fIGNU C ライブラリ・リファレンスマニュアル\fP を参照してほしい。 +.SH 返り値 +適切なカテゴリのロケールが \fBsetlocale\fP(3) によって選択されていない場合は、 \fBnl_langinfo\fP() は "C" +ロケールのときに相当する文字列へのポインタを返す。 .PP -.\"O If \fIitem\fP is not valid, a pointer to an empty string is returned. -̵¸ú¤Ê \fIitem\fP ¤Î¾ì¹ç¤Ï¡¢¶õʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£ +無効な \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 "SEE ALSO" -.SH ´ØÏ¢¹àÌÜ -.BR locale (1), -.BR localeconv (3), -.BR setlocale (3), -.BR charsets (7), -.BR locale (7) +このポインタは静的なデータ領域を指し、その内容は次回の \fBnl_langinfo\fP() や \fBsetlocale\fP(3) +の呼び出しによって書き替わることがある。 +.SH 準拠 +SUSv2, POSIX.1\-2001. +.SH 例 +以下のプログラムは、環境変数に基いて文字型 (character type) のロケール を設定し、端末の文字集合の問い合わせを行う。 +.LP +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + setlocale(LC_CTYPE,""); + printf("%s\en",nl_langinfo(CODESET)); + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBlocale\fP(1), \fBlocaleconv\fP(3), \fBsetlocale\fP(3), \fBcharsets\fP(7), +\fBlocale\fP(7) .br -.\"O The GNU C Library Reference Manual -GNU C ¥é¥¤¥Ö¥é¥ê¡¦¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë +GNU C ライブラリ・リファレンスマニュアル +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。