xref: /freebsd/contrib/libxo/libxo/xo_set_style.3 (revision c697fb7f)
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_set_style , xo_set_style_name
15.Nd set the output style for a libxo handle
16.Sh LIBRARY
17.Lb libxo
18.Sh SYNOPSIS
19.In libxo/xo.h
20.Ft void
21.Fn xo_set_style "xo_handle_t *handle" "unsigned style"
22.Ft int
23.Fn xo_set_style_name "xo_handle_t *handle" "const char *style"
24.Sh DESCRIPTION
25Use the
26.Fn xo_set_style
27function to set the output style for a handle.
28To use the default handle, pass a
29.Dv NULL
30handle.
31The set of output styles used by
32.Nm libxo
33is:
34.Bl -column "XO_STYLE_TEXT12"
35.It Sy "Flag          Description"
36.It "XO_STYLE_TEXT  Traditional text output"
37.It "XO_STYLE_XML   XML encoded data"
38.It "XO_STYLE_JSON  JSON encoded data"
39.It "XO_STYLE_HTML  HTML encoded data"
40.El
41.Pp
42The
43.Fn xo_set_style_name
44function can be used to set the style based on a name
45encoded as a string.
46The name can be any of the styles: "text", "xml", "json", or "html".
47.Bd -literal -offset indent
48    EXAMPLE:
49        xo_set_style_name(NULL, "html");
50.Ed
51.Sh SEE ALSO
52.Xr xo_emit 3 ,
53.Xr libxo 3
54.Sh HISTORY
55The
56.Nm libxo
57library first appeared in
58.Fx 11.0 .
59.Sh AUTHORS
60.Nm libxo
61was written by
62.An Phil Shafer Aq Mt phil@freebsd.org .
63
64