1LIBXO(3) BSD Library Functions Manual LIBXO(3)
2
4 xo_err, xo_errc, xo_errx xo_warn, xo_warnx, xo_warn_c, xo_warn_hc — emit
5 errors and warnings in multiple output styles
6
8 library “libxo”
9
11 #include <libxo/xo.h>
12
13 void
14 xo_warn(const char *fmt, ...);
15
16 void
17 xo_warnx(const char *fmt, ...);
18
19 void
20 xo_warn_c(int code, const char *fmt, ...);
21
22 void
23 xo_warn_hc(xo_handle_t *xop, int code, const char *fmt, ...);
24
25 void
26 xo_err(int eval, const char *fmt, ...);
27
28 void
29 xo_errc(int eval, int code, const char *fmt, ...);
30
31 void
32 xo_errx(int eval, const char *fmt, ...);
33
35 Many programs make use of the standard library functions err(3) and
36 warn(3) to generate errors and warnings for the user. libxo wants to
37 pass that information via the current output style, and provides compati‐
38 ble functions to allow this.
39
40 The fmt argument is one compatible with printf(3) rather than xo_emit(3)
41 to aid in simple conversion. This means these functions make unstruc‐
42 tured data. To generate structured data, use the xo_emit_err(3) func‐
43 tions.
44
45 These functions display the program name, a colon, a formatted message
46 based on the arguments, and then optionally a colon and an error message
47 associated with either errno or the code parameter.
48
49 EXAMPLE:
50 if (open(filename, O_RDONLY) < 0)
51 xo_err(1, "cannot open file '%s'", filename);
52
54 xo_emit(3), xo_emit_err(3), libxo(3)
55
57 The libxo library first appeared in FreeBSD 11.0.
58
60 libxo was written by Phil Shafer <phil@freebsd.org>.
61
62
64 FreeBSD uses libxo version 1.6.0. Complete documentation can be found on
65 github:
66
67 https://juniper.github.io/libxo/1.6.0/html/index.html
68
69 libxo lives on github as:
70
71 https://github.com/Juniper/libxo
72
73 The latest release of libxo is available at:
74
75 https://github.com/Juniper/libxo/releases
76
78 The libxo library was added in FreeBSD 11.0.
79
81 Phil Shafer
82
83BSD December 4, 2014 BSD