Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
LIBXO(3)		 BSD Library Functions Manual		      LIBXO(3)

NAME
     xo_err, xo_errc, xo_errx xo_warn, xo_warnx, xo_warn_c, xo_warn_hc -- emit
     errors and	warnings in multiple output styles

LIBRARY
     library "libxo"

SYNOPSIS
     #include <libxo/xo.h>

     void
     xo_warn(const char	*fmt, ...);

     void
     xo_warnx(const char *fmt, ...);

     void
     xo_warn_c(int code, const char *fmt, ...);

     void
     xo_warn_hc(xo_handle_t *xop, int code, const char *fmt, ...);

     void
     xo_err(int	eval, const char *fmt, ...);

     void
     xo_errc(int eval, int code, const char *fmt, ...);

     void
     xo_errx(int eval, const char *fmt,	...);

DESCRIPTION
     Many programs make	use of the standard library functions err(3) and
     warn(3) to	generate errors	and warnings for the user.  libxo wants	to
     pass that information via the current output style, and provides compati-
     ble functions to allow this.

     The fmt argument is one compatible	with printf(3) rather than xo_emit(3)
     to	aid in simple conversion.  This	means these functions make unstruc-
     tured data.  To generate structured data, use the xo_emit_err(3) func-
     tions.

     These functions display the program name, a colon,	a formatted message
     based on the arguments, and then optionally a colon and an	error message
     associated	with either errno or the code parameter.

	       EXAMPLE:
		   if (open(filename, O_RDONLY)	< 0)
		       xo_err(1, "cannot open file '%s'", filename);

SEE ALSO
     xo_emit(3), xo_emit_err(3), libxo(3)

HISTORY
     The libxo library first appeared in FreeBSD 11.0.

AUTHORS
     libxo was written by Phil Shafer <phil@freebsd.org>.

BSD			       December	4, 2014				   BSD

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | SEE ALSO | HISTORY | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=xo_err&sektion=3&manpath=FreeBSD+11.2-RELEASE+and+Ports>

home | help