OPENSSL_FILE(3ossl)
π 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 π ifOPENSSL_NO_FILENAMESis defined, they instead yield""and0, 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 π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms