LIBXO(3)

πŸ“¦
version 1.7.5 Β· 2 versions
, in epel 9, fedora 43, fedora 44, nixpkgs unstable

πŸ’– LIBXO(3) β€” the libxo manual, but make it a group chat πŸ’–

okay bestie, so this is the LIBXO(3) page from the Library Functions Manual, and today's main character is xo_error. she's tiny, she's iconic, and she just wants to tell your users something went wrong. let's go πŸ’…


🌸 NAME 🌸

xo_error β€” generate simple error messages in multiple output styles

like. the whole vibe is: error messages, but make them ✨portable✨ across output styles.


πŸ“š LIBRARY πŸ“š

library β€œlibxo”

that's the one you're linking against, no cap.


✨ SYNOPSIS ✨

#include <libxo/xo.h>

void
xo_error(const char *fmt, ...);

that's it. that's the whole API. she's giving minimal, she's giving void, she's giving varargs 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: use the xo_error() function to generate error messages to standard error. that's stderr, bestie, the classic one. πŸ’€

the fmt argument is a string containing printf-style formatting instructions that describe the remaining arguments. so literally, you hand her a format string, she hand-waves the rest of the args into it. iykyk.

when converting an application to libxo, one can replace fprintf(stderr,...) calls with xo_error() calls.

not me swapping out every single fprintf(stderr,...) like it's a glow-up montage. that's the whole migration arc. periodt. πŸ‘‘

🌈 SEE ALSO 🌈

go read those next, they're the supporting cast and they ate. πŸ’œ


πŸŽ€ HISTORY πŸŽ€

the libxo library first appeared in FreeBSD 11.0. a legend was born. 🌟


πŸ‘‘ AUTHORS πŸ‘‘

libxo was written by Phil Shafer <phil@freebsd.org>. give him his flowers πŸ’


🌸 ADDITIONAL DOCUMENTATION 🌸

FreeBSD uses libxo version 1.7.5. complete documentation can be found on github:

https://juniper.github.io/libxo/1.7.5/html/index.html

libxo lives on github as:

https://github.com/Juniper/libxo

the latest release of libxo is available at:

https://github.com/Juniper/libxo/releases

three links, three chances to fall down a rabbit hole. obsessed, honestly. πŸ•³οΈπŸ‡


πŸ’œ HISTORY πŸ’œ

(yes, again β€” she said it twice and honestly? she's right.)

the libxo library was added in FreeBSD 11.0.


⭐ AUTHOR ⭐

Phil Shafer

(also stated twice. consistent queen. no notes. πŸ’…)


⚠️ real talk bestie: keep those fprintf(stderr,...) β†’ xo_error() swaps honest β€” the format string and the args go through exactly the same way, so don't get creative with them. 🫢

okay that's the whole page!! and for the lil sign-off β€” this beauty came from Debian, dated December 4, 2014, and it's filed under LIBXO(3) in the Library Functions Manual. slay, bye!! πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from