BIO_F_PREFIX(3SSL)

πŸ’– BIO_F_PREFIX πŸ’–

okay bestie, so this is the OpenSSL manual page for BIO_F_PREFIX, and it's literally all about making your text output look cute and organized. Prefix filter energy, no cap. ✨


🌸 NAME 🌸

BIO_f_prefix, BIO_set_prefix, BIO_set_indent, BIO_get_indent β€” the prefix BIO filter, aka the thing that makes your lines look all tidy and put-together πŸ’…


🌈 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 πŸ¦‹

BIO_f_cipher() returns the prefix BIO method. bestie, this one is a filter for text output, and its whole vibe is that every single line gets automatically prefixed and indented based on what you asked for. automatic main character formatting. πŸ‘‘

The prefix and the indentation get combined, okay? So for each line of output going through this filter, here's the order of operations, and it's giving assembly line:

  1. the prefix gets output first,
  2. then the amount of extra spaces indicated by the indentation,
  3. and then the line itself.

By default there is no prefix, and indentation is set to 0. so it's lowkey doing nothing until you tell it to. πŸ™ˆ

BIO_set_prefix() sets the prefix to be used for future lines of text, using prefix. prefix may be NULL, which signifies that there should be no prefix. If prefix isn't NULL, this function makes a copy of it β€” so you don't have to worry about your string wandering off, she keeps her own. 🫢

BIO_set_indent() sets the indentation to be used for future lines of text, using indent. Negative values are not allowed. 🚫

BIO_get_indent() gets the current indentation. simple. iconic.


⭐ NOTES ⭐

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.
  • 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.
  • BIO_get_indent() returns the current indentation, or a negative value for failure.

so like, check your return values bestie, don't just yolo it. 😭


πŸ”₯ SEE ALSO πŸ”₯


✨ HISTORY ✨

BIO_get_indent(), BIO_set_indent(), BIO_set_prefix() were added in OpenSSL 3.0. so they're not ancient, they're just well-adjusted. 🌸


Copyright 2019-2025 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>.


and that's the whole page, bestie!! 🫢 this was the BIO_F_PREFIX(3SSL) page from the OpenSSL fam, version 4.0.3, dated 2026-09-29. go forth and indent responsibly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from