aboutsummaryrefslogtreecommitdiff
path: root/documentation/manual-pages/ja/man3/fgetln.3
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/manual-pages/ja/man3/fgetln.3')
-rw-r--r--documentation/manual-pages/ja/man3/fgetln.3124
1 files changed, 124 insertions, 0 deletions
diff --git a/documentation/manual-pages/ja/man3/fgetln.3 b/documentation/manual-pages/ja/man3/fgetln.3
new file mode 100644
index 0000000000..4f475eb12d
--- /dev/null
+++ b/documentation/manual-pages/ja/man3/fgetln.3
@@ -0,0 +1,124 @@
+.\" Copyright (c) 1990, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)fgetln.3 8.3 (Berkeley) 4/19/94
+.\" %FreeBSD: src/lib/libc/stdio/fgetln.3,v 1.4.2.3 2001/12/14 18:33:57 ru Exp %
+.\"
+.\" $FreeBSD$
+.\"
+.\" WORD: error indicator エラー表示子 [JIS C]
+.Dd April 19, 1994
+.Dt FGETLN 3
+.Os
+.Sh 名称
+.Nm fgetln
+.Nd ストリームから行を取得
+.Sh ライブラリ
+.Lb libc
+.Sh 書式
+.In stdio.h
+.Ft char *
+.Fn fgetln "FILE *stream" "size_t *len"
+.Sh 解説
+.Fn fgetln
+関数は、
+.Fa stream
+が参照するストリームから次の行のポインタを戻します。
+取得した行は、
+.Dv NUL
+文字で終端されていませんので、C 言語での文字列では
+.Em ありません。
+最後の改行も含めた行の長さは、
+.Fa len
+が指すメモリ位置に保存されます
+(ただし、改行で終わらないファイルの最後に行がある場合、
+戻されるテキストに改行は含まれません)。
+.Sh 戻り値
+正常終了すると、ポインタが戻されます。
+このポインタは、次に
+.Fa stream
+で
+.Tn I/O
+操作を行った後 (成功であれ失敗であれ)、あるいはストリームが
+閉じた直後では無効になります。
+異常終了した場合は
+.Dv NULL
+が戻されます。
+.Fn fgetln
+関数は、ファイルの終了とエラーとを区別しません。
+ファイルの終了かエラーかを判断するには、ルーチン
+.Xr feof 3
+および
+.Xr ferror 3
+を使用しなくてはなりません。
+エラーが発生した場合は、そのエラーを示すために
+グローバル変数
+.Va errno
+が設定されます。
+ファイルの終了状態はたとえ端末であっても記憶されます。
+.Xr clearerr 3
+でその状態がクリアされるまでは、
+その後読込みを試みてもすべて
+.Dv NULL
+が返されます。
+.Pp
+戻されたポインタが指し示すテキストは、
+そのサイズを超えて変更を加えないという条件であれば
+変更することができます。
+この変更内容は、ポインタが無効になると失われます。
+.Sh エラー
+.Bl -tag -width Er
+.It Bq Er EBADF
+引数
+.Fa stream
+が、読込み用に開いたストリームではありません。
+.El
+.Pp
+.Fn fgetln
+関数はエラーを発生し、ルーチン
+.Xr fflush 3 ,
+.Xr malloc 3 ,
+.Xr read 2 ,
+.Xr stat 2 ,
+.Xr realloc 3
+用に指定されたエラーのいずれかが
+.Va errno
+に設定される場合があります。
+.Sh 関連項目
+.Xr ferror 3 ,
+.Xr fgets 3 ,
+.Xr fopen 3 ,
+.Xr putc 3
+.Sh 歴史
+.Fn fgetln
+関数は、
+.Bx 4.4
+ではじめて登場しました。