2 .\" # Copyright (c) 2014, Juniper Networks, Inc.
3 .\" # All rights reserved.
4 .\" # This SOFTWARE is licensed under the LICENSE provided in the
5 .\" # ../Copyright file. By downloading, installing, copying, or
6 .\" # using the SOFTWARE, you agree to be bound by the terms of that
8 .\" # Phil Shafer, July 2014
15 .Nd emit errors and warnings in multiple formats
21 .Fn xo_warn "const char *fmt" "..."
23 .Fn xo_warnx "const char *fmt" "..."
25 .Fn xo_warn_c "int code" "const char *fmt" "..."
27 .Fn xo_warn_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
29 .Fn xo_err "int eval" "const char *fmt" "..."
31 .Fn xo_errc "int eval" "int code" "const char *fmt" "..."
33 .Fn xo_errx "int eval" "const char *fmt" "..."
35 .Fn xo_message "const char *fmt" "..."
37 .Fn xo_message_c "int code" "const char *fmt" "..."
39 .Fn xo_message_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
41 .Fn xo_message_hcv "xo_handle_t *xop" "int code" "const char *fmt" "va_list vap"
43 Many programs make use of the standard library functions
47 to generate errors and warnings for the user.
50 pass that information via the current output style, and provides
51 compatible functions to allow this.
53 These functions display the program name, a colon, a formatted message
54 based on the arguments, and then optionally a colon and an error
55 message associated with either "errno" or the "code" parameter.
56 .Bd -literal -offset indent
58 if (open(filename, O_RDONLY) < 0)
59 xo_err(1, "cannot open file '%s'", filename);
61 .Sh ADDITIONAL DOCUMENTATION
63 Complete documentation can be found on github:
64 .Bd -literal -offset indent
65 http://juniper.github.io/libxo/libxo-manual.html
68 libxo lives on github as:
69 .Bd -literal -offset indent
70 https://github.com/Juniper/libxo
73 The latest release of libxo is available at:
74 .Bd -literal -offset indent
75 https://github.com/Juniper/libxo/releases
82 library was added in FreeBSD 11.0.