BIO_printf.pod 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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() always
  29. terminate their output with C<'\0'>. This includes cases where -1 is
  30. returned, such as when there is insufficient space to output the whole
  31. string.
  32. =head1 COPYRIGHT
  33. Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
  34. Licensed under the Apache License 2.0 (the "License"). You may not use
  35. this file except in compliance with the License. You can obtain a copy
  36. in the file LICENSE in the source distribution or at
  37. L<https://www.openssl.org/source/license.html>.
  38. =cut