1BIO_PRINTF(3ossl) OpenSSL BIO_PRINTF(3ossl)
2
3
4
6 BIO_printf, BIO_vprintf, BIO_snprintf, BIO_vsnprintf - formatted output
7 to a BIO
8
10 #include <openssl/bio.h>
11
12 int BIO_printf(BIO *bio, const char *format, ...);
13 int BIO_vprintf(BIO *bio, const char *format, va_list args);
14
15 int BIO_snprintf(char *buf, size_t n, const char *format, ...);
16 int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
17
19 BIO_printf() is similar to the standard C printf() function, except
20 that the output is sent to the specified BIO, bio, rather than standard
21 output. All common format specifiers are supported.
22
23 BIO_vprintf() is similar to the vprintf() function found on many
24 platforms, the output is sent to the specified BIO, bio, rather than
25 standard output. All common format specifiers are supported. The
26 argument list args is a stdarg argument list.
27
28 BIO_snprintf() is for platforms that do not have the common snprintf()
29 function. It is like sprintf() except that the size parameter, n,
30 specifies the size of the output buffer.
31
32 BIO_vsnprintf() is to BIO_snprintf() as BIO_vprintf() is to
33 BIO_printf().
34
36 All functions return the number of bytes written, or -1 on error. For
37 BIO_snprintf() and BIO_vsnprintf() this includes when the output buffer
38 is too small.
39
41 Except when n is 0, both BIO_snprintf() and BIO_vsnprintf() always
42 terminate their output with '\0'. This includes cases where -1 is
43 returned, such as when there is insufficient space to output the whole
44 string.
45
47 Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
48
49 Licensed under the Apache License 2.0 (the "License"). You may not use
50 this file except in compliance with the License. You can obtain a copy
51 in the file LICENSE in the source distribution or at
52 <https://www.openssl.org/source/license.html>.
53
54
55
563.0.9 2023-07-27 BIO_PRINTF(3ossl)