BIO_printf.pod 1.8 KB

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