OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / draft / man3 / wcsrtombs.3
index 57d2748..6f7bd4c 100644 (file)
 .\"
 .TH WCSRTOMBS 3  2011-09-28 "GNU" "Linux Programmer's Manual"
 .\"O .SH NAME
-.SH Ì¾Á°
+.SH 名前
 .\"O wcsrtombs \- convert a wide-character string to a multibyte string
-wcsrtombs \- ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë
+wcsrtombs \- ワイド文字文字列をマルチバイト文字列に変換する
 .\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.SH 書式
 .nf
 .B #include <wchar.h>
 .sp
@@ -29,7 +29,7 @@ wcsrtombs \- 
 .BI "                 size_t " len ", mbstate_t *" ps );
 .fi
 .\"O .SH DESCRIPTION
-.SH ÀâÌÀ
+.SH 説明
 .\"O If \fIdest\fP is not a NULL pointer,
 .\"O the
 .\"O .BR wcsrtombs ()
@@ -47,18 +47,18 @@ wcsrtombs \- 
 .\"O number of bytes written and \fI*src\fP
 .\"O by one.
 .\"O The conversion can stop for three reasons:
-\fIdest\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¡¢
+\fIdest\fP が NULL ポインタでなければ、
 .BR wcsrtombs ()
-´Ø¿ô¤Ï
-¥ï¥¤¥Éʸ»úʸ»úÎó \fI*src\fP ¤ò \fIdest\fP ¤¬»Ø¤¹¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó
-¤ËÊÑ´¹¤¹¤ë¡£ºÇÂç \fIlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤¬ \fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£
-¥·¥Õ¥È¾õÂÖ \fI*ps\fP ¤Ï¹¹¿·¤µ¤ì¤ë¡£¼ÂºÝ¤Î¸ú²Ì¤È¤·¤Æ¤Ï¡¢¤³¤ÎÊÑ´¹¤Ï°Ê²¼
-¤ÎÆ°ºî¤ÈƱ¤¸¤Ë¤Ê¤ë:
+関数は
+ワイド文字文字列 \fI*src\fP を \fIdest\fP が指すマルチバイト文字列
+に変換する。最大 \fIlen\fP バイトまでが \fIdest\fP に書き込まれる。
+シフト状態 \fI*ps\fP は更新される。実際の効果としては、この変換は以下
+の動作と同じになる:
 .IR "wcrtomb(dest, *src, ps)"
-¤ò¸Æ¤Ó¡¢À®¸ù¤¬Ê֤俤顢
-\fIdest\fP ¤ò½ñ¤­¹þ¤ó¤À¥Ð¥¤¥È¿ô¤À¤±Áý¤ä¤·¡¢\fI*src\fP ¤ò 1 Áý¤ä¤¹¡£
-¤½¤·¤Æ¡¢wcrtomb ¤¬À®¸ù¤òÊÖ¤¹¸Â¤ê¤³¤ì¤ò·«¤êÊÖ¤¹¡£
-ÊÑ´¹¤¬»ß¤Þ¤ëÍýͳ¤Ï 3 ¤Ä¹Í¤¨¤é¤ì¤ë:
+を呼び、成功が返ったら、
+\fIdest\fP を書き込んだバイト数だけ増やし、\fI*src\fP を 1 増やす。
+そして、wcrtomb が成功を返す限りこれを繰り返す。
+変換が止まる理由は 3 つ考えられる:
 .PP
 .\"O 1. A wide character has been encountered that can not be represented as a
 .\"O multibyte sequence (according to the current locale).
@@ -69,21 +69,21 @@ wcsrtombs \- 
 .\"O and
 .\"O .I errno
 .\"O is set to \fBEILSEQ\fP.
-(¸½ºß¤Î¥í¥±¡¼¥ë¤Ë´ð¤Å¤¤¤Æ)¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Çɽ¸½¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë
-½Ð²ñ¤Ã¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ï¡¢\fI*src\fP ¤ÏÉÔÀµ¤Ê¥ï¥¤¥Éʸ»ú¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ
+(現在のロケールに基づいて)マルチバイト列で表現できないワイド文字に
+出会った場合。この場合は、\fI*src\fP は不正なワイド文字を指した状態になり、
 .I (size_t)\ \-1
