OSDN Git Service

666e12148197fd9fa802836565e26953e93dbb69
[linuxjm/LDP_man-pages.git] / draft / man3 / wprintf.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\"   ISO/IEC 9899:1999
15 .\"
16 .\"*******************************************************************
17 .\"
18 .\" This file was generated with po4a. Translate the source file.
19 .\"
20 .\"*******************************************************************
21 .TH WPRINTF 3 2011\-09\-17 GNU "Linux Programmer's Manual"
22 .SH 名前
23 wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- ワイド文字を
24 フォーマットして出力する
25 .SH 書式
26 .nf
27 \fB#include <stdio.h>\fP
28 \fB#include <wchar.h>\fP
29 .sp
30 \fBint wprintf(const wchar_t *\fP\fIformat\fP\fB, ...);\fP
31 \fBint fwprintf(FILE *\fP\fIstream\fP\fB, const wchar_t *\fP\fIformat\fP\fB, ...);\fP
32 \fBint swprintf(wchar_t *\fP\fIwcs\fP\fB, size_t \fP\fImaxlen\fP\fB,\fP
33 \fB             const wchar_t *\fP\fIformat\fP\fB, ...);\fP
34 .sp
35 \fBint vwprintf(const wchar_t *\fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP
36 \fBint vfwprintf(FILE *\fP\fIstream\fP\fB, const wchar_t *\fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP
37 \fBint vswprintf(wchar_t *\fP\fIwcs\fP\fB, size_t \fP\fImaxlen\fP\fB,\fP
38 \fB              const wchar_t *\fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP
39 .fi
40 .sp
41 .in -4n
42 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
43 .in
44 .sp
45 .ad l
46 上記の全ての関数:
47 .RS 4
48 .\" .BR wprintf (),
49 .\" .BR fwprintf (),
50 .\" .BR swprintf (),
51 .\" .BR vwprintf (),
52 .\" .BR vfwprintf (),
53 .\" .BR vswprintf ():
54 _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE ||
55 .br
56 _ISOC95_SOURCE /* Since glibc 2.12 */ ||
57 .br
58 _POSIX_C_SOURCE\ >=\ 200112L;
59 .br
60 or \fIcc\ \-std=c99\fP
61 .RE
62 .ad
63 .SH 説明
64 \fBwprintf\fP()  ファミリーの関数は \fBprintf\fP(3)  ファミリーの関数の
65 ワイド文字版である。これらはワイド文字をフォーマットして出力する。
66 .PP
67 \fBwprintf\fP()  と \fBvwprintf\fP()  関数は \fIstdout\fP に出力を行なう。 \fIstdout\fP
68 がバイト単位入出力であってはいけない。より詳しい説明は \fBfwide\fP(3)  を参照すること。
69 .PP
70 \fBfwprintf\fP()  と \fBvfwprintf\fP()  関数は \fIstream\fP にワイド文字出力 を行なう。 \fIstream\fP
71 がバイト単位入出力であってはいけない。 より詳しい説明は \fBfwide\fP(3)  を参照すること。
72 .PP
73 \fBswprintf\fP()  と \fBvswprintf\fP()  関数はワイド文字の配列に ワイド文字出力を行なう。プログラマーは \fIwcs\fP
74 に最低でも \fImaxlen\fP 文字のワイド文字を出力できる空きがあることを保証しなければ ならない。
75 .PP
76 これらの関数は \fBprintf\fP(3), \fBvprintf\fP(3), \fBfprintf\fP(3), \fBvfprintf\fP(3),
77 \fBsprintf\fP(3), \fBvsprintf\fP(3)  関数に似ているが以下の 点で異っている。
78 .TP 
79 \fB\(bu\fP
80 \fIformat\fP がワイド文字列で与えられる。
81 .TP 
82 \fB\(bu\fP
83 出力がバイトではなくワイド文字で構成される。
84 .TP 
85 \fB\(bu\fP
86 \fBswprintf\fP()  と \fBvswprintf\fP()  は \fImaxlen\fP 引き数を取るが、 \fBsprintf\fP()  と
87 \fBvsprintf\fP()  は取らない (\fBsnprintf\fP()  と \fBvsnprintf\fP()  は \fImaxlen\fP 引き数を取るが
88 これらの関数が Linux では、バッファーが溢れた場合でも \-1 を返さない)。
89 .PP
90 \fBc\fP と \fBs\fP 変換文字の扱いが異っている:
91 .TP 
92 \fBc\fP
93 もし \fBl\fP 修飾子が存在しない場合は \fIint\fP 引き数は \fBbtowc\fP(3)
94 関数によってワイド文字に変換される。そして結果のワイド文字が出力される。 \fBl\fP 修飾子が存在する場合は \fIwint_t\fP
95 (ワイド文字)引き数が出力される。
96 .TP 
97 \fBs\fP
98 If no \fBl\fP modifier is present: The \fIconst\ char\ *\fP argument is expected
99 to be a pointer to an array of character type (pointer to a string)
100 containing a multibyte character sequence beginning in the initial shift
101 state.  Characters from the array are converted to wide characters (each by
102 a call to the \fBmbrtowc\fP(3)  function with a conversion state starting in
103 the initial state before the first byte).  The resulting wide characters are
104 written up to (but not including) the terminating null wide character
105 (L\(aq\e0\(aq).  If a precision is specified, no more wide characters than
106 the number specified are written.  Note that the precision determines the
107 number of \fIwide characters\fP written, not the number of \fIbytes\fP or \fIscreen
108 positions\fP.  The array must contain a terminating null byte (\(aq\e0\(aq),
109 unless a precision is given and it is so small that the number of converted
110 wide characters reaches it before the end of the array is reached.  If an
111 \fBl\fP modifier is present: The \fIconst\ wchar_t\ *\fP argument is expected to
112 be a pointer to an array of wide characters.  Wide characters from the array
113 are written up to (but not including) a terminating null wide character.  If
114 a precision is specified, no more than the number specified are written.
115 The array must contain a terminating null wide character, unless a precision
116 is given and it is smaller than or equal to the number of wide characters in
117 the array.
118 .SH 返り値
119 これらの関数は書き込まれたワイド文字の文字数を返す。 \fBswprintf\fP()  と \fBvswprintf\fP()  関数の場合は
120 終端のナルワイド文字は含まない。エラーが起こった場合は \-1 を返す。
121 .SH 準拠
122 C99.
123 .SH 注意
124 \fBwprintf\fP()  等の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリに依存している。
125 .PP
126 \fIformat\fP 文字列が ASCII 以外のワイド文字を含んでいる場合、 実行時のロケールの \fBLC_CTYPE\fP カテゴリがコンパイル時の
127 \fBLC_CTYPE\fP カテゴリと 一致している場合にのみプログラムは正常に動作する。これは \fIwchar_t\fP
128 の表現がロケールやプラットホームに依存していることに原因がある。 (glibc ではワイド文字として Unicode (ISO\-10646)
129 のコードポイントを 使用している。他のプラットホームではそうではない。同様に ISO C99 の \eunnnn
130 形式の汎用文字名称はこの問題を解決しない。)  このため国際化されたプログラムでは \fIformat\fP 文字列を ASCII ワイド
131 文字のみにするか、実行時に国際化された方法で構成する必要がある (例えば \fBgettext\fP()  と \fBiconv\fP()  や
132 \fBmbstowcs\fP()  を組み合わて使用する)。
133 .SH 関連項目
134 .\" .BR wscanf (3)
135 \fBfprintf\fP(3), \fBfputwc\fP(3), \fBfwide\fP(3), \fBprintf\fP(3), \fBsnprintf\fP(3)
136 .SH この文書について
137 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
138 である。プロジェクトの説明とバグ報告に関する情報は
139 http://www.kernel.org/doc/man\-pages/ に書かれている。