Module Name: src
Committed By: jruoho
Date: Wed Jun 30 13:38:10 UTC 2010
Modified Files:
src/lib/libc/stdio: getdelim.3
Log Message:
Use .Fn instead of .Fa for functions. Also rearrange slightly.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdio/getdelim.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/stdio/getdelim.3
diff -u src/lib/libc/stdio/getdelim.3:1.7 src/lib/libc/stdio/getdelim.3:1.8
--- src/lib/libc/stdio/getdelim.3:1.7 Wed Dec 9 18:06:08 2009
+++ src/lib/libc/stdio/getdelim.3 Wed Jun 30 13:38:10 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: getdelim.3,v 1.7 2009/12/09 18:06:08 joerg Exp $
+.\" $NetBSD: getdelim.3,v 1.8 2010/06/30 13:38:10 jruoho Exp $
.\"
.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd November 30, 2009
+.Dd June 30, 2010
.Dt GETDELIM 3
.Os
.Sh NAME
@@ -47,13 +47,16 @@
.Fn getdelim
function reads from the
.Fa stream
-until it encounters a character matching the
-.Fa delimiter
-character, storing the input in
+until it encounters a character matching
+.Fa delimiter ,
+storing the input in
.Fa *lineptr .
The buffer is
.Dv NUL Ns No -terminated
and includes the delimiter.
+The
+.Fa delimiter
+character must be representable as an unsigned char.
.Pp
If
.Fa *n
@@ -62,6 +65,10 @@
must be pre-allocated to at least
.Fa *n
bytes.
+The buffer should be allocated dynamically;
+it must be possible to
+.Xr free 3
+.Fa *lineptr .
.Fn getdelim
ensures that
.Fa *lineptr
@@ -69,17 +76,13 @@
.Fa *n
to reflect the new size.
.Pp
+The
+.Fn getline
+function is equivalent to
+.Fn getdelim
+with
.Fa delimiter
-must be representable as an unsigned char, and
-.Fa *lineptr
-must be a
-.Xr free 3 Ns No able
-buffer.
-.Pp
-.Fa getline
-is equivalent to
-.Fa getdelim
-with the delimiter set to the newline character.
+set to the newline character.
.Sh RETURN VALUES
The
.Fn getdelim