.\" Copyright (C) 2001 Andries Brouwer . .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI all rights reserved. .\" Translated Nov 2 2002 by Akihiro MOTOKI .TH STDIO_EXT 3 2001-12-16 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O __fbufsize, __flbf, __fpending, __fpurge, __freadable, .\"O __freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \- .\"O interfaces to stdio FILE structure __fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \- 標準入出力ファイル構造体へのインタフェース .\"O .SH SYNOPSIS .SH 書式 .B #include .br .B #include .sp .BI "size_t __fbufsize(FILE *" stream ); .br .BI "size_t __fpending(FILE *" stream ); .br .BI "int __flbf(FILE *" stream ); .br .BI "int __freadable(FILE *" stream ); .br .BI "int __fwritable(FILE *" stream ); .br .BI "int __freading(FILE *" stream ); .br .BI "int __fwriting(FILE *" stream ); .br .BI "int __fsetlocking(FILE *" stream ", int " type ); .br .B "void _flushlbf(void);" .br .BI "void __fpurge(FILE *" stream ); .\"O .SH DESCRIPTION .SH 説明 .\"O Solaris introduced routines to allow portable access to the .\"O internals of the .\"O .I FILE .\"O structure, and glibc also implemented these. Solaris では、 .I FILE 構造体の内部へポータブルなかたちで アクセスできる手段が導入されており、これらは glibc でも実装されている。 .LP .\"O The .\"O .BR __fbufsize () .\"O function returns the size of the buffer currently used .\"O by the given stream. .BR __fbufsize () 関数は、指定されたストリームが使用しているバッファ・サイズを返す。 .LP .\"O The .\"O .BR __fpending () .\"O function returns the number of bytes in the output buffer. .\"O For wide-oriented streams the unit is wide characters. .\"O This function is undefined on buffers in reading mode, .\"O or opened read-only. .BR __fpending () 関数は、出力バッファに入っているデータのバイト数を返す。 ワイドキャラクタを扱うストリームの場合、ワイドキャラクタ単位で計算される。 バッファが読み出しモードの場合や読み出し専用で開かれている場合の この関数の振舞いは未定義である。 .LP .\"O The .\"O .BR __flbf () .\"O function returns a nonzero value if the stream is line-buffered, .\"O and zero otherwise. .BR __flbf () 関数は、ストリームがラインバッファの場合は 0 以外を、 それ以外の場合は 0 を返す。 .LP .\"O The .\"O .BR __freadable () .\"O function returns a nonzero value if the stream allows reading, .\"O and zero otherwise. .BR __freadable () 関数は、ストリームが読み出し可能な場合は 0 以外を、 それ以外の場合は 0 を返す。 .LP .\"O The .\"O .BR __fwritable () .\"O function returns a nonzero value if the stream allows writing, .\"O and zero otherwise. .BR __fwritable () 関数は、ストリームが書き込み可能な場合は 0 以外を、 それ以外の場合は 0 を返す。 .LP .\"O The .\"O .BR __freading () .\"O function returns a nonzero value if the stream is read-only, or .\"O if the last operation on the stream was a read operation, .\"O and zero otherwise. .BR __freading () 関数は、ストリームが読み出し専用の場合、またはストリームに対する直前の操作が 読み出し操作であった場合は 0 以外を返し、それ以外の場合は 0 を返す。 .LP .\"O The .\"O .BR __fwriting () .\"O function returns a nonzero value if the stream is write-only (or .\"O append-only), or if the last operation on the stream was a write .\"O operation, and zero otherwise. .BR __fwriting () 関数は、ストリームが書き込み専用(もしくは追加専用)の場合、 またはストリームに対する直前の操作が書き込み操作であった場合は 0 以外を返し、 それ以外の場合は 0 を返す。 .LP .\"O The .\"O .BR __fsetlocking () .\"O function can be used to select the desired type of locking on the stream. .\"O It returns the current type. .\"O The .\"O .I type .\"O argument can take the following three values: .BR __fsetlocking () 関数は、ストリームのロック形式を選択するために使用できる。 返り値は、現在のロック形式である。 .I type 引き数は以下の 3 種類の値をとることができる : .TP .B FSETLOCKING_INTERNAL .\"O Perform implicit locking around every operation on the given stream .\"O (except for the *_unlocked ones). .\"O This is the default. 指定されたストリームに対して操作が行われる度に、操作の前後で 明示的に指示しなくてもストリームのロック処理を行う (但し、*_unlocked 関数を使用した場合は例外である)。 これがデフォルトのロック形式である。 .TP .B FSETLOCKING_BYCALLER .\"O The caller will take care of the locking (possibly using .\"O .BR flockfile (3) .\"O in case there is more than one thread), and the stdio routines .\"O will not do locking until the state is reset to .\"O .BR FSETLOCKING_INTERNAL . 関数の呼び出し元でロックの面倒をみる。 (おそらく、複数のスレッドが存在する状況では .BR flockfile (3) を使うことになるだろう) ロック形式が .B FSETLOCKING_INTERNAL にリセットされるまでは標準入出力関連の関数はロック処理を行わない。 .TP .B FSETLOCKING_QUERY .\"O Don't change the type of locking. .\"O (Only return it.) ロック形式の変更を行わない。(現在の形式を返すだけである) .LP .\"O The .\"O .BR _flushlbf () .\"O function flushes all line-buffered streams. .\"O (Presumably so that .\"O output to a terminal is forced out, say before reading keyboard input.) .BR _flushlbf () 関数は、すべてのラインバッファ (line-buffered) タイプのストリームの 内容を出力(フラッシュ)する。 (当然ながら、端末への出力が強制的に行われることになるので、 キーボードからの入力を読みこむ前にこの関数を呼んだ方がいいだろう) .LP .\"O The .\"O .BR __fpurge () .\"O function discards the contents of the stream's buffer. .BR __fpurge () 関数は、ストリームのバッファの内容を廃棄する。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR flockfile (3), .BR fpurge (3)