BIO_F_PREFIX(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… BIO_F_PREFIX β€” the prefix BIO filter (OpenSSL, man page 3ossl)

ok so bestie, welcome to the 3ossl girlies of the OpenSSL manual β€” this one is short, sweet, and lowkey iconic. buckle up πŸŽ€

✨ NAME ✨

BIO_f_prefix, BIO_set_prefix, BIO_set_indent, BIO_get_indent β€” it's giving prefix BIO filter, and yes that's the whole name section, she's concise πŸ’–

🌸 SYNOPSIS 🌸

#include <openssl/bio.h>

const BIO_METHOD *BIO_f_prefix(void);
long BIO_set_prefix(BIO *b, const char *prefix);
long BIO_set_indent(BIO *b, long indent);
long BIO_get_indent(BIO *b);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so BIO_f_prefix() returns the prefix BIO method. (yes, the page literally says BIO_f_cipher() right there in the description β€” not me, not my typo, I'm just the messenger πŸ™ˆ). Anyway β€” this is a filter for text output, where each line gets automatically prefixed and indented according to user input. main character filter behavior, honestly πŸ‘‘

The prefix and the indentation get combined, bestie. For every single line of output going through this filter, it goes down like this:

  1. the prefix gets output first 🌟
  2. then the amount of additional spaces indicated by the indentation
  3. then the line itself

By default there is no prefix, and indentation is set to 0. clean slate, no notes ✨

  • BIO_set_prefix() β€” sets the prefix to be used for future lines of text, using prefix. prefix may be NULL, signifying that there should be no prefix. And if prefix isn't NULL, this function makes a copy of it (she's not borrowing your hoodie, she's buying her own 🫢).
  • BIO_set_indent() β€” sets the indentation to be used for future lines of text, using indent. Negative values are not allowed. no cap, just don't πŸ’€
  • BIO_get_indent() β€” gets the current indentation. that's it, that's the whole job πŸ’…

⭐ NOTES ⭐

heads up, bestie: BIO_set_prefix(), BIO_set_indent() and BIO_get_indent() are implemented as macros. iykyk 🧚

πŸ”₯ RETURN VALUES πŸ”₯

  • BIO_f_prefix() returns the prefix BIO method. slay.
  • BIO_set_prefix() returns 1 if the prefix was correctly set, or <=0 on failure. πŸ“
  • BIO_set_indent() returns 1 if the prefix was correctly set, or <=0 on failure. (yes, still says "prefix" β€” copying the page faithfully, don't come for me 😭)
  • BIO_get_indent() returns the current indentation, or a negative value for failure. πŸ™ˆ
fr fr check your return values, a <=0 is not the vibe and you will be debugging at 2am wondering why your output looks cursed πŸ’€

🌈 SEE ALSO 🌈

  • bio(7) β€” go read her, she's the mother of all of this πŸ‘‘

Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


ok that's the whole page, you ate that 🫢 stay hydrated, read your man pages, and remember: prefix first, spaces second, line third, periodt πŸ’–

version 3.5.6 β€’ dated 2026-04-07 β€’ BIO_F_PREFIX(3ossl) β€’ mwah πŸ’‹

πŸ“¦ where this page comes from