1 =pod 2 3 =head1 NAME 4 5 BIO_printf, BIO_vprintf, BIO_snprintf, BIO_vsnprintf 6 - formatted output to a BIO 7 8 =head1 SYNOPSIS 9 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 18 =head1 DESCRIPTION 19 20 BIO_printf() is similar to the standard C printf() function, except that 21 the output is sent to the specified BIO, I<bio>, rather than standard 22 output. All common format specifiers are supported. 23 24 BIO_vprintf() is similar to the vprintf() function found on many platforms, 25 the output is sent to the specified BIO, I<bio>, rather than standard 26 output. All common format specifiers are supported. The argument 27 list I<args> is a stdarg argument list. 28 29 BIO_snprintf() is for platforms that do not have the common snprintf() 30 function. It is like sprintf() except that the size parameter, I<n>, 31 specifies the size of the output buffer. 32 33 BIO_vsnprintf() is to BIO_snprintf() as BIO_vprintf() is to BIO_printf(). 34 35 =head1 RETURN VALUES 36 37 All functions return the number of bytes written, or -1 on error. 38 For BIO_snprintf() and BIO_vsnprintf() this includes when the output 39 buffer is too small. 40 41 =head1 NOTES 42 43 Except when I<n> is 0, both BIO_snprintf() and BIO_vsnprintf() always 44 terminate their output with C<'\0'>. This includes cases where -1 is 45 returned, such as when there is insufficient space to output the whole 46 string. 47 48 =head1 COPYRIGHT 49 50 Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved. 51 52 Licensed under the Apache License 2.0 (the "License"). You may not use 53 this file except in compliance with the License. You can obtain a copy 54 in the file LICENSE in the source distribution or at 55 L<https://www.openssl.org/source/license.html>. 56 57 =cut 58