getline.3 (216086) | getline.3 (233648) |
---|---|
1.\" Copyright (c) 2009 David Schultz <das@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" | 1.\" Copyright (c) 2009 David Schultz <das@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" |
25.\" $FreeBSD: head/lib/libc/stdio/getline.3 216086 2010-11-30 21:26:21Z das $ | 25.\" $FreeBSD: head/lib/libc/stdio/getline.3 233648 2012-03-29 05:02:12Z eadler $ |
26.\" 27.Dd November 30, 2010 28.Dt GETLINE 3 29.Os 30.Sh NAME 31.Nm getdelim , 32.Nm getline 33.Nd get a line from a stream --- 39 unchanged lines hidden (view full) --- 73will be updated accordingly. 74.Sh RETURN VALUES 75The 76.Fn getdelim 77and 78.Fn getline 79functions return the number of characters written, excluding the 80terminating | 26.\" 27.Dd November 30, 2010 28.Dt GETLINE 3 29.Os 30.Sh NAME 31.Nm getdelim , 32.Nm getline 33.Nd get a line from a stream --- 39 unchanged lines hidden (view full) --- 73will be updated accordingly. 74.Sh RETURN VALUES 75The 76.Fn getdelim 77and 78.Fn getline 79functions return the number of characters written, excluding the 80terminating |
81.Dv NUL | 81.Dv NUL |
82character. 83The value \-1 is returned if an error occurs, or if end-of-file is reached. 84.Sh EXAMPLES 85The following code fragment reads lines from a file and 86writes them to standard output. 87The 88.Fn fwrite 89function is used in case the line contains embedded --- 76 unchanged lines hidden --- | 82character. 83The value \-1 is returned if an error occurs, or if end-of-file is reached. 84.Sh EXAMPLES 85The following code fragment reads lines from a file and 86writes them to standard output. 87The 88.Fn fwrite 89function is used in case the line contains embedded --- 76 unchanged lines hidden --- |