diff options
author | des <des@FreeBSD.org> | 2001-06-11 17:05:52 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-06-11 17:05:52 +0000 |
commit | 86b7e548abe9b6b107b4747111ff5469096d79ce (patch) | |
tree | cc2047d7b2d1136314711a47d5c6025ee1784d50 /share/man/man9/sbuf.9 | |
parent | cd17b047230e791591e0941d1c8b6c3f59fa12eb (diff) | |
download | FreeBSD-src-86b7e548abe9b6b107b4747111ff5469096d79ce.zip FreeBSD-src-86b7e548abe9b6b107b4747111ff5469096d79ce.tar.gz |
Add sbuf_copyin(). Also add 'b' variants of sbuf_{cat,copyin,cpy}() which
ignore NUL bytes in the source string.
Diffstat (limited to 'share/man/man9/sbuf.9')
-rw-r--r-- | share/man/man9/sbuf.9 | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9 index 6c5b112..049aa7b 100644 --- a/share/man/man9/sbuf.9 +++ b/share/man/man9/sbuf.9 @@ -32,7 +32,11 @@ .Nm sbuf_new , .Nm sbuf_clear , .Nm sbuf_setpos , +.Nm sbuf_bcat , +.Nm sbuf_bcopyin , +.Nm sbuf_bcpy , .Nm sbuf_cat , +.Nm sbuf_copyin , .Nm sbuf_cpy , .Nm sbuf_printf , .Nm sbuf_putc , @@ -52,8 +56,16 @@ .Ft int .Fn sbuf_setpos "struct sbuf *s" "int pos" .Ft int +.Fn sbuf_bcat "struct sbuf *s" "const char *str" "size_t len" +.Ft int +.Fn sbuf_bcopyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Ft int +.Fn sbuf_bcpy "struct sbuf *s" "const char *str" "size_t len" +.Ft int .Fn sbuf_cat "struct sbuf *s" "const char *str" .Ft int +.Fn sbuf_copyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Ft int .Fn sbuf_cpy "struct sbuf *s" "const char *str" .Ft int .Fn sbuf_printf "struct sbuf *s" "char *fmt" "..." @@ -131,18 +143,57 @@ which is a value between zero and one less than the size of the storage buffer. .Pp The +.Fn sbuf_bcat +function appends the first +.Fa len +bytes from the byte string +.Fa str +to the +.Fa sbuf . +.Pp +The +.Fn sbuf_bcopyin +function copies +.Fa len +bytes from the specified userland address into the +.Fa sbuf . +.Pp +The +.Fn sbuf_bcpy +function replaces the contents of the +.Fa sbuf +with the first +.Fa len +bytes from the byte string +.Fa str . +.Pp +The .Fn sbuf_cat -function appends the string +function appends the NUL-terminated string .Fa str to the .Fa sbuf at the current position. .Pp The +.Fn sbuf_copyin +function copies a NUL-terminated string from the specified userland +address into the +.Fa sbuf . +If the +.Fa len +argument is non-zero, no more than +.Fa len +characters (not counting the terminating NUL) are copied; otherwise +the entire string, or as much of it as can fit in the +.Fa sbuf , +is copied. +.Pp +The .Fn sbuf_cpy function replaces the contents of the .Fa sbuf -with those of the string +with those of the NUL-terminated string .Fa str . This is equivalent to calling .Fn sbuf_cat @@ -248,6 +299,8 @@ return .Dv NULL and \-1, respectively, if the buffer overflowed. .Sh SEE ALSO +.Xr copyin 9 , +.Xr copyinstr 9 , .Xr printf 3 , .Xr strcat 3 , .Xr strcpy 3 |