]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libxo/libxo/xo_emit_err.3
Update to ELF Tool Chain r3668
[FreeBSD/FreeBSD.git] / contrib / libxo / libxo / xo_emit_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_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
17 .Sh LIBRARY
18 .Lb libxo
19 .Sh SYNOPSIS
20 .In libxo/xo.h
21 .Ft void
22 .Fn xo_emit_warn "const char *fmt"  "..."
23 .Ft void
24 .Fn xo_emit_warnx "const char *fmt" "..."
25 .Ft void
26 .Fn xo_emit_warn_c "int code" "const char *fmt" "..."
27 .Ft void
28 .Fn xo_emit_warn_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
29 .Ft void
30 .Fn xo_emit_err "int eval" "const char *fmt" "..."
31 .Ft void
32 .Fn xo_emit_errc "int eval" "int code" "const char *fmt" "..."
33 .Ft void
34 .Fn xo_emit_errx "int eval" "const char *fmt" "..."
35 .Sh DESCRIPTION
36 Many programs make use of the standard library functions
37 .Xr err 3
38 and
39 .Xr warn 3
40 to generate errors and warnings for the user.
41 .Nm libxo
42 wants to
43 pass that information via the current output style, and provides
44 compatible functions to allow this.
45 .Pp
46 The
47 .Fa fmt
48 argument is one compatible with
49 .Xr xo_emit 3
50 which allows these functions make structured data.
51 To generate unstructured data,
52 use the
53 .Xr xo_err 3
54 functions.
55 .Pp
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
59 .Fa errno
60 or the
61 .Fa code
62 parameter.
63 .Bd -literal -offset indent
64     EXAMPLE:
65         if (open(filename, O_RDONLY) < 0)
66             xo_err(1, "cannot open file '%s'", filename);
67 .Ed
68 .Sh SEE ALSO
69 .Xr xo_emit 3 ,
70 .Xr xo_format 5 ,
71 .Xr xo_err 3 ,
72 .Xr libxo 3
73 .Sh HISTORY
74 The
75 .Nm libxo
76 library first appeared in
77 .Fx 11.0 .
78 .Sh AUTHORS
79 .Nm libxo
80 was written by
81 .An Phil Shafer Aq Mt phil@freebsd.org .
82