<commit_before>.\" #
.\" # Copyright (c) 2014, Juniper Networks, Inc.
.\" # All rights reserved.
.\" # This SOFTWARE is licensed under the LICENSE provided in the
.\" # ../Copyright file. By downloading, installing, copying, or 
.\" # using the SOFTWARE, you agree to be bound by the terms of that
.\" # LICENSE.
.\" # <NAME>, July 2014
.\" 
.Dd December 4, 2014
.Dt LIBXO 3
.Os
.Sh NAME
.Nm xo_err , xo_errc , xo_errx
.Nm xo_warn , xo_warnx , xo_warn_c , xo_warn_hc
.Nd emit errors and warnings in multiple output styles
.Sh LIBRARY
.Lb libxo
.Sh SYNOPSIS
.In libxo/xo.h
.Ft void
.Fn xo_warn "const char *fmt"  "..."
.Ft void
.Fn xo_warnx "const char *fmt" "..."
.Ft void
.Fn xo_warn_c "int code" "const char *fmt" "..."
.Ft void
.Fn xo_warn_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
.Ft void
.Fn xo_err "int eval" "const char *fmt" "..."
.Ft void
.Fn xo_errc "int eval" "int code" "const char *fmt" "..."
.Ft void
.Fn xo_errx "int eval" "const char *fmt" "..."
.Sh DESCRIPTION
Many programs make use of the standard library functions
.Xr err 3
and
.Xr warn 3
to generate errors and warnings for the user.
.Nm libxo
wants to
pass that information via the current output style, and provides
compatible functions to allow this.
.Pp
The
.Fa fmt
argument is one compatible with
.Xr printf 3
rather than
.Xr xo_emit 3
to aid in simple conversion.  This means
these functions make unstructured data.
To generate structured data,
use the
.Xr xo_emit_err 3
functions.
.Pp
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
.Fa errno
or the
.Fa code
parameter.
.Bd -literal -offset indent
    EXAMPLE:
        if (open(filename, O_RDONLY) < 0)
            xo_err(1, "cannot open file '%s'", filename);
.Ed
.Sh SEE ALSO
.Xr xo_emit 3 ,
.Xr xo_emit_err 3 ,
.Xr libxo 3<commit_msg>add HISTORY/AUTHORS section<commit_after>.\" #
.\" # Copyright (c) 2014, Juniper Networks, Inc.
.\" # All rights reserved.
.\" # This SOFTWARE is licensed under the LICENSE provided in the
.\" # ../Copyright file. By downloading, installing, copying, or 
.\" # using the SOFTWARE, you agree to be bound by the terms of that
.\" # LICENSE.
.\" # <NAME>, July 2014
.\" 
.Dd December 4, 2014
.Dt LIBXO 3
.Os
.Sh NAME
.Nm xo_err , xo_errc , xo_errx
.Nm xo_warn , xo_warnx , xo_warn_c , xo_warn_hc
.Nd emit errors and warnings in multiple output styles
.Sh LIBRARY
.Lb libxo
.Sh SYNOPSIS
.In libxo/xo.h
.Ft void
.Fn xo_warn "const char *fmt"  "..."
.Ft void
.Fn xo_warnx "const char *fmt" "..."
.Ft void
.Fn xo_warn_c "int code" "const char *fmt" "..."
.Ft void
.Fn xo_warn_hc "xo_handle_t *xop" "int code, const char *fmt" "..."
.Ft void
.Fn xo_err "int eval" "const char *fmt" "..."
.Ft void
.Fn xo_errc "int eval" "int code" "const char *fmt" "..."
.Ft void
.Fn xo_errx "int eval" "const char *fmt" "..."
.Sh DESCRIPTION
Many programs make use of the standard library functions
.Xr err 3
and
.Xr warn 3
to generate errors and warnings for the user.
.Nm libxo
wants to
pass that information via the current output style, and provides
compatible functions to allow this.
.Pp
The
.Fa fmt
argument is one compatible with
.Xr printf 3
rather than
.Xr xo_emit 3
to aid in simple conversion.  This means
these functions make unstructured data.
To generate structured data,
use the
.Xr xo_emit_err 3
functions.
.Pp
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
.Fa errno
or the
.Fa code
parameter.
.Bd -literal -offset indent
    EXAMPLE:
        if (open(filename, O_RDONLY) < 0)
            xo_err(1, "cannot open file '%s'", filename);
.Ed
.Sh SEE ALSO
.Xr xo_emit 3 ,
.Xr xo_emit_err 3 ,
.Xr libxo 3
.Sh HISTORY
The
.Nm libxo
library first appeared in
.Fx 11.0 .
.Sh AUTHORS
.Nm libxo
was written by
.An <NAME> Mt <EMAIL> .

{'fraction_non_alphanumeric': 0.10967250571210967, 'fraction_numerical': 0.012947448591012947, 'mean_word_length': 3.227467811158798, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3896176', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1408, 'n_words': 605}