1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
.\" $OpenBSD: BIO_printf.3,v 1.3 2018/03/22 17:11:04 schwarze Exp $
.\" OpenSSL 2ca2e917 Mon Mar 20 16:25:22 2017 -0400
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: March 22 2018 $
.Dt BIO_PRINTF 3
.Os
.Sh NAME
.Nm BIO_printf ,
.Nm BIO_vprintf ,
.Nm BIO_snprintf ,
.Nm BIO_vsnprintf
.Nd formatted output to a BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft int
.Fo BIO_printf
.Fa "BIO *bio"
.Fa "const char *format"
.Fa ...
.Fc
.Ft int
.Fo BIO_vprintf
.Fa "BIO *bio"
.Fa "const char *format"
.Fa "va_list args"
.Fc
.Ft int
.Fo BIO_snprintf
.Fa "char *buf"
.Fa "size_t n"
.Fa "const char *format"
.Fa ...
.Fc
.Ft int
.Fo BIO_vsnprintf
.Fa "char *buf"
.Fa "size_t n"
.Fa "const char *format"
.Fa "va_list args"
.Fc
.Sh DESCRIPTION
.Fn BIO_vprintf
is a wrapper around
.Xr vfprintf 3 ,
sending the output to the specified
.Fa bio .
.Pp
.Fn BIO_printf
is a wrapper around
.Fn BIO_vprintf .
.Pp
.Fn BIO_snprintf
and
.Fn BIO_vsnprintf
are wrappers around
.Xr vsnprintf 3 .
.Sh RETURN VALUES
These functions return the number of bytes written,
or -1 if an error occurs.
.Pp
In contrast to
.Xr snprintf 3
and
.Xr vsnprintf 3 ,
.Fn BIO_snprintf
and
.Fn BIO_vsnprintf
also return -1 if
.Fa n
is too small to hold the complete output.
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_printf
first appeared in SSLeay 0.6.5 and has been available since
.Ox 2.4 .
.Pp
.Fn BIO_vprintf ,
.Fn BIO_snprintf ,
and
.Fn BIO_vsnprintf
first appeared in OpenSSL 0.9.6 and have been available since
.Ox 2.9 .
|