]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libxo/libxo/xo_err.3
Merge ACPICA 20150619.
[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 December 4, 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 .Nm 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
56 .Fa errno
57 or the
58 .Fa code
59 parameter.
60 .Bd -literal -offset indent
61     EXAMPLE:
62         if (open(filename, O_RDONLY) < 0)
63             xo_err(1, "cannot open file '%s'", filename);
64 .Ed
65 .Sh ADDITIONAL DOCUMENTATION
66 Complete documentation can be found on github:
67 .Bd -literal -offset indent
68 http://juniper.github.io/libxo/libxo-manual.html
69 .Ed
70 .Pp
71 .Nm libxo
72 lives on github as:
73 .Bd -literal -offset indent
74 https://github.com/Juniper/libxo
75 .Ed
76 .Pp
77 The latest release of
78 .Nm libxo
79 is available at:
80 .Bd -literal -offset indent
81 https://github.com/Juniper/libxo/releases
82 .Ed
83 .Sh SEE ALSO
84 .Xr xo_emit 3
85 .Sh HISTORY
86 The
87 .Nm libxo
88 library was added in
89 .Fx 11.0 .
90 .Sh AUTHOR
91 Phil Shafer