diff options
author | ngie <ngie@FreeBSD.org> | 2017-07-18 08:28:14 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-07-18 08:28:14 +0000 |
commit | 9101fce73d934d21bb880325918aba860a0fa2e8 (patch) | |
tree | 1b7df93188b49b75d956f890072d565dd94bdf1f | |
parent | 52e5dae54c0d1e73625f9980e26e61713444473b (diff) | |
download | FreeBSD-src-9101fce73d934d21bb880325918aba860a0fa2e8.zip FreeBSD-src-9101fce73d934d21bb880325918aba860a0fa2e8.tar.gz |
MFC r316549,r316550,r316551,r316554:
r316549:
Add sys/types.h #include to EXAMPLE to provide a complete functional
standalone example program
r316550:
sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entries
This shortens the column count on many lines considerably.
While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9)
recommendations.
r316551:
sbuf(9): clarify kernel-only APIs
- move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as
all three functions are kernel-only APIs.
- add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to
make it visually clear that they are kernel-only APIs.
r316554:
sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9)
These functions were added in r279992.
-rw-r--r-- | share/man/man9/Makefile | 3 | ||||
-rw-r--r-- | share/man/man9/sbuf.9 | 152 |
2 files changed, 124 insertions, 31 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9f4a400..e44e5e4 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1149,6 +1149,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_bcpy.9 \ sbuf.9 sbuf_cat.9 \ sbuf.9 sbuf_clear.9 \ + sbuf.9 sbuf_clear_flags.9 \ sbuf.9 sbuf_copyin.9 \ sbuf.9 sbuf_cpy.9 \ sbuf.9 sbuf_data.9 \ @@ -1156,6 +1157,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_done.9 \ sbuf.9 sbuf_error.9 \ sbuf.9 sbuf_finish.9 \ + sbuf.9 sbuf_get_flags.9 \ sbuf.9 sbuf_hexdump.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ @@ -1163,6 +1165,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_printf.9 \ sbuf.9 sbuf_putc.9 \ sbuf.9 sbuf_set_drain.9 \ + sbuf.9 sbuf_set_flags.9 \ sbuf.9 sbuf_setpos.9 \ sbuf.9 sbuf_trim.9 \ sbuf.9 sbuf_vprintf.9 diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9 index 4dcb894..c03e162 100644 --- a/share/man/man9/sbuf.9 +++ b/share/man/man9/sbuf.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2015 +.Dd April 5, 2017 .Dt SBUF 9 .Os .Sh NAME @@ -66,57 +66,123 @@ .Ft typedef\ int ( sbuf_drain_func ) ( void\ *arg, const\ char\ *data, int\ len ) ; .Pp .Ft struct sbuf * -.Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags" +.Fo sbuf_new +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "int flags" +.Fc .Ft struct sbuf * -.Fn sbuf_new_auto +.Fo sbuf_new_auto +.Fa "void" +.Fc .Ft void -.Fn sbuf_clear "struct sbuf *s" +.Fo sbuf_clear +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_get_flags "struct sbuf *s" +.Fo sbuf_get_flags +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_set_flags "struct sbuf *s" "int flags" +.Fo sbuf_set_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft void -.Fn sbuf_clear_flags "struct sbuf *s" "int flags" -.Ft int -.Fn sbuf_setpos "struct sbuf *s" "int pos" -.Ft int -.Fn sbuf_bcat "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_clear_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft int -.Fn sbuf_bcopyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_setpos +.Fa "struct sbuf *s" +.Fa "int pos" +.Fc .Ft int -.Fn sbuf_bcpy "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_bcat +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_cat "struct sbuf *s" "const char *str" +.Fo sbuf_bcpy +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_copyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_cat +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_cpy "struct sbuf *s" "const char *str" +.Fo sbuf_cpy +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_printf "struct sbuf *s" "const char *fmt" "..." +.Fo sbuf_printf +.Fa "struct sbuf *s" +.Fa "const char *fmt" "..." +.Fc .Ft int -.Fn sbuf_vprintf "struct sbuf *s" "const char *fmt" "va_list ap" +.Fo sbuf_vprintf +.Fa "struct sbuf *s" +.Fa "const char *fmt" +.Fa "va_list ap" +.Fc .Ft int -.Fn sbuf_putc "struct sbuf *s" "int c" +.Fo sbuf_putc +.Fa "struct sbuf *s" +.Fa "int c" +.Fc .Ft void -.Fn sbuf_set_drain "struct sbuf *s" "sbuf_drain_func *func" "void *arg" +.Fo sbuf_set_drain +.Fa "struct sbuf *s" +.Fa "sbuf_drain_func *func" +.Fa "void *arg" +.Fc .Ft int -.Fn sbuf_trim "struct sbuf *s" +.Fo sbuf_trim +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_error "struct sbuf *s" +.Fo sbuf_error +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_finish "struct sbuf *s" +.Fo sbuf_finish +.Fa "struct sbuf *s" +.Fc .Ft char * -.Fn sbuf_data "struct sbuf *s" +.Fo sbuf_data +.Fa "struct sbuf *s" +.Fc .Ft ssize_t -.Fn sbuf_len "struct sbuf *s" +.Fo sbuf_len +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_done "struct sbuf *s" +.Fo sbuf_done +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_delete "struct sbuf *s" +.Fo sbuf_delete +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_start_section "struct sbuf *s" "ssize_t *old_lenp" +.Fo sbuf_start_section +.Fa "struct sbuf *s" +.Fa "ssize_t *old_lenp" +.Fc .Ft ssize_t -.Fn sbuf_end_section "struct sbuf *s" "ssize_t old_len" "size_t pad" "int c" +.Fo sbuf_end_section +.Fa "struct sbuf *s" +.Fa "ssize_t old_len" +.Fa "size_t pad" +.Fa "int c" +.Fc .Ft void .Fo sbuf_hexdump .Fa "struct sbuf *sb" @@ -126,10 +192,33 @@ .Fa "int flags" .Fc .Ft void -.Fn sbuf_putbuf "struct sbuf *s" +.Fo sbuf_putbuf +.Fa "struct sbuf *s" +.Fc +.Fd #ifdef _KERNEL +.In sys/types.h +.In sys/sbuf.h +.Ft int +.Fo sbuf_bcopyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc +.Ft int +.Fo sbuf_copyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc .In sys/sysctl.h .Ft struct sbuf * -.Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" +.Fo sbuf_new_for_sysctl +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "struct sysctl_req *req" +.Fc +.Fd #endif /* _KERNEL */ .Sh DESCRIPTION The .Nm @@ -567,6 +656,7 @@ function (the userland version) will return zero for success and \-1 and set errno on error. .Sh EXAMPLES .Bd -literal -compact +#include <sys/types.h> #include <sys/sbuf.h> struct sbuf *sb; |