OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / printf.3
index 6cd5346..5c29152 100644 (file)
@@ -303,27 +303,20 @@ NaN は文字列の先頭に `nan' をつけて表示するように規定され
 関数を初期シフト状態で呼び出してマルチバイト文字列に変換し、 変換されたマルチバイト文字列を出力する。
 .TP 
 \fBs\fP
-If no \fBl\fP modifier is present: The \fIconst char\ *\fP argument is expected to
-be a pointer to an array of character type (pointer to a string).
-Characters from the array are written up to (but not including) a
-terminating null byte (\(aq\e0\(aq); if a precision is specified, no more
-than the number specified are written.  If a precision is given, no null
-byte need be present; if the precision is not specified, or is greater than
-the size of the array, the array must contain a terminating null byte.
-
-If an \fBl\fP modifier is present: The \fIconst wchar_t\ *\fP argument is expected
-to be a pointer to an array of wide characters.  Wide characters from the
-array are converted to multibyte characters (each by a call to the
-\fBwcrtomb\fP(3)  function, with a conversion state starting in the initial
-state before the first wide character), up to and including a terminating
-null wide character.  The resulting multibyte characters are written up to
-(but not including) the terminating null byte.  If a precision is specified,
-no more bytes than the number specified are written, but no partial
-multibyte characters are written.  Note that the precision determines the
-number of \fIbytes\fP written, not the number of \fIwide characters\fP or \fIscreen
-positions\fP.  The array must contain a terminating null wide character,
-unless a precision is given and it is so small that the number of bytes
-written exceeds it before the end of the array is reached.
+\fBl\fP 修飾子がない場合、 引き数は \fIconst char\ *\fP 型で文字型の配列へのポインタ (文字列へのポインタ) であることが
+期待されている。配列中の文字は、終端の NULL バイト (\(aq\e0\(aq)  が出てくるまで出力される (終端文字は出力されない)。
+精度が指定されていると、指定された字数以上は出力されない。 精度が指定された場合には、終端バイトが存在する必要はない。
+精度が指定されていなかったり、精度の値が配列の大きさより大きい場合には、 配列は終端の NULL バイトを含んでいなければならない。
+
+\fBl\fP 修飾子が指定されている場合、 引き数は \fIconst wchar_t\ *\fP 型でワイド文字の配列へのポインタであることが期待されている。
+配列中のワイド文字は (1文字毎に \fBwcrtomb\fP(3)  を呼び出して) マルチバイト文字に変換される (最初のワイド文字の変換の前に
+\fBwcrtomb\fP()  のシフト状態を初期状態に戻してから変換は行われる)。 マルチバイト文字への変換は、文字列を終端する NULL ワイド文字が
+出てくるまで行われ、終端 NULL ワイド文字も含めて変換される。 結果のマルチバイト文字列は、終端の NULL バイトが出てくるまで 出力される
+(終端の NULL バイトは出力されない)。 精度が指定された場合、指定されたバイト数以上には出力されない。
+但し、マルチバイト文字の一部分だけが出力されることはない。 精度は「バイト」数を指定するものであり、「ワイド文字」数や
+「画面での位置」を指定するものではないことに注意。 精度が指定されていて、さらに出力が配列の末尾に達する前に出力バイト数が
+精度の値を超える場合だけは、配列は NULL ワイド文字で終端されていなくてもよい。 それ以外の場合は、必ず配列は NULL
+ワイド文字で終端されていなければならない。
 .TP 
 \fBC\fP
 (C99 にはないが SUSv2 にはある)  \fBlc\fP と同じ。使ってはならない。
@@ -332,12 +325,10 @@ written exceeds it before the end of the array is reached.
 (C99 にはないが SUSv2 にはある)  \fBls\fP と同じ。使ってはならない。
 .TP 
 \fBp\fP
-The \fIvoid\ *\fP pointer argument is printed in hexadecimal (as if by \fB%#x\fP
-or \fB%#lx\fP).
+\fIvoid\ *\fP ポインタ引き数を (\fB%#x\fP や \fB%#lx\fP のような) 16 進数で出力する。
 .TP 
 \fBn\fP
-The number of characters written so far is stored into the integer indicated
-by the \fIint\ *\fP (or variant) pointer argument.  No argument is converted.
+これまでに出力された文字数を \fIint\ *\fP (または類似の型) のポインタ引き数が指す整数に保存する。 引き数の変換は行われない。
 .TP 
 \fBm\fP
 (glibc での拡張)  \fIstrerror(errno)\fP の出力を表示する。引き数は必要ない。