Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2018 01:12:17 +0000 (UTC)
From:      Phil Shafer <phil@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r334066 - in vendor/Juniper/libxo/dist: . doc doc/_static doc/_templates libxo tests/core tests/core/saved tests/gettext/saved
Message-ID:  <201805230112.w4N1CHNO068756@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: phil
Date: Wed May 23 01:12:17 2018
New Revision: 334066
URL: https://svnweb.freebsd.org/changeset/base/334066

Log:
  Import libxo 0.9.0

Added:
  vendor/Juniper/libxo/dist/doc/_static/
  vendor/Juniper/libxo/dist/doc/_static/basic.css_t
  vendor/Juniper/libxo/dist/doc/_templates/
  vendor/Juniper/libxo/dist/doc/_templates/localtoc.html   (contents, props changed)
  vendor/Juniper/libxo/dist/doc/api.rst
  vendor/Juniper/libxo/dist/doc/conf.py   (contents, props changed)
  vendor/Juniper/libxo/dist/doc/example.rst
  vendor/Juniper/libxo/dist/doc/faq.rst
  vendor/Juniper/libxo/dist/doc/field-formatting.rst
  vendor/Juniper/libxo/dist/doc/field-modifiers.rst
  vendor/Juniper/libxo/dist/doc/field-roles.rst
  vendor/Juniper/libxo/dist/doc/format-strings.rst
  vendor/Juniper/libxo/dist/doc/formatting.rst
  vendor/Juniper/libxo/dist/doc/getting.rst
  vendor/Juniper/libxo/dist/doc/howto.rst
  vendor/Juniper/libxo/dist/doc/index.rst
  vendor/Juniper/libxo/dist/doc/intro.rst
  vendor/Juniper/libxo/dist/doc/options.rst
  vendor/Juniper/libxo/dist/doc/xo.rst
  vendor/Juniper/libxo/dist/doc/xohtml.rst
  vendor/Juniper/libxo/dist/doc/xolint.rst
  vendor/Juniper/libxo/dist/doc/xopo.rst
Modified:
  vendor/Juniper/libxo/dist/configure.ac
  vendor/Juniper/libxo/dist/doc/Makefile.am
  vendor/Juniper/libxo/dist/doc/libxo-manual.html
  vendor/Juniper/libxo/dist/libxo/libxo.c
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_12.J.out
  vendor/Juniper/libxo/dist/tests/core/saved/test_12.JP.out
  vendor/Juniper/libxo/dist/tests/core/test_01.c
  vendor/Juniper/libxo/dist/tests/gettext/saved/gt_01.J.out
  vendor/Juniper/libxo/dist/tests/gettext/saved/gt_01.JP.out

Modified: vendor/Juniper/libxo/dist/configure.ac
==============================================================================
--- vendor/Juniper/libxo/dist/configure.ac	Tue May 22 22:16:49 2018	(r334065)
+++ vendor/Juniper/libxo/dist/configure.ac	Wed May 23 01:12:17 2018	(r334066)
@@ -12,7 +12,7 @@
 #
 
 AC_PREREQ(2.2)
-AC_INIT([libxo], [0.8.4], [phil@juniper.net])
+AC_INIT([libxo], [0.9.0], [phil@juniper.net])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
 
 # Support silent build rules.  Requires at least automake-1.11.

Modified: vendor/Juniper/libxo/dist/doc/Makefile.am
==============================================================================
--- vendor/Juniper/libxo/dist/doc/Makefile.am	Tue May 22 22:16:49 2018	(r334065)
+++ vendor/Juniper/libxo/dist/doc/Makefile.am	Wed May 23 01:12:17 2018	(r334066)
@@ -68,3 +68,8 @@ else
 doc docs:
 	@${ECHO} "The 'oxtradoc' tool is not installed; see libslax.org"
 endif
+
+SPHINX = python3.4 -msphinx
+
+html sphinx sphinx-html:
+	${SPHINX} -M html ${srcdir} .

