1LIBXO(3)                 BSD Library Functions Manual                 LIBXO(3)
2

NAME

4     xo_emit_err, xo_emit_errc, xo_emit_errx xo_emit_warn, xo_emit_warnx,
5     xo_emit_warn_c, xo_emit_warn_hc — emit errors and warnings in multiple
6     output styles
7

LIBRARY

9     library “libxo”
10

SYNOPSIS

12     #include <libxo/xo.h>
13
14     void
15     xo_emit_warn(const char *fmt, ...);
16
17     void
18     xo_emit_warnx(const char *fmt, ...);
19
20     void
21     xo_emit_warn_c(int code, const char *fmt, ...);
22
23     void
24     xo_emit_warn_hc(xo_handle_t *xop, int code, const char *fmt, ...);
25
26     void
27     xo_emit_err(int eval, const char *fmt, ...);
28
29     void
30     xo_emit_errc(int eval, int code, const char *fmt, ...);
31
32     void
33     xo_emit_errx(int eval, const char *fmt, ...);
34

DESCRIPTION

36     Many programs make use of the standard library functions err(3) and
37     warn(3) to generate errors and warnings for the user.  libxo wants to
38     pass that information via the current output style, and provides compati‐
39     ble functions to allow this.
40
41     The fmt argument is one compatible with xo_emit(3) which allows these
42     functions make structured data.  To generate unstructured data, use the
43     xo_err(3) functions.
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

SEE ALSO

54     xo_emit(3), xo_format(5), xo_err(3), libxo(3)
55

HISTORY

57     The libxo library first appeared in FreeBSD 11.0.
58

AUTHORS

60     libxo was written by Phil Shafer <phil@freebsd.org>.
61
62

ADDITIONAL DOCUMENTATION

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

HISTORY

78     The libxo library was added in FreeBSD 11.0.
79

AUTHOR

81     Phil Shafer
82
83BSD                            December 4, 2014                            BSD
Impressum