xref: /freebsd/crypto/openssl/doc/man3/BIO_printf.pod (revision e71b70530d95c4f34d8bdbd78d1242df1ba4a945)
1*e71b7053SJung-uk Kim=pod
2*e71b7053SJung-uk Kim
3*e71b7053SJung-uk Kim=head1 NAME
4*e71b7053SJung-uk Kim
5*e71b7053SJung-uk KimBIO_printf, BIO_vprintf, BIO_snprintf, BIO_vsnprintf
6*e71b7053SJung-uk Kim- formatted output to a BIO
7*e71b7053SJung-uk Kim
8*e71b7053SJung-uk Kim=head1 SYNOPSIS
9*e71b7053SJung-uk Kim
10*e71b7053SJung-uk Kim #include <openssl/bio.h>
11*e71b7053SJung-uk Kim
12*e71b7053SJung-uk Kim int BIO_printf(BIO *bio, const char *format, ...)
13*e71b7053SJung-uk Kim int BIO_vprintf(BIO *bio, const char *format, va_list args)
14*e71b7053SJung-uk Kim
15*e71b7053SJung-uk Kim int BIO_snprintf(char *buf, size_t n, const char *format, ...)
16*e71b7053SJung-uk Kim int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
17*e71b7053SJung-uk Kim
18*e71b7053SJung-uk Kim=head1 DESCRIPTION
19*e71b7053SJung-uk Kim
20*e71b7053SJung-uk KimBIO_printf() is similar to the standard C printf() function, except that
21*e71b7053SJung-uk Kimthe output is sent to the specified BIO, B<bio>, rather than standard
22*e71b7053SJung-uk Kimoutput.  All common format specifiers are supported.
23*e71b7053SJung-uk Kim
24*e71b7053SJung-uk KimBIO_vprintf() is similar to the vprintf() function found on many platforms,
25*e71b7053SJung-uk Kimthe output is sent to the specified BIO, B<bio>, rather than standard
26*e71b7053SJung-uk Kimoutput.  All common format specifiers are supported. The argument
27*e71b7053SJung-uk Kimlist B<args> is a stdarg argument list.
28*e71b7053SJung-uk Kim
29*e71b7053SJung-uk KimBIO_snprintf() is for platforms that do not have the common snprintf()
30*e71b7053SJung-uk Kimfunction. It is like sprintf() except that the size parameter, B<n>,
31*e71b7053SJung-uk Kimspecifies the size of the output buffer.
32*e71b7053SJung-uk Kim
33*e71b7053SJung-uk KimBIO_vsnprintf() is to BIO_snprintf() as BIO_vprintf() is to BIO_printf().
34*e71b7053SJung-uk Kim
35*e71b7053SJung-uk Kim=head1 RETURN VALUES
36*e71b7053SJung-uk Kim
37*e71b7053SJung-uk KimAll functions return the number of bytes written, or -1 on error.
38*e71b7053SJung-uk KimFor BIO_snprintf() and BIO_vsnprintf() this includes when the output
39*e71b7053SJung-uk Kimbuffer is too small.
40*e71b7053SJung-uk Kim
41*e71b7053SJung-uk Kim=head1 COPYRIGHT
42*e71b7053SJung-uk Kim
43*e71b7053SJung-uk KimCopyright 2017 The OpenSSL Project Authors. All Rights Reserved.
44*e71b7053SJung-uk Kim
45*e71b7053SJung-uk KimLicensed under the OpenSSL license (the "License").  You may not use
46*e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
47*e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
48*e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
49*e71b7053SJung-uk Kim
50*e71b7053SJung-uk Kim=cut
51