.\" Copyright (c) Bruno Haible .\" .\" 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 source code and manual .\" Dinkumware C library reference http://www.dinkumware.com/ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya .\" all rights reserved. .\" Translated Tue Jan 11 00:55:39 JST 2000 .\" by HANATAKA Shinya .\" .TH WCTOMB 3 1999-07-25 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O wctomb \- convert a wide character to a multibyte sequence wctomb \- ワイド文字をマルチバイト列に変換する。 .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "int wctomb(char *" s ", wchar_t " wc ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O If \fIs\fP is not NULL, .\"O the .\"O .BR wctomb () .\"O function converts the wide character .\"O \fIwc\fP to its multibyte representation and stores it at the beginning of .\"O the character array pointed to by \fIs\fP. .\"O It updates the shift state, which .\"O is stored in a static anonymous variable .\"O only known to the wctomb function, .\"O and returns the length of said multibyte representation, .\"O that is, the number of .\"O bytes written at \fIs\fP. .PP .\"O The programmer must ensure that there is .\"O room for at least \fBMB_CUR_MAX\fP .\"O bytes at \fIs\fP. \fIs\fP が NULL でなければ、 .BR wctomb () 関数はワイド文字 \fIwc\fP を マルチバイト表現に変換して \fIs\fP の指す文字配列に格納する。 同時に wctomb 関数のみが使用する静的で名前のないシフト状態を更新する。 この関数はマルチバイト表現の長さ、すなわち \fIs\fP に書き込まれた バイト数を返す。プログラマーは \fIs\fP に少なくとも \fBMB_CUR_MAX\fP バイトの空きがあることを保証しなければならない。 .PP .\"O If \fIs\fP is NULL, the .\"O .BR wctomb () .\"O function .\"O .\" The Dinkumware doc and the Single UNIX specification say this, but .\"O .\" glibc doesn't implement this. .\"O resets the shift state, only known to this function, .\"O to the initial state, and .\"O returns nonzero if the encoding has nontrivial shift state, .\"O or zero if the encoding is stateless. \fIs\fP が NULL ならば、 .BR wctomb () 関数は自分のみが使用するシフト状態を 初期状態に戻して、文字符号がシフト状態に依存しているならばゼロ以外を シフト状態に依存しない場合にはゼロを返す。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O If \fIs\fP is not NULL, the .\"O .BR wctomb () .\"O function .\"O returns the number of bytes .\"O that have been written to the byte array at \fIs\fP. .\"O If \fIwc\fP can not be .\"O represented as a multibyte sequence (according .\"O to the current locale), \-1 is returned. \fIs\fP が NULL でない場合 .BR wctomb () 関数はバイト配列 \fIs\fP に 書き込まれたバイト数を返す。\fIwc\fP が(現在のロケールにおいて) マルチバイト列で表現できない場合には \-1 を返す。 .PP .\"O If \fIs\fP is NULL, the .\"O .BR wctomb () .\"O function returns nonzero if the .\"O encoding has nontrivial shift state, or zero if the encoding is stateless. \fIs\fP が NULL の場合 .BR wctomb () 関数は文字符号がシフト状態に 依存している場合にはゼロ以外、シフト状態に依存しない場合はゼロを返す。 .\"O .SH "CONFORMING TO" .SH 準拠 C99. .\"O .SH NOTES .SH 注意 .\"O The behavior of .\"O .BR wctomb () .\"O depends on the .\"O .B LC_CTYPE .\"O category of the .\"O current locale. .BR wctomb () 関数の動作は現在のロケールの .B LC_CTYPE カテゴリに依存している。 .PP .\"O This function is not multithread safe. .\"O The function .\"O .BR wcrtomb (3) .\"O provides .\"O a better interface to the same functionality. この関数はマルチスレッドでは安全ではない。 .BR wcrtomb (3) 関数は 同じ機能のより良いインターフェースを提供する。 .SH 関連項目 .BR MB_CUR_MAX (3), .BR wcrtomb (3), .BR wcstombs (3)