LIBXO(3)
okay so bestie, you're reading LIBXO(3) from the Library Functions Manual, and it's literally giving βemit errors and warnings in multiple output styles.β no cap, that's the whole vibe. π
β¨ NAME β¨
The stars of this page are xo_emit_err, xo_emit_errc, xo_emit_errx, xo_emit_warn, xo_emit_warnx, xo_emit_warn_c, and xo_emit_warn_hc β and their whole thing is emitting errors and warnings in multiple output styles. periodt. π
π LIBRARY π
the library is literally βlibxoβ. π«Ά
π§ 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 π¬
Many programs make use of the standard library functions err(3) and warn(3) to generate errors and warnings for the user. libxo wants to pass that information via the current output style, and it provides compatible functions to allow this. slay. β¨
The fmt argument is one compatible with xo_emit(3) which allows these functions make structured data. To generate unstructured data, use the xo_err(3) functions. π¦
These functions display the program name, a colon, a formatted message based on the arguments, and then optionally a colon and an error message associated with either errno or the code parameter. okay so that's the whole sentence but it's important: program name, colon, formatted message, optional colon, error message from errno or code. π
π EXAMPLE π
if (open(filename, O_RDONLY) < 0)
xo_err(1, "cannot open file '%s'", filename);
π SEE ALSO π
Go look at these too, bestie: xo_emit(3), xo_format(5), xo_err(3), libxo(3). π
π°οΈ HISTORY π°οΈ
The libxo library first appeared in FreeBSD 11.0. iconic. π
π AUTHORS π
libxo was written by Phil Shafer <phil@freebsd.org>. π«Ά
and that's the whole page, bestie β this edition is from Debian, dated December 4, 2014, and it's LIBXO(3) all the way down. π
β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2014, Juniper Networks, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms