comparison buf_dup.3 @ 21:939fe74cd80a

buf: switch to int from bool
author David Demelier <markand@malikania.fr>
date Wed, 24 Feb 2021 11:39:26 +0100
parents b1991ee4451d
children d87e84936795
comparison
equal deleted inserted replaced
20:08a6d4e6012d 21:939fe74cd80a
23 .Nm buf_dup 23 .Nm buf_dup
24 .Nd duplicate a string buffer 24 .Nd duplicate a string buffer
25 .\" SYNOPSIS 25 .\" SYNOPSIS
26 .Sh SYNOPSIS 26 .Sh SYNOPSIS
27 .In buf.h 27 .In buf.h
28 .Ft bool 28 .Ft int
29 .Fn buf_dup "struct buf *b" "const struct buf *src" 29 .Fn buf_dup "struct buf *b" "const struct buf *src"
30 .\" DESCRIPTION 30 .\" DESCRIPTION
31 .Sh DESCRIPTION 31 .Sh DESCRIPTION
32 The pointer 32 The pointer
33 .Fa b 33 .Fa b
38 If the 38 If the
39 .Fa src 39 .Fa src
40 buffer isn't initialized (and contains a NULL data field) the destination 40 buffer isn't initialized (and contains a NULL data field) the destination
41 buffer 41 buffer
42 .Fa b 42 .Fa b
43 is unchanged but the function returns true. 43 is unchanged but the function returns 0.
44 .Pp 44 .Pp
45 Otherwise the 45 Otherwise the
46 .Fn buf_dup 46 .Fn buf_dup
47 function returns false in case of error and 47 function returns -1 in case of error and
48 .Va errno 48 .Va errno
49 is set to indicate the error. 49 is set to indicate the error.
50 .\" ERRORS 50 .\" ERRORS
51 .Sh ERRORS 51 .Sh ERRORS
52 .Bl -tag -width Er 52 .Bl -tag -width Er