OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / nl_langinfo.3
index 62634d4..a33db88 100644 (file)
@@ -7,7 +7,7 @@
 .\"
 .\" 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
 .\"
@@ -16,7 +16,7 @@
 .\" Translated Sun Jul 15 2001
 .\"          by UCHIDA Norihiro <KY4N-UCD@asahi-net.or.jp>
 .\"
-.TH NL_LANGINFO 3 2001-05-11 "GNU" "Linux Programmer's Manual"
+.TH NL_LANGINFO 3 2010-10-03 "GNU" "Linux Programmer's Manual"
 .\"O .SH NAME
 .\"O nl_langinfo \- query language and locale information
 .SH Ì¾Á°
@@ -152,11 +152,15 @@ yes/no 
 ¤ò»²¾È¤·¤Æ¤Û¤·¤¤¡£
 .\"O .SH "RETURN VALUE"
 .SH ÊÖ¤êÃÍ
-.\"O If no locale has been selected for the appropriate category,
+.\"O If no locale has been selected by
+.\"O .BR setlocale ()
+.\"O for the appropriate category,
 .\"O .BR nl_langinfo ()
 .\"O returns a pointer to the corresponding string in the
 .\"O "C" locale.
-ŬÀڤʥ«¥Æ¥´¥ê¤Î¥í¥±¡¼¥ë¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢
+ŬÀڤʥ«¥Æ¥´¥ê¤Î¥í¥±¡¼¥ë¤¬
+.BR setlocale ()
+¤Ë¤è¤Ã¤ÆÁªÂò¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢
 .BR nl_langinfo ()
 ¤Ï "C" ¥í¥±¡¼¥ë¤Î¤È¤­¤ËÁêÅö¤¹¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
 .PP
@@ -174,6 +178,27 @@ yes/no 
 .\"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 <langinfo.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+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),