OPENSSL_FILE(3ossl)

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

πŸ’… OPENSSL_FILE(3ossl) β€” like, the macro glow-up page

okay bestie, welcome to OPENSSL_FILE(3ossl), aka the page about a bunch of generic C programming utility macros from OpenSSL. They're small, they're cute, they're literally the plumbing behind nicer error messages. Let's get into it 🫢


✨ NAME ✨

OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC, OPENSSL_MSTR, OPENSSL_MSTR_HELPER β€” generic C programming utility macros. That's the whole squad, no cap πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/macros.h>

#define OPENSSL_FILE /* typically: __FILE__ */
#define OPENSSL_LINE /* typically: __LINE__ */
#define OPENSSL_FUNC /* typically: __func__ */

#define OPENSSL_MSTR_HELPER(x) #x
#define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)

Look at them, all lined up and thriving ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

So OPENSSL_FILE and OPENSSL_LINE are giving "where am I" energy β€” they typically yield the current filename and line number during C compilation. Iconic for debugging.

but wait πŸ‘€ if OPENSSL_NO_FILENAMES is defined, they instead yield "" and 0, respectively. Yes, an empty string and a literal zero. The vibes are muted on purpose.

The macro OPENSSL_FUNC attempts to yield the name of the C function currently being compiled, as far as language and compiler versions allow. Keyword: attempts πŸ™ˆ If it can't, it yields "(unknown function)". Respect the honesty honestly.

The macro OPENSSL_MSTR yields the expansion of the macro given as argument, which is useful for concatenation with string constants. And OPENSSL_MSTR_HELPER? That's the auxiliary macro for this purpose β€” the bestie behind the scenes doing the actual work, iykyk πŸ”₯


πŸŽ€ RETURN VALUES πŸŽ€

see above πŸ‘† literally, that's the whole thing. The macros are macros, they do their thing inline, periodt.


🧚 SEE ALSO 🧚

  • crypto(7) β€” go read it, bestie, it's the big one πŸ’œ

🌈 HISTORY 🌈

OPENSSL_FUNC, OPENSSL_MSTR, and OPENSSL_MSTR_HELPER were added in OpenSSL 3.0. So yeah, they're the newer kids on the block β€” but they ate and left no crumbs πŸ‘‘


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

fr fr, read the license before you go copying stuff, it's the law (well, the license) ⭐

and that's the page, bestie!! 🌸 this little rewrite was brought to you by OpenSSL 3.5.0, dated 2026-09-25 β€” mwah, go compile something pretty πŸ’–βœ¨πŸ’…

πŸ“¦ where this page comes from