Deleted Added
full compact
sbuf.9 (89204) sbuf.9 (104449)
1.\"-
2.\" Copyright (c) 2000 Poul Henning Kamp and Dag-Erling Co�dan Sm�rgrav
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
1.\"-
2.\" Copyright (c) 2000 Poul Henning Kamp and Dag-Erling Co�dan Sm�rgrav
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD: head/share/man/man9/sbuf.9 89204 2002-01-10 12:53:51Z ru $
26.\" $FreeBSD: head/share/man/man9/sbuf.9 104449 2002-10-04 09:58:17Z phk $
27.\"
28.Dd January 3, 2002
29.Dt SBUF 9
30.Os
31.Sh NAME
32.Nm sbuf_new ,
33.Nm sbuf_clear ,
34.Nm sbuf_setpos ,

--- 6 unchanged lines hidden (view full) ---

41.Nm sbuf_printf ,
42.Nm sbuf_vprintf ,
43.Nm sbuf_putc ,
44.Nm sbuf_trim ,
45.Nm sbuf_overflowed ,
46.Nm sbuf_finish ,
47.Nm sbuf_data ,
48.Nm sbuf_len ,
27.\"
28.Dd January 3, 2002
29.Dt SBUF 9
30.Os
31.Sh NAME
32.Nm sbuf_new ,
33.Nm sbuf_clear ,
34.Nm sbuf_setpos ,

--- 6 unchanged lines hidden (view full) ---

41.Nm sbuf_printf ,
42.Nm sbuf_vprintf ,
43.Nm sbuf_putc ,
44.Nm sbuf_trim ,
45.Nm sbuf_overflowed ,
46.Nm sbuf_finish ,
47.Nm sbuf_data ,
48.Nm sbuf_len ,
49.Nm sbuf_done ,
49.Nm sbuf_delete
50.Nd safe string formatting
51.Sh SYNOPSIS
52.In sys/types.h
53.In sys/sbuf.h
54.Ft struct sbuf *
55.Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags"
56.Ft void

--- 23 unchanged lines hidden (view full) ---

80.Ft int
81.Fn sbuf_overflowed "struct sbuf *s"
82.Ft void
83.Fn sbuf_finish "struct sbuf *s"
84.Ft char *
85.Fn sbuf_data "struct sbuf *s"
86.Ft int
87.Fn sbuf_len "struct sbuf *s"
50.Nm sbuf_delete
51.Nd safe string formatting
52.Sh SYNOPSIS
53.In sys/types.h
54.In sys/sbuf.h
55.Ft struct sbuf *
56.Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags"
57.Ft void

--- 23 unchanged lines hidden (view full) ---

81.Ft int
82.Fn sbuf_overflowed "struct sbuf *s"
83.Ft void
84.Fn sbuf_finish "struct sbuf *s"
85.Ft char *
86.Fn sbuf_data "struct sbuf *s"
87.Ft int
88.Fn sbuf_len "struct sbuf *s"
89.Ft int
90.Fn sbuf_done "struct sbuf *s"
88.Ft void
89.Fn sbuf_delete "struct sbuf *s"
90.Sh DESCRIPTION
91The
92.Nm sbuf
93family of functions allows one to safely allocate, construct and
94release bounded null-terminated strings in kernel space.
95Instead of arrays of characters, these functions operate on structures

--- 178 unchanged lines hidden (view full) ---

274The
275.Fn sbuf_data
276and
277.Fn sbuf_len
278functions return the actual string and its length, respectively;
279.Fn sbuf_data
280only works on a finished
281.Fa sbuf .
91.Ft void
92.Fn sbuf_delete "struct sbuf *s"
93.Sh DESCRIPTION
94The
95.Nm sbuf
96family of functions allows one to safely allocate, construct and
97release bounded null-terminated strings in kernel space.
98Instead of arrays of characters, these functions operate on structures

--- 178 unchanged lines hidden (view full) ---

277The
278.Fn sbuf_data
279and
280.Fn sbuf_len
281functions return the actual string and its length, respectively;
282.Fn sbuf_data
283only works on a finished
284.Fa sbuf .
285.Fn sbuf_done
286returns non-zero if the sbuf is finished.
282.Pp
283Finally, the
284.Fn sbuf_delete
285function clears the
286.Fa sbuf
287and frees its storage buffer if it was allocated by
288.Fn sbuf_new .
289.Sh NOTES

--- 70 unchanged lines hidden ---
287.Pp
288Finally, the
289.Fn sbuf_delete
290function clears the
291.Fa sbuf
292and frees its storage buffer if it was allocated by
293.Fn sbuf_new .
294.Sh NOTES

--- 70 unchanged lines hidden ---