comparison buf_puts.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_puts.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_PUTS 3
20 .Os
21 .\" NAME
22 .Sh NAME
23 .Nm buf_puts
24 .Nd append a NUL-terminated string
25 .\" SYNOPSIS
26 .Sh SYNOPSIS
27 .In buf.h
28 .Ft bool
29 .Fn buf_puts "struct buf *b" "const char *src"
30 .\" DESCRIPTION
31 .Sh DESCRIPTION
32 Append the NUL-terminated string
33 .Fa src
34 into the buffer specified by
35 .Fa b .
36 .Pp
37 It is undefined behavior if
38 .Fa src
39 argument is NULL.
40 .\" RETURN VALUE
41 .Sh RETURN VALUE
42 The
43 .Fn buf_puts
44 function returns false in case of error and
45 .Va errno
46 is set to indicate the error.
47 .\" ERRORS
48 .Sh ERRORS
49 .Bl -tag -width Er
50 .It Bq Er ENOMEM
51 Couldn't allocate more memory.
52 .El
53 .\" SEE ALSO
54 .Sh SEE ALSO
55 .Xr libbuf 3
56 .\" AUTHORS
57 .Sh AUTHORS
58 The
59 .Nm libbuf
60 library was written by
61 .An David Demelier <markand@malikania.fr>