LIBXO(3)

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

✨ LIBXO β€” the libxo(3) page, bestie edition ✨

okay so this is the manual for libxo, a whole Library Functions Manual situation, and we're talking about the little squad of functions that go πŸ‘‡

xo_emit_err, xo_emit_errc, xo_emit_errx xo_emit_warn, xo_emit_warnx, xo_emit_warn_c, xo_emit_warn_hc β€” they emit errors and warnings in multiple output styles 🫢


πŸ“š LIBRARY

the library is literally called β€œlibxo”. that's it. that's the vibe. πŸ’…


✨ SYNOPSIS ✨

#include <libxo/xo.h>

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

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

void
xo_emit_warn_c(int code, const char *fmt, ...);

void
xo_emit_warn_hc(xo_handle_t *xop, int code, const char *fmt, ...);

void
xo_emit_err(int eval, const char *fmt, ...);

void
xo_emit_errc(int eval, int code, const char *fmt, ...);

void
xo_emit_errx(int eval, const char *fmt, ...);

πŸ’– DESCRIPTION πŸ’–

so. many programs out here are using the standard library girlies err(3) and warn(3) to spit out errors and warnings for the user, right? and libxo is like "bestie i want that info delivered through the current output style" so it hands you these compatible functions to make that happen. iconic behavior, no notes. πŸŽ€

the fmt argument is one that's compatible with xo_emit(3), which is the whole reason these functions can make structured data. and if what you want is unstructured data instead? go use the xo_err(3) functions. different lane, same energy. πŸ¦‹

here's what these functions actually put on the screen: the program name, then a colon, then a formatted message based on the arguments, and then optionally another colon plus an error message that's associated with either errno or the code parameter. periodt. πŸ‘‘

EXAMPLE: c if (open(filename, O_RDONLY) < 0) xo_err(1, "cannot open file '%s'", filename);

🌸 SEE ALSO 🌸


πŸ•°οΈ HISTORY πŸ•°οΈ

the libxo library first appeared in FreeBSD 11.0. a legend was born, fr fr. ⭐


πŸ‘‘ AUTHORS πŸ‘‘

libxo was written by Phil Shafer <phil@freebsd.org>. ty for your service king πŸ«‘πŸ’œ


πŸ“– ADDITIONAL DOCUMENTATION πŸ“–

FreeBSD uses libxo version 1.7.5. and the 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

and the latest release of libxo is available at:

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

like, all the lore is right there bestie, go read it 🧚✨


πŸ•°οΈ HISTORY (yes, again, she said it twice) πŸ•°οΈ

the libxo library was added in FreeBSD 11.0. same fact, second outfit. πŸ’…


✍️ AUTHOR ✍️

Phil Shafer


aaaaaand that's the whole page!! πŸ“ this version came to you from Debian, dated December 4, 2014. stay slaying, stay structured, and don't forget your colons πŸ’–πŸŒˆπŸŽ€
πŸ“¦ where this page comes from