comparison buf_printf.3 @ 0:b1991ee4451d

misc: initial import
author David Demelier <markand@malikania.fr>
date Thu, 29 Oct 2020 17:24:30 +0100
parents
children 939fe74cd80a
comparison
equal deleted inserted replaced
-1:000000000000 0:b1991ee4451d
1 .\"
2 .\" buf_printf.3 -- simple string buffer for C
3 .\"
4 .\" Copyright (c) 2019-2020 David Demelier <markand@malikania.fr>
5 .\"
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .Dd October 29, 2019-2020
19 .Dt BUF_PRINTF 3
20 .Os
21 .\" NAME
22 .Sh NAME
23 .Nm buf_printf
24 .Nd write a to a buffer using printf(3) like format
25 .\" SYNOPSIS
26 .Sh SYNOPSIS
27 .In buf.h
28 .Ft bool
29 .Fn buf_printf "struct buf *b" "const char *fmt" "..."
30 .\" DESCRIPTION
31 .Sh DESCRIPTION
32 This function uses the
33 .Xr printf 3
34 format to be appended in the buffer
35 .Fa b .
36 See the
37 .Xr printf 3
38 manual page for a detailed description of
39 .Fa fmt
40 string.
41 .\" RETURN VALUE
42 .Sh RETURN VALUE
43 The
44 .Fn buf_printf
45 function returns false in case of error and
46 .Va errno
47 is set to indicate the error.
48 .\" ERRORS
49 .Sh ERRORS
50 .Bl -tag -width Er
51 .It Bq Er ENOMEM
52 Couldn't allocate more memory.
53 .El
54 .\" SEE ALSO
55 .Sh SEE ALSO
56 .Xr libbuf 3 ,
57 .Xr buf_vprintf 3 ,
58 .Xr printf 3
59 .\" AUTHORS
60 .Sh AUTHORS
61 The
62 .Nm libbuf
63 library was written by
64 .An David Demelier <markand@malikania.fr>