BIO_F_PREFIX(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

🌸 NAME 🌸

okay so this page is from the OpenSSL manual (that's the 3ossl fam, iykyk) and it's all about the prefix BIO filter, bestie. We're covering BIO_f_prefix, BIO_set_prefix, BIO_set_indent, and BIO_get_indent β€” the whole little squad. πŸ’…

✨ 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 πŸ’–

So BIO_f_cipher() returns the prefix BIO method. (No bc I did not mistype that β€” that's literally what the page says, don't come for me πŸ™ˆ.) Anyway, it's a filter for text output, where every single line gets automatically prefixed and indented based on what the user asked for. Iconic behaviour honestly.

The prefix and the indentation get combined. For each line of output that goes through this filter, here's the order, no cap:

  1. the prefix comes out first
  2. then the amount of extra spaces indicated by the indentation
  3. then the line itself

By default there's no prefix, and the indentation is set to 0. Clean slate energy. ✨

BIO_set_prefix() sets the prefix to be used for future lines of text, using prefix. prefix may be NULL, which means "no prefix, we're going bare." If prefix isn't NULL, this function makes a copy of it β€” it's not borrowing yours, it's making its own. 🫢

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

BIO_get_indent() gets the current indentation. That's it, that's the whole job.

πŸ¦‹ NOTES πŸ¦‹

BIO_set_prefix(), BIO_set_indent() and BIO_get_indent() are implemented as macros. Just so you know what you're dealing with, bestie. πŸ’€

πŸŽ€ 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.
fr fr check those return values, because <=0 means something went wrong and negative means failure on the getter. vibe check your results, always. πŸ“

πŸ‘‘ SEE ALSO πŸ‘‘

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>.


okay bye bestie, that's the whole thing β€” this was OpenSSL 3.5.0, dated 2026-09-25, the BIO_F_PREFIX(3ossl) page, and it ate, ngl. πŸ’œπŸ§š

πŸ“¦ where this page comes from