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