xref: /netbsd-src/crypto/external/bsd/openssl/dist/doc/man3/BIO_printf.pod (revision b0d1725196a7921d003d2c66a14f186abda4176b)
113d40330Schristos=pod
213d40330Schristos
313d40330Schristos=head1 NAME
413d40330Schristos
513d40330SchristosBIO_printf, BIO_vprintf, BIO_snprintf, BIO_vsnprintf
613d40330Schristos- formatted output to a BIO
713d40330Schristos
813d40330Schristos=head1 SYNOPSIS
913d40330Schristos
1013d40330Schristos #include <openssl/bio.h>
1113d40330Schristos
12*b0d17251Schristos int BIO_printf(BIO *bio, const char *format, ...);
13*b0d17251Schristos int BIO_vprintf(BIO *bio, const char *format, va_list args);
1413d40330Schristos
15*b0d17251Schristos int BIO_snprintf(char *buf, size_t n, const char *format, ...);
16*b0d17251Schristos int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
1713d40330Schristos
1813d40330Schristos=head1 DESCRIPTION
1913d40330Schristos
2013d40330SchristosBIO_printf() is similar to the standard C printf() function, except that
21*b0d17251Schristosthe output is sent to the specified BIO, I<bio>, rather than standard
2213d40330Schristosoutput.  All common format specifiers are supported.
2313d40330Schristos
2413d40330SchristosBIO_vprintf() is similar to the vprintf() function found on many platforms,
25*b0d17251Schristosthe output is sent to the specified BIO, I<bio>, rather than standard
2613d40330Schristosoutput.  All common format specifiers are supported. The argument
27*b0d17251Schristoslist I<args> is a stdarg argument list.
2813d40330Schristos
2913d40330SchristosBIO_snprintf() is for platforms that do not have the common snprintf()
30*b0d17251Schristosfunction. It is like sprintf() except that the size parameter, I<n>,
3113d40330Schristosspecifies the size of the output buffer.
3213d40330Schristos
3313d40330SchristosBIO_vsnprintf() is to BIO_snprintf() as BIO_vprintf() is to BIO_printf().
3413d40330Schristos
3513d40330Schristos=head1 RETURN VALUES
3613d40330Schristos
3713d40330SchristosAll functions return the number of bytes written, or -1 on error.
3813d40330SchristosFor BIO_snprintf() and BIO_vsnprintf() this includes when the output
3913d40330Schristosbuffer is too small.
4013d40330Schristos
41*b0d17251Schristos=head1 NOTES
42*b0d17251Schristos
43*b0d17251SchristosExcept when I<n> is 0, both BIO_snprintf() and BIO_vsnprintf() always
44*b0d17251Schristosterminate their output with C<'\0'>.  This includes cases where -1 is
45*b0d17251Schristosreturned, such as when there is insufficient space to output the whole
46*b0d17251Schristosstring.
47*b0d17251Schristos
4813d40330Schristos=head1 COPYRIGHT
4913d40330Schristos
50*b0d17251SchristosCopyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
5113d40330Schristos
52*b0d17251SchristosLicensed under the Apache License 2.0 (the "License").  You may not use
5313d40330Schristosthis file except in compliance with the License.  You can obtain a copy
5413d40330Schristosin the file LICENSE in the source distribution or at
5513d40330SchristosL<https://www.openssl.org/source/license.html>.
5613d40330Schristos
5713d40330Schristos=cut
58