diff options
author | des <des@FreeBSD.org> | 2001-06-10 15:48:04 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-06-10 15:48:04 +0000 |
commit | 23c38e4e7c8ac5370802f5158ea3085e8d58081a (patch) | |
tree | bf847b257ccd40d68502d78a22a262be3f3bcdd9 /share/man/man9/sbuf.9 | |
parent | add2afe54c2e0bce5ea9cd2a11cabc257bd6cbb3 (diff) | |
download | FreeBSD-src-23c38e4e7c8ac5370802f5158ea3085e8d58081a.zip FreeBSD-src-23c38e4e7c8ac5370802f5158ea3085e8d58081a.tar.gz |
sbuf_new(9) now returns a struct sbuf * instead of an int. If the caller
does not provide a struct sbuf, sbuf_new(9) will allocate one and return
a pointer to it.
Diffstat (limited to 'share/man/man9/sbuf.9')
-rw-r--r-- | share/man/man9/sbuf.9 | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9 index 220bec6..6c5b112 100644 --- a/share/man/man9/sbuf.9 +++ b/share/man/man9/sbuf.9 @@ -45,7 +45,7 @@ .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <sys/sbuf.h> -.Ft int +.Ft struct sbuf *s .Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags" .Ft void .Fn sbuf_clear "struct sbuf *s" @@ -85,6 +85,13 @@ The function initializes the .Fa sbuf pointed to by its first argument. +If that pointer is +.Dv NULL , +.Fn sbuf_new +allocates a +.Fa struct sbuf +using +.Xr malloc 9 . The .Fa buf argument is a pointer to a buffer in which to store the actual string; @@ -213,7 +220,10 @@ or it is reinitialized to a sufficiently short string using .Fn sbuf_cpy . .Sh RETURN VALUES .Fn sbuf_new -returns \-1 if it failed to allocate a storage buffer, and zero +returns +.Dv NULL +if it failed to allocate a storage buffer, and a pointer to the new +.Fa sbuf otherwise. .Pp .Fn sbuf_setpos |