-¤¬ÊÖ¤µ¤ì¡¢
+が返され、
 .I errno
-¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£
+に \fBEILSEQ\fP が設定される。
 .PP
 .\"O 2. The length limit forces a stop.
 .\"O In this case \fI*src\fP is left pointing
 .\"O to the next wide character to be converted,
 .\"O and the number of bytes written to
 .\"O \fIdest\fP is returned.
-2. Ä¹¤µ¤ÎÀ©¸Â¤Ë¤è¤êÊÑ´¹¤¬»ß¤á¤é¤ì¤¿¾ì¹ç¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢\fI*src\fP ¤Ï¼¡¤Ë
-ÊÑ´¹¤µ¤ì¤ë¤Ù¤­¥ï¥¤¥Éʸ»úÎó¤ò»Ø¤·¤¿¾õÂ֤ˤʤꡢ\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì
-¤¿¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë¡£
+2. 長さの制限により変換が止められた場合。この場合には、\fI*src\fP は次に
+変換されるべきワイド文字列を指した状態になり、\fIdest\fP に書き込まれ
+たバイト数が返される。
 .PP
 .\"O 3. The wide-character string has been completely converted, including the
 .\"O terminating null wide character (L\(aq\\0\(aq),
@@ -91,31 +91,31 @@ wcsrtombs \- 
 .\"O to the initial state.
 .\"O In this case \fI*src\fP is set to NULL, and the number
 .\"O of bytes written to \fIdest\fP, excluding the terminating null, is returned.
