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
14 .Nm xo_emit_err , xo_emit_errc , xo_emit_errx
15 .Nm xo_emit_warn , xo_emit_warnx , xo_emit_warn_c , xo_emit_warn_hc
16 .Nd emit errors and warnings in multiple output styles
22 .Fn xo_emit_warn "const char *fmt" "..."
24 .Fn xo_emit_warnx "const char *fmt" "..."
26 .Fn xo_emit_warn_c "int code" "const char *fmt" "..."
28 .Fn xo_emit_warn_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
30 .Fn xo_emit_err "int eval" "const char *fmt" "..."
32 .Fn xo_emit_errc "int eval" "int code" "const char *fmt" "..."
34 .Fn xo_emit_errx "int eval" "const char *fmt" "..."
36 Many programs make use of the standard library functions
40 to generate errors and warnings for the user.
43 pass that information via the current output style, and provides
44 compatible functions to allow this.
48 argument is one compatible with
50 which allows these functions make structured data.
51 To generate unstructured data,
56 These functions display the program name, a colon, a formatted message
57 based on the arguments, and then optionally a colon and an error
58 message associated with either
63 .Bd -literal -offset indent
65 if (open(filename, O_RDONLY) < 0)
66 xo_err(1, "cannot open file '%s'", filename);
76 library first appeared in
81 .An Phil Shafer Aq Mt phil@freebsd.org .