]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libxo/libxo/xo_err.3
Update mandoc to 1.13.1
[FreeBSD/FreeBSD.git] / contrib / libxo / libxo / xo_err.3
1 .\" #
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
7 .\" # LICENSE.
8 .\" # Phil Shafer, July 2014
9 .\" 
10 .Dd July, 2014
11 .Dt LIBXO 3
12 .Os
13 .Sh NAME
14 .Nm xo_err
15 .Nd emit errors and warnings in multiple formats
16 .Sh LIBRARY
17 .Lb libxo
18 .Sh SYNOPSIS
19 .In libxo/xo.h
20 .Ft void
21 .Fn xo_warn "const char *fmt"  "..."
22 .Ft void
23 .Fn xo_warnx "const char *fmt" "..."
24 .Ft void
25 .Fn xo_warn_c "int code" "const char *fmt" "..."
26 .Ft void
27 .Fn xo_warn_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
28 .Ft void
29 .Fn xo_err "int eval" "const char *fmt" "..."
30 .Ft void
31 .Fn xo_errc "int eval" "int code" "const char *fmt" "..."
32 .Ft void
33 .Fn xo_errx "int eval" "const char *fmt" "..."
34 .Ft void
35 .Fn xo_message "const char *fmt" "..."
36 .Ft void
37 .Fn xo_message_c "int code" "const char *fmt" "..."
38 .Ft void
39 .Fn xo_message_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
40 .Ft void
41 .Fn xo_message_hcv "xo_handle_t *xop" "int code" "const char *fmt" "va_list vap"
42 .Sh DESCRIPTION
43 Many programs make use of the standard library functions
44 .Xr err 3
45 and
46 .Xr warn 3
47 to generate errors and warnings for the user.
48 .Em libxo
49 wants to
50 pass that information via the current output style, and provides
51 compatible functions to allow this.
52 .Pp
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
57     EXAMPLE:
58         if (open(filename, O_RDONLY) < 0)
59             xo_err(1, "cannot open file '%s'", filename);
60 .Ed
61 .Sh ADDITIONAL DOCUMENTATION
62 .Pp
63 Complete documentation can be found on github:
64 .Bd -literal -offset indent
65 http://juniper.github.io/libxo/libxo-manual.html
66 .Ed
67 .Pp
68 libxo lives on github as:
69 .Bd -literal -offset indent
70 https://github.com/Juniper/libxo
71 .Ed
72 .Pp
73 The latest release of libxo is available at:
74 .Bd -literal -offset indent
75 https://github.com/Juniper/libxo/releases
76 .Ed
77 .Sh SEE ALSO
78 .Xr xo_emit 3
79 .Sh HISTORY
80 The
81 .Fa libxo
82 library was added in FreeBSD 11.0.
83 .Sh AUTHOR
84 Phil Shafer