-3. ¥ï¥¤¥Éʸ»úÎ󤬽ªÃ¼¤Î NULL ¥ï¥¤¥Éʸ»ú (L\(aq\\0\(aq) ¤â´Þ¤á¤ÆÁ´¤Æ
-ÊÑ´¹¤µ¤ì¤¿¾ì¹ç¡£¤³¤ÎºÝ¡¢\fI*ps\fP ¤¬½é´ü¾õÂÖ¤ËÌá¤ë¤È¤¤¤¦ÉûºîÍѤ¬¤¢¤ë¡£
-¤³¤Î¾ì¹ç¤Ë¤Ï \fI*src\fP ¤Ë NULL ¤¬ÀßÄꤵ¤ì¡¢\fIdest\fP ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿
-¥Ð¥¤¥È¿ô¤¬ÊÖ¤µ¤ì¤ë (½ªÃ¼¤Î NULL ¤Ï¿ô¤¨¤Ê¤¤)¡£
+3. ワイド文字列が終端の NULL ワイド文字 (L\(aq\\0\(aq) も含めて全て
+変換された場合。この際、\fI*ps\fP が初期状態に戻るという副作用がある。
+この場合には \fI*src\fP に NULL が設定され、\fIdest\fP に書き込まれた
+バイト数が返される (終端の NULL は数えない)。
 .PP
 .\"O If \fIdest\fP is NULL, \fIlen\fP is ignored,
 .\"O and the conversion proceeds as above, except that the converted bytes
 .\"O are not written out to memory, and that
 .\"O no length limit exists.
-\fIdest\fP ¤¬ NULL ¤Ê¤é¤Ð \fIlen\fP ¤Ï̵»ë¤µ¤ì¤ÆÁ°½Ò¤Î¤è¤¦¤ËÊÑ´¹¤¬¹Ô¤ï
-¤ì¤ë¤¬¡¢ÊÑ´¹¤µ¤ì¤¿¥Ð¥¤¥È¥Ç¡¼¥¿¤Ï¥á¥â¥ê¤Ë½ñ¤­½Ð¤µ¤ì¤Ê¤¤ÅÀ¤È¡¢½ÐÎÏÀè¤ÎĹ
-¤µ¤ÎÀ©¸Â¤¬¤Ê¤¤ÅÀ¤¬°Û¤Ê¤ë¡£
+\fIdest\fP が NULL ならば \fIlen\fP は無視されて前述のように変換が行わ
+れるが、変換されたバイトデータはメモリに書き出されない点と、出力先の長
+さの制限がない点が異なる。
 .PP
 .\"O In both of the above cases,
 .\"O if \fIps\fP is a NULL pointer, a static anonymous
 .\"O state only known to the wcsrtombs function is used instead.
-¾åµ­¤Î¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢\fIps\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ê¤é¤Ð¡¢wcsnrtombs ´Ø¿ô
-¤À¤±¤¬ÃΤäƤ¤¤ëÀÅŪ¤Êƿ̾¤Î¾õÂÖ¤¬¥·¥Õ¥È¾õÂÖ¤ÎÂå¤ï¤ê¤ËÍѤ¤¤é¤ì¤ë¡£
+上記のいずれの場合も、\fIps\fP が NULL ポインタならば、wcsnrtombs 関数
+だけが知っている静的な匿名の状態がシフト状態の代わりに用いられる。
 .PP
 .\"O The programmer must ensure that there is room for at least \fIlen\fP bytes
 .\"O at \fIdest\fP.
-¥×¥í¥°¥é¥Þ¤Ï¾¯¤Ê¤¯¤È¤â \fIlen\fP ¥Ð¥¤¥È¤ÎÎΰè¤ò \fIdest\fP ¤Ë³ÎÊݤ·¤Ê
-¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+プログラマは少なくとも \fIlen\fP バイトの領域を \fIdest\fP に確保しな
+ければならない。
 .\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
+.SH 返り値
 .\"O The
 .\"O .BR wcsrtombs ()
 .\"O function returns
@@ -123,21 +123,21 @@ wcsrtombs \- 
 .\"O converted part of multibyte sequence,
 .\"O not including the terminating null byte.
 .BR wcsrtombs ()
-¤Ï¡¢ÊÑ´¹¤·¤ÆÆÀ¤é¤ì¤¿¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
-¤³¤ì¤Ë¤Ï½ªÃ¼¤Î null ¥Ð¥¤¥È¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£
+は、変換して得られたマルチバイト列のバイト数を返す。
+これには終端の null バイトは含まれない。
 .\"O If a wide character was encountered
 .\"O which could not be converted,
 .\"O .I (size_t)\ \-1
 .\"O is returned, and
 .\"O .I errno
 .\"O set to \fBEILSEQ\fP.
-ÊÑ´¹¤Ç¤­¤Ê¤¤¥ï¥¤¥Éʸ»ú¤Ë½Ð²ñ¤Ã¤¿¾ì¹ç¤Ë¤Ï
+変換できないワイド文字に出会った場合には
 .I (size_t)\ \-1
-¤¬ÊÖ¤µ¤ì¡¢
+が返され、
 .I errno
-¤Ë \fBEILSEQ\fP ¤¬ÀßÄꤵ¤ì¤ë¡£
+に \fBEILSEQ\fP が設定される。
 .\"O .SH "CONFORMING TO"
-.SH ½àµò
+.SH 準拠
 C99.
 .\"O .SH NOTES
 .\"O The behavior of
@@ -147,14 +147,14 @@ C99.
 .\"O category of the
 .\"O current locale.
 .BR wcsrtombs ()
-¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î
+の動作は現在のロケールの
 .B LC_CTYPE
-¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£
+カテゴリに依存する。
 .PP
 .\"O Passing NULL as \fIps\fP is not multithread safe.
-\fIps\fP ¤Ë NULL ¤òÅϤ·¤¿ºÝ¤ÎÆ°ºî¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ê¤¤¡£
+\fIps\fP に NULL を渡した際の動作はマルチスレッドセーフでない。
 .\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
+.SH 関連項目
 .BR iconv (3),
 .BR wcsnrtombs (3),
 .BR wcstombs (3)