Added: vendor/Juniper/libxo/dist/doc/_static/basic.css_t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/Juniper/libxo/dist/doc/_static/basic.css_t	Wed May 23 01:12:17 2018	(r334066)
@@ -0,0 +1,657 @@
+/*
+ * basic.css
+ * ~~~~~~~~~
+ *
+ * Sphinx stylesheet -- basic theme.
+ *
+ * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/* -- main layout ----------------------------------------------------------- */
+
+div.clearer {
+    clear: both;
+}
+
+/* -- relbar ---------------------------------------------------------------- */
+
+div.related {
+    width: 100%;
+    font-size: 90%;
+}
+
+div.related h3 {
+    display: none;
+}
+
+div.related ul {
+    margin: 0;
+    padding: 0 0 0 10px;
+    list-style: none;
+}
+
+div.related li {
+    display: inline;
+}
+
+div.related li.right {
+    float: right;
+    margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- */
+
+div.sphinxsidebarwrapper {
+    padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+    float: left;
+    width: {{ theme_sidebarwidth|toint }}px;
+    margin-left: -100%;
+    font-size: 90%;
+    word-wrap: break-word;
+    overflow-wrap : break-word;
+}
+
+div.sphinxsidebar ul {
+    list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+    margin-left: 20px;
+    list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+    margin-top: 0;
+    margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+    margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+    border: 1px solid #98dbcc;
+    font-family: sans-serif;
+    font-size: 1em;
+}
+
+div.sphinxsidebar #searchbox input[type="text"] {
+    width: 170px;
+}
+
+img {
+    border: 0;
+    max-width: 100%;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+    margin: 10px 0 0 20px;
+    padding: 0;
+}
+
+ul.search li {
+    padding: 5px 0 5px 20px;
+    background-image: url(file.png);
+    background-repeat: no-repeat;
+    background-position: 0 7px;
+}
+
+ul.search li a {
+    font-weight: bold;
+}
+
+ul.search li div.context {
+    color: #888;
+    margin: 2px 0 0 30px;
+    text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+    font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+    width: 90%;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+table.contentstable p.biglink {
+    line-height: 150%;
+}
+
+a.biglink {
+    font-size: 1.3em;
+}
+
+span.linkdescr {
+    font-style: italic;
+    padding-top: 5px;
+    font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable {
+    width: 100%;
+}
+
+table.indextable td {
+    text-align: left;
+    vertical-align: top;
+}
+
+table.indextable ul {
+    margin-top: 0;
+    margin-bottom: 0;
+    list-style-type: none;
+}
+
+table.indextable > tbody > tr > td > ul {
+    padding-left: 0em;
+}
+
+table.indextable tr.pcap {
+    height: 10px;
+}
+
+table.indextable tr.cap {
+    margin-top: 10px;
+    background-color: #f2f2f2;
+}
+
+img.toggler {
+    margin-right: 3px;
+    margin-top: 3px;
+    cursor: pointer;
+}
+
+div.modindex-jumpbox {
+    border-top: 1px solid #ddd;
+    border-bottom: 1px solid #ddd;
+    margin: 1em 0 1em 0;
+    padding: 0.4em;
+}
+
+div.genindex-jumpbox {
+    border-top: 1px solid #ddd;
+    border-bottom: 1px solid #ddd;
+    margin: 1em 0 1em 0;
+    padding: 0.4em;
+}
+
+/* -- domain module index --------------------------------------------------- */
+
+table.modindextable td {
+    padding: 2px;
+    border-collapse: collapse;
+}
+
+/* -- general body styles --------------------------------------------------- */
+
+div.body p, div.body dd, div.body li, div.body blockquote {
+    -moz-hyphens: auto;
+    -ms-hyphens: auto;
+    -webkit-hyphens: auto;
+    hyphens: auto;
+}
+
+a.headerlink {
+    visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink,
+caption:hover > a.headerlink,
+p.caption:hover > a.headerlink,
+div.code-block-caption:hover > a.headerlink {
+    visibility: visible;
+}
+
+div.body p.caption {
+    text-align: inherit;
+}
+
+div.body td {
+    text-align: left;
+}
+
+blockquote.epigraph p.attribution {
+    margin-left: 50%;
+}
+
+blockquote.epigraph {
+    background-color: #eee;
+    padding: 0.5em;
+}
+
+.first {
+    margin-top: 0 !important;
+}
+
+p.rubric {
+    margin-top: 30px;
+    font-weight: bold;
+}
+
+img.align-left, .figure.align-left, object.align-left {
+    clear: left;
+    float: left;
+    margin-right: 1em;
+}
+
+img.align-right, .figure.align-right, object.align-right {
+/*    clear: right; */
+    float: right;
+    margin-left: 1em;
+}
+
+img.align-center, .figure.align-center, object.align-center {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+.align-left {
+    text-align: left;
+}
+
+.align-center {
+    text-align: center;
+}
+
+.align-right {
+    text-align: right;
+}
+
+/* -- sidebars -------------------------------------------------------------- */
+
+div.sidebar {
+    margin: 1em 1em 1em 1em;
+    border: 1px solid #ddb;
+    padding: 7px 7px 0 7px;
+    background-color: #ffe;
+    width: 40%;
+    float: right;
+}
+
+p.sidebar-title {
+    font-weight: bold;
+}
+
+/* -- topics ---------------------------------------------------------------- */
+
+div.topic {
+    border: 1px solid #ccc;
+    padding: 7px 7px 0 7px;
+    margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+    font-size: 1.1em;
+    font-weight: bold;
+    margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- */
+
+div.admonition {
+    margin-top: 10px;
+    margin-bottom: 10px;
+    padding: 7px;
+}
+
+div.admonition dt {
+    font-weight: bold;
+}
+
+div.admonition dl {
+    margin-bottom: 0;
+}
+
+p.admonition-title {
+    margin: 0px 10px 5px 0px;
+    font-weight: bold;
+}
+
+div.body p.centered {
+    text-align: center;
+    margin-top: 25px;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+    border: 0;
+    border-collapse: collapse;
+}
+
+table caption span.caption-number {
+    font-style: italic;
+}
+
+table caption span.caption-text {
+}
+
+dl.function table.docutils th.field-name {
+  width: 100px;
+}
+
+table.docutils td, table.docutils th {
+    padding: 1px 8px 1px 5px;
+    border-top: 1px solid #aaa;
+    border-left: 1px solid #aaa;
+    border-right: 1px solid #aaa;
+    border-bottom: 1px solid #aaa;
+}
+
+table.docutils th {
+    border-bottom: 2px solid #aaa;
+    background-color: #f2f2f2;
+}
+
+table.footnote td, table.footnote th {
+    border: 0 !important;
+}
+
+th {
+    text-align: left;
+    padding-right: 5px;
+}
+
+table.citation {
+    border-left: solid 1px gray;
+    margin-left: 1px;
+}
+
+table.citation td {
+    border-bottom: none;
+}
+
+/* -- figures --------------------------------------------------------------- */
+
+div.figure {
+    margin: 0.5em;
+    padding: 0.5em;
+}
+
+div.figure p.caption {
+    padding: 0.3em;
+}
+
+div.figure p.caption span.caption-number {
+    font-style: italic;
+}
+
+div.figure p.caption span.caption-text {
+}
+
+/* -- field list styles ----------------------------------------------------- */
+
+table.field-list td, table.field-list th {
+    border: 0 !important;
+}
+
+.field-list ul {
+    margin: 0;
+    padding-left: 1em;
+}
+
+.field-list p {
+    margin: 0;
+}
+
+.field-name {
+    -moz-hyphens: manual;
+    -ms-hyphens: manual;
+    -webkit-hyphens: manual;
+    hyphens: manual;
+}
+
+/* -- other body styles ----------------------------------------------------- */
+
+ol.arabic {
+    list-style: decimal;
+}
+
+ol.loweralpha {
+    list-style: lower-alpha;
+}
+
+ol.upperalpha {
+    list-style: upper-alpha;
+}
+
+ol.lowerroman {
+    list-style: lower-roman;
+}
+
+ol.upperroman {
+    list-style: upper-roman;
+}
+
+dl {
+    margin-bottom: 15px;
+}
+
+dd p {
+    margin-top: 0px;
+}
+
+dd ul, dd table {
+    margin-bottom: 10px;
+}
+
+dd {
+    margin-top: 3px;
+    margin-bottom: 10px;
+    margin-left: 30px;
+}
+
+dt:target, .highlighted {
+    background-color: #fbe54e;
+}
+
+dl.glossary dt {
+    font-weight: bold;
+    font-size: 1.1em;
+}
+
+.optional {
+    font-size: 1.3em;
+}
+
+.sig-paren {
+    font-size: larger;
+}
+
+.versionmodified {
+    font-style: italic;
+}
+
+.system-message {
+    background-color: #fda;
+    padding: 5px;
+    border: 3px solid red;
+}
+
+.footnote:target  {
+    background-color: #ffa;
+}
+
+.line-block {
+    display: block;
+    margin-top: 1em;
+    margin-bottom: 1em;
+}
+
+.line-block .line-block {
+    margin-top: 0;
+    margin-bottom: 0;
+    margin-left: 1.5em;
+}
+
+.guilabel, .menuselection {
+    font-family: sans-serif;
+}
+
+.accelerator {
+    text-decoration: underline;
+}
+
+.classifier {
+    font-style: oblique;
+}
+
+abbr, acronym {
+    border-bottom: dotted 1px;
+    cursor: help;
+}
+
+/* -- code displays --------------------------------------------------------- */
+
+pre {
+    overflow: auto;
+    overflow-y: hidden;  /* fixes display issues on Chrome browsers */
+}
+
+span.pre {
+    -moz-hyphens: none;
+    -ms-hyphens: none;
+    -webkit-hyphens: none;
+    hyphens: none;
+}
+
+td.linenos pre {
+    padding: 5px 0px;
+    border: 0;
+    background-color: transparent;
+    color: #aaa;
+}
+
+table.highlighttable {
+    margin-left: 0.5em;
+}
+
+table.highlighttable td {
+    padding: 0 0.5em 0 0.5em;
+}
+
+div.code-block-caption {
+    padding: 2px 5px;
+    font-size: small;
+}
+
+div.code-block-caption code {
+    background-color: transparent;
+}
+
+div.code-block-caption + div > div.highlight > pre {
+    margin-top: 0;
+}
+
+div.code-block-caption span.caption-number {
+    padding: 0.1em 0.3em;
+    font-style: italic;
+}
+
+div.code-block-caption span.caption-text {
+}
+
+div.literal-block-wrapper {
+    padding: 1em 1em 0;
+}
+
+div.literal-block-wrapper div.highlight {
+    margin: 0;
+}
+
+code.descname {
+    background-color: transparent;
+    font-weight: bold;
+    font-size: 1.2em;
+}
+
+code.descclassname {
+    background-color: transparent;
+}
+
+code.xref, a code {
+    background-color: transparent;
+    font-weight: bold;
+}
+
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
+    background-color: transparent;
+}
+
+.viewcode-link {
+    float: right;
+}
+
+.viewcode-back {
+    float: right;
+    font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+    margin: -1px -10px;
+    padding: 0 10px;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+    vertical-align: middle;
+}
+
+div.body div.math p {
+    text-align: center;
+}
+
+span.eqno {
+    float: right;
+}
+
+span.eqno a.headerlink {
+    position: relative;
+    left: 0px;
+    z-index: 1;
+}
+
+div.math:hover a.headerlink {
+    visibility: visible;
+}
+
+/* -- printout stylesheet --------------------------------------------------- */
+
+@media print {
+    div.document,
+    div.documentwrapper,
+    div.bodywrapper {
+        margin: 0 !important;
+        width: 100%;
+    }
+
+    div.sphinxsidebar,
+    div.related,
+    div.footer,
+    #top-link {
+        display: none;
+    }
+}

Added: vendor/Juniper/libxo/dist/doc/_templates/localtoc.html
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/Juniper/libxo/dist/doc/_templates/localtoc.html	Wed May 23 01:12:17 2018	(r334066)
@@ -0,0 +1,14 @@
+{#
+    basic/localtoc.html
+    ~~~~~~~~~~~~~~~~~~~
+
+    Sphinx sidebar template: local table of contents.
+
+    :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+#}
+{%- if display_toc %}
+  <h3><a href="{{ pathto(master_doc) }}">{{ _('On This Page') }}</a></h3>
+  {{ toc }}
+  <h3><a href="{{ pathto(master_doc) }}">{{ _('Full Documentation') }}</a></h3>
+{%- endif %}

Added: vendor/Juniper/libxo/dist/doc/api.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/Juniper/libxo/dist/doc/api.rst	Wed May 23 01:12:17 2018	(r334066)
@@ -0,0 +1,1620 @@
+.. index: API
+
+The libxo API
+=============
+
+This section gives details about the functions in libxo, how to call
+them, and the actions they perform.
+
+.. index:: Handles
+.. _handles:
+
+Handles
+-------
+
+libxo uses "handles" to control its rendering functionality.  The
+handle contains state and buffered data, as well as callback functions
+to process data.
+
+Handles give an abstraction for libxo that encapsulates the state of a
+stream of output.  Handles have the data type "`xo_handle_t`" and are
+opaque to the caller.
+
+The library has a default handle that is automatically initialized.
+By default, this handle will send text style output (`XO_STYLE_TEXT`) to
+standard output.  The xo_set_style and xo_set_flags functions can be
+used to change this behavior.
+
+For the typical command that is generating output on standard output,
+there is no need to create an explicit handle, but they are available
+when needed, e.g., for daemons that generate multiple streams of
+output.
+
+Many libxo functions take a handle as their first parameter; most that
+do not use the default handle.  Any function taking a handle can be
+passed NULL to access the default handle.  For the convenience of
+callers, the libxo library includes handle-less functions that
+implicitly use the default handle.
+
+For example, the following are equivalent::
+
+    xo_emit("test");
+    xo_emit_h(NULL, "test");
+
+Handles are created using `xo_create` and destroy using
+`xo_destroy`. 
+
+.. index:: xo_create
+
+xo_create
+~~~~~~~~~
+
+.. c:function:: xo_handle_t *xo_create (xo_style_t style, xo_xof_flags_t flags)
+
+  The `xo_create` function allocates a new handle which can be passed
+  to further libxo function calls.  The `xo_handle_t` structure is
+  opaque.
+
+  :param xo_style_t style: Output style (XO_STYLE\_*)
+  :param xo_xof_flags_t flags: Flags for this handle (XOF\_*)
+  :return: New libxo handle
+  :rtype: xo_handle_t \*
+
+  ::
+
+    EXAMPLE:
+        xo_handle_t *xop = xo_create(XO_STYLE_JSON, XOF_WARN | XOF_PRETTY);
+        ....
+        xo_emit_h(xop, "testing\n");
+
+  See also :ref:`output-styles` and :ref:`flags`.
+
+.. index:: xo_create_to_file
+.. index:: XOF_CLOSE_FP
+
+xo_create_to_file
+~~~~~~~~~~~~~~~~~
+
+.. c:function::
+  xo_handle_t *xo_create_to_file (FILE *fp, unsigned style, unsigned flags)
+
+  The `xo_create_to_file` function is aconvenience function is
+  provided for situations when output should be written to a different
+  file, rather than the default of standard output.
+
+  The `XOF_CLOSE_FP` flag can be set on the returned handle to trigger a
+  call to fclose() for the FILE pointer when the handle is destroyed,
+  avoiding the need for the caller to perform this task.
+
+  :param fp: FILE to use as base for this handle
+  :type fp: FILE *
+  :param xo_style_t style: Output style (XO_STYLE\_*)
+  :param xo_xof_flags_t flags: Flags for this handle (XOF\_*)
+  :return: New libxo handle
+  :rtype: xo_handle_t \*
+
+.. index:: xo_set_writer
+.. index:: xo_write_func_t
+.. index:: xo_close_func_t
+.. index:: xo_flush_func_t
+
+xo_set_writer
+~~~~~~~~~~~~~
+
+.. c:function::
+  void xo_set_writer (xo_handle_t *xop, void *opaque, \
+  xo_write_func_t write_func, xo_close_func_t close_func, \
+  xo_flush_func_t flush_func)
+
+  The `xo_set_writer` function allows custom functions which can
+  tailor how libxo writes data.  The `opaque` argument is recorded and
+  passed back to the functions, allowing the function to acquire
+  context information. The *write_func* function writes data to the
+  output stream.  The *close_func* function can release this opaque
+  data and any other resources as needed.  The *flush_func* function
+  is called to flush buffered data associated with the opaque object.
+
+  :param xop: Handle to modify (or NULL for default handle)
+  :type xop: xo_handle_t *
+  :param opaque: Pointer to opaque data passed to the given functions
+  :type opaque: void *
+  :param xo_write_func_t write_func: New write function
+  :param xo_close_func_t close_func: New close function
+  :param xo_flush_func_t flush_func: New flush function
+  :returns: void
+
+.. index:: xo_get_style
+
+xo_get_style
+~~~~~~~~~~~~
+
+.. c:function:: xo_style_t xo_get_style(xo_handle_t *xop)
+
+  Use the `xo_get_style` function to find the current output style for
+  a given handle.  To use the default handle, pass a `NULL` handle.
+
+  :param xop: Handle to interrogate (or NULL for default handle)
+  :type xop: xo_handle_t *
+  :returns: Output style (XO_STYLE\_*)
+  :rtype: xo_style_t
+
+  ::
+
+    EXAMPLE::
+        style = xo_get_style(NULL);
+
+.. index::  XO_STYLE_TEXT
+.. index::  XO_STYLE_XML
+.. index::  XO_STYLE_JSON
+.. index::  XO_STYLE_HTML
+
+.. _output-styles:
+
+Output Styles (XO_STYLE\_\*)
+++++++++++++++++++++++++++++
+
+The libxo functions accept a set of output styles:
+
+=============== =========================
+ Flag            Description
+=============== =========================
+ XO_STYLE_TEXT   Traditional text output
+ XO_STYLE_XML    XML encoded data
+ XO_STYLE_JSON   JSON encoded data
+ XO_STYLE_HTML   HTML encoded data
+=============== =========================
+
+The "XML", "JSON", and "HTML" output styles all use the UTF-8
+character encoding.  "TEXT" using locale-based encoding.
+
+.. index:: xo_set_style
+
+xo_set_style
+~~~~~~~~~~~~
+
+.. c:function:: void xo_set_style(xo_handle_t *xop, xo_style_t style)
+
+  The `xo_set_style` function is used to change the output style
+  setting for a handle.  To use the default handle, pass a `NULL`
+  handle.
+
+  :param xop: Handle to modify
+  :type xop: xo_handle_t *
+  :param xo_style_t style: Output style (XO_STYLE\_*)
+  :returns: void
+
+  ::
+
+    EXAMPLE:
+        xo_set_style(NULL, XO_STYLE_XML);
+
+.. index:: xo_set_style_name
+
+xo_set_style_name
+~~~~~~~~~~~~~~~~~
+
+.. c:function:: int xo_set_style_name (xo_handle_t *xop, const char *style)
+
+  The `xo_set_style_name` function can be used to set the style based
+  on a name encoded as a string: The name can be any of the supported
+  styles: "text", "xml", "json", or "html".
+
+  :param xop: Handle for modify (or NULL for default handle)
+  :type xop: xo_handle_t \*
+  :param style: Text name of the style
+  :type style: const char \*
+  :returns: zero for success, non-zero for error
+  :rtype: int
+
+  ::
+
+    EXAMPLE:
+        xo_set_style_name(NULL, "html");
+
+.. index:: xo_set_flags
+
+xo_set_flags
+~~~~~~~~~~~~
+
+.. c:function:: void xo_set_flags(xo_handle_t *xop, xo_xof_flags_t flags)
+
+  :param xop: Handle for modify (or NULL for default handle)
+  :type xop: xo_handle_t \*
+  :param xo_xof_flags_t flags: Flags to add for the handle
+  :returns: void
+
+  Use the `xo_set_flags` function to turn on flags for a given libxo
+  handle.  To use the default handle, pass a `NULL` handle.
+
+  ::
+
+    EXAMPLE:
+        xo_set_flags(NULL, XOF_PRETTY | XOF_WARN);
+
+.. index:: Flags; XOF_*
+.. index:: XOF_CLOSE_FP
+.. index:: XOF_COLOR
+.. index:: XOF_COLOR_ALLOWED
+.. index:: XOF_DTRT
+.. index:: XOF_INFO
+.. index:: XOF_KEYS
+.. index:: XOF_NO_ENV
+.. index:: XOF_NO_HUMANIZE
+.. index:: XOF_PRETTY
+.. index:: XOF_UNDERSCORES
+.. index:: XOF_UNITS
+.. index:: XOF_WARN
+.. index:: XOF_WARN_XML
+.. index:: XOF_XPATH
+.. index:: XOF_COLUMNS
+.. index:: XOF_FLUSH
+
+.. _flags:
+
+Flags (XOF\_\*)
++++++++++++++++
+
+The set of valid flags include:
+
+=================== =========================================
+ Flag                Description
+=================== =========================================
+ XOF_CLOSE_FP        Close file pointer on `xo_destroy`
+ XOF_COLOR           Enable color and effects in output
+ XOF_COLOR_ALLOWED   Allow color/effect for terminal output
+ XOF_DTRT            Enable "do the right thing" mode
+ XOF_INFO            Display info data attributes (HTML)
+ XOF_KEYS            Emit the key attribute (XML)
+ XOF_NO_ENV          Do not use the :ref:`libxo-options` env var
+ XOF_NO_HUMANIZE     Display humanization (TEXT, HTML)
+ XOF_PRETTY          Make "pretty printed" output
+ XOF_UNDERSCORES     Replaces hyphens with underscores
+ XOF_UNITS           Display units (XML, HMTL)
+ XOF_WARN            Generate warnings for broken calls
+ XOF_WARN_XML        Generate warnings in XML on stdout
+ XOF_XPATH           Emit XPath expressions (HTML)
+ XOF_COLUMNS         Force xo_emit to return columns used
+ XOF_FLUSH           Flush output after each `xo_emit` call
+=================== =========================================
+
+The `XOF_CLOSE_FP` flag will trigger the call of the *close_func*
+(provided via `xo_set_writer`) when the handle is destroyed.
+
+The `XOF_COLOR` flag enables color and effects in output regardless
+of output device, while the `XOF_COLOR_ALLOWED` flag allows color
+and effects only if the output device is a terminal.
+
+The `XOF_PRETTY` flag requests "pretty printing", which will trigger
+the addition of indentation and newlines to enhance the readability of
+XML, JSON, and HTML output.  Text output is not affected.
+
+The `XOF_WARN` flag requests that warnings will trigger diagnostic
+output (on standard error) when the library notices errors during
+operations, or with arguments to functions.  Without warnings enabled,
+such conditions are ignored.
+
+Warnings allow developers to debug their interaction with libxo.
+The function `xo_failure` can used as a breakpoint for a debugger,
+regardless of whether warnings are enabled.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805230112.w4N1CHNO068756>