Date: Thu, 8 Jun 2017 13:04:01 +0000 (UTC) From: Phil Shafer <phil@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319694 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder/cbor contrib/libxo/encoder/test contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved cont... Message-ID: <201706081304.v58D41Ce086153@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: phil Date: Thu Jun 8 13:04:01 2017 New Revision: 319694 URL: https://svnweb.freebsd.org/changeset/base/319694 Log: Import libxo-0.8.0: - addition of --libxo colors=xxxxx color map (so I never see "blue") - fix bugs from -fsanitize=address and =undefined - utf-8 changes (remove support fore 6 byte utf-8 values, which are "historical") - add comments - fix man pages - update test cases Submitted by: phil Reviewed by: sjg Approved by: sjg (mentor) Modified: head/contrib/libxo/Makefile.am head/contrib/libxo/configure.ac head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/doc/libxo.txt head/contrib/libxo/encoder/cbor/enc_cbor.c head/contrib/libxo/encoder/test/enc_test.c head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo.h head/contrib/libxo/libxo/xo_buf.h head/contrib/libxo/libxo/xo_encoder.c head/contrib/libxo/libxo/xo_encoder.h head/contrib/libxo/libxo/xo_syslog.c head/contrib/libxo/tests/core/Makefile.am head/contrib/libxo/tests/core/saved/test_01.E.out head/contrib/libxo/tests/core/saved/test_02.E.out head/contrib/libxo/tests/core/saved/test_03.E.out head/contrib/libxo/tests/core/saved/test_04.E.out head/contrib/libxo/tests/core/saved/test_05.E.out head/contrib/libxo/tests/core/saved/test_06.E.out head/contrib/libxo/tests/core/saved/test_07.E.out head/contrib/libxo/tests/core/saved/test_08.E.out head/contrib/libxo/tests/core/saved/test_09.E.out head/contrib/libxo/tests/core/saved/test_10.E.out head/contrib/libxo/tests/core/saved/test_11.E.out head/contrib/libxo/tests/core/saved/test_11.HIPx.out head/contrib/libxo/tests/core/saved/test_12.E.out head/contrib/libxo/tests/core/saved/test_12.H.out head/contrib/libxo/tests/core/saved/test_12.HIPx.out head/contrib/libxo/tests/core/saved/test_12.HP.out head/contrib/libxo/tests/core/saved/test_12.J.out head/contrib/libxo/tests/core/saved/test_12.JP.out head/contrib/libxo/tests/core/saved/test_12.T.out head/contrib/libxo/tests/core/saved/test_12.X.out head/contrib/libxo/tests/core/saved/test_12.XP.out head/contrib/libxo/tests/core/test_12.c head/contrib/libxo/tests/gettext/Makefile.am head/contrib/libxo/tests/xo/Makefile.am head/contrib/libxo/xo/xo.1 head/contrib/libxo/xohtml/xohtml.1 head/contrib/libxo/xopo/xopo.1 head/contrib/libxo/xopo/xopo.c head/lib/libxo/add.man head/lib/libxo/xo_config.h Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/Makefile.am ============================================================================== --- head/contrib/libxo/Makefile.am Thu Jun 8 12:58:47 2017 (r319693) +++ head/contrib/libxo/Makefile.am Thu Jun 8 13:04:01 2017 (r319694) @@ -100,4 +100,25 @@ ANALYZE_DIR = ~/trash/libxo ANALYZE_CMD = scan-build-mp-3.6 analyze: + ${MAKE} clean ${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE} + +SANIFLAGS=-fno-omit-frame-pointer -g -O2 + +sanitize-address: + ${MAKE} clean + ${MAKE} CFLAGS="-fsanitize=address ${SANIFLAGS}" + ${MAKE} install + ${MAKE} test + +sanitize-undefined: + ${MAKE} clean + ${MAKE} CFLAGS="-fsanitize=undefined ${SANIFLAGS}" + ${MAKE} install + ${MAKE} test + +sanitize-memory: + ${MAKE} clean + ${MAKE} CFLAGS="-fsanitize=memory ${SANIFLAGS}" + ${MAKE} install + ${MAKE} test Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Thu Jun 8 12:58:47 2017 (r319693) +++ head/contrib/libxo/configure.ac Thu Jun 8 13:04:01 2017 (r319694) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.7.2], [phil@juniper.net]) +AC_INIT([libxo], [0.8.0], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/doc/libxo-manual.html ============================================================================== --- head/contrib/libxo/doc/libxo-manual.html Thu Jun 8 12:58:47 2017 (r319693) +++ head/contrib/libxo/doc/libxo-manual.html Thu Jun 8 13:04:01 2017 (r319694) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "May 2017"; + content: "June 2017"; } @top-center { @@ -21983,15 +21983,17 @@ jQuery(function ($) { </script><link rel="Contents" href="#doc.toc"> <link rel="Author" href="#doc.authors"> <link rel="Chapter" title="1 Overview" href="#doc_section_1"> -<link rel="Chapter" title="2 Formatting with libxo" href="#doc_section_2"> -<link rel="Chapter" title="3 The libxo API" href="#doc_section_3"> -<link rel="Chapter" title='4 The "xo" Utility' href="#doc_section_4"> -<link rel="Chapter" title="5 xolint" href="#doc_section_5"> -<link rel="Chapter" title="6 xohtml" href="#doc_section_6"> -<link rel="Chapter" title="7 xopo" href="#doc_section_7"> -<link rel="Chapter" title="8 FAQs" href="#doc_section_8"> -<link rel="Chapter" title="9 Howtos: Focused Directions" href="#doc_section_9"> -<link rel="Chapter" title="10 Examples" href="#doc_section_10"> +<link rel="Chapter" title="2 Getting libxo" href="#doc_section_2"> +<link rel="Chapter" title="3 Formatting with libxo" href="#doc_section_3"> +<link rel="Chapter" title="4 Command-line Arguments" href="#doc_section_4"> +<link rel="Chapter" title="5 The libxo API" href="#doc_section_5"> +<link rel="Chapter" title='6 The "xo" Utility' href="#doc_section_6"> +<link rel="Chapter" title="7 xolint" href="#doc_section_7"> +<link rel="Chapter" title="8 xohtml" href="#doc_section_8"> +<link rel="Chapter" title="9 xopo" href="#doc_section_9"> +<link rel="Chapter" title="10 FAQs" href="#doc_section_10"> +<link rel="Chapter" title="11 Howtos: Focused Directions" href="#doc_section_11"> +<link rel="Chapter" title="12 Examples" href="#doc_section_12"> <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.389, 2008-08-20 14:21:35, XSLT vendor: libxslt http://xmlsoft.org/XSLT/"> <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"> <meta name="DC.Creator" content="Shafer, P."> @@ -22009,7 +22011,7 @@ jQuery(function ($) { </tr> <tr> <td class="header left"></td> -<td class="header right">May 15, 2017</td> +<td class="header right">June 3, 2017</td> </tr> </table></div> <p id="title" class="title">libxo: The Easy Way to Generate text, XML, JSON, and HTML output<br><span class="filename">libxo-manual</span></p> @@ -22018,398 +22020,413 @@ jQuery(function ($) { <ul class="toc"> <li class="tocline0"> <div class="section-number" id="toc_doc_section_1">1 </div> -<a href="#overview">Overview</a><ul class="toc top-toc"><li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1">1.1 </div> -<a href="#getting-libxo">Getting libxo</a><ul class="toc"> +<a href="#overview">Overview</a> +</li> +<li class="tocline0"> +<div class="section-number" id="toc_doc_section_2">2 </div> +<a href="#getting-libxo">Getting libxo</a><ul class="toc top-toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1_1">1.1.1 </div> +<div class="section-number" id="toc_doc_section_2_1">2.1 </div> <a href="#downloading-libxo-source-code">Downloading libxo Source Code</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1_2">1.1.2 </div> +<div class="section-number" id="toc_doc_section_2_2">2.2 </div> <a href="#building-libxo">Building libxo</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1_2_1">1.1.2.1 </div> +<div class="section-number" id="toc_doc_section_2_2_1">2.2.1 </div> <a href="#setting-up-the-build">Setting up the build</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1_2_2">1.1.2.2 </div> -<a href="#running-the-configure-script">Running the "configure" Script</a> -</li> +<div class="section-number" id="toc_doc_section_2_2_2">2.2.2 </div> +<a href="#running-the-configure-script">Running the "configure" Script</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1_2_3">1.1.2.3 </div> +<div class="section-number" id="toc_doc_section_2_2_2_1">2.2.2.1 </div> <a href="#running-the-make-command">Running the "make" command</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1_2_4">1.1.2.4 </div> +<div class="section-number" id="toc_doc_section_2_2_2_2">2.2.2.2 </div> <a href="#running-the-regression-tests">Running the Regression Tests</a> </li> +</ul> +</li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_1_1_2_5">1.1.2.5 </div> +<div class="section-number" id="toc_doc_section_2_2_3">2.2.3 </div> <a href="#installing-libxo">Installing libxo</a> </li> </ul> </li> </ul> -</li></ul> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_2">2 </div> +<div class="section-number" id="toc_doc_section_3">3 </div> <a href="#formatting-with-libxo">Formatting with libxo</a><ul class="toc top-toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_1">2.1 </div> +<div class="section-number" id="toc_doc_section_3_1">3.1 </div> <a href="#encoding-styles">Encoding Styles</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_1_1">2.1.1 </div> +<div class="section-number" id="toc_doc_section_3_1_1">3.1.1 </div> <a href="#text-output">Text Output</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_1_2">2.1.2 </div> +<div class="section-number" id="toc_doc_section_3_1_2">3.1.2 </div> <a href="#xml-output">XML Output</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_1_3">2.1.3 </div> +<div class="section-number" id="toc_doc_section_3_1_3">3.1.3 </div> <a href="#json-output">JSON Output</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_1_4">2.1.4 </div> +<div class="section-number" id="toc_doc_section_3_1_4">3.1.4 </div> <a href="#html-output">HTML Output</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2">2.2 </div> +<div class="section-number" id="toc_doc_section_3_2">3.2 </div> <a href="#format-strings">Format Strings</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1">2.2.1 </div> +<div class="section-number" id="toc_doc_section_3_2_1">3.2.1 </div> <a href="#field-roles">Field Roles</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_1">2.2.1.1 </div> +<div class="section-number" id="toc_doc_section_3_2_1_1">3.2.1.1 </div> <a href="#color-role">The Color Role ({C:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_2">2.2.1.2 </div> +<div class="section-number" id="toc_doc_section_3_2_1_2">3.2.1.2 </div> <a href="#the-decoration-role-d">The Decoration Role ({D:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_3">2.2.1.3 </div> +<div class="section-number" id="toc_doc_section_3_2_1_3">3.2.1.3 </div> <a href="#gettext-role">The Gettext Role ({G:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_4">2.2.1.4 </div> +<div class="section-number" id="toc_doc_section_3_2_1_4">3.2.1.4 </div> <a href="#the-label-role-l">The Label Role ({L:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_5">2.2.1.5 </div> +<div class="section-number" id="toc_doc_section_3_2_1_5">3.2.1.5 </div> <a href="#the-note-role-n">The Note Role ({N:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_6">2.2.1.6 </div> +<div class="section-number" id="toc_doc_section_3_2_1_6">3.2.1.6 </div> <a href="#padding-role">The Padding Role ({P:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_7">2.2.1.7 </div> +<div class="section-number" id="toc_doc_section_3_2_1_7">3.2.1.7 </div> <a href="#the-title-role-t">The Title Role ({T:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_8">2.2.1.8 </div> +<div class="section-number" id="toc_doc_section_3_2_1_8">3.2.1.8 </div> <a href="#the-units-role-u">The Units Role ({U:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_9">2.2.1.9 </div> +<div class="section-number" id="toc_doc_section_3_2_1_9">3.2.1.9 </div> <a href="#the-value-role-v-and-">The Value Role ({V:} and {:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_1_10">2.2.1.10 </div> +<div class="section-number" id="toc_doc_section_3_2_1_10">3.2.1.10 </div> <a href="#anchor-role">The Anchor Roles ({[:} and {]:})</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2">2.2.2 </div> +<div class="section-number" id="toc_doc_section_3_2_2">3.2.2 </div> <a href="#field-modifiers">Field Modifiers</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_1">2.2.2.1 </div> +<div class="section-number" id="toc_doc_section_3_2_2_1">3.2.2.1 </div> <a href="#the-argument-modifier-a">The Argument Modifier ({a:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_2">2.2.2.2 </div> +<div class="section-number" id="toc_doc_section_3_2_2_2">3.2.2.2 </div> <a href="#the-colon-modifier-c">The Colon Modifier ({c:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_3">2.2.2.3 </div> +<div class="section-number" id="toc_doc_section_3_2_2_3">3.2.2.3 </div> <a href="#the-display-modifier-d">The Display Modifier ({d:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_4">2.2.2.4 </div> +<div class="section-number" id="toc_doc_section_3_2_2_4">3.2.2.4 </div> <a href="#e-modifier">The Encoding Modifier ({e:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_5">2.2.2.5 </div> +<div class="section-number" id="toc_doc_section_3_2_2_5">3.2.2.5 </div> <a href="#gettext-modifier">The Gettext Modifier ({g:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_6">2.2.2.6 </div> +<div class="section-number" id="toc_doc_section_3_2_2_6">3.2.2.6 </div> <a href="#the-humanize-modifier-h">The Humanize Modifier ({h:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_7">2.2.2.7 </div> +<div class="section-number" id="toc_doc_section_3_2_2_7">3.2.2.7 </div> <a href="#the-key-modifier-k">The Key Modifier ({k:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_8">2.2.2.8 </div> +<div class="section-number" id="toc_doc_section_3_2_2_8">3.2.2.8 </div> <a href="#the-leaf-list-modifier-l">The Leaf-List Modifier ({l:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_9">2.2.2.9 </div> +<div class="section-number" id="toc_doc_section_3_2_2_9">3.2.2.9 </div> <a href="#the-no-quotes-modifier-n">The No-Quotes Modifier ({n:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_10">2.2.2.10 </div> +<div class="section-number" id="toc_doc_section_3_2_2_10">3.2.2.10 </div> <a href="#plural-modifier">The Plural Modifier ({p:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_11">2.2.2.11 </div> +<div class="section-number" id="toc_doc_section_3_2_2_11">3.2.2.11 </div> <a href="#the-quotes-modifier-q">The Quotes Modifier ({q:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_12">2.2.2.12 </div> +<div class="section-number" id="toc_doc_section_3_2_2_12">3.2.2.12 </div> <a href="#the-trim-modifier-t">The Trim Modifier ({t:})</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_2_13">2.2.2.13 </div> +<div class="section-number" id="toc_doc_section_3_2_2_13">3.2.2.13 </div> <a href="#the-white-space-modifier-w">The White Space Modifier ({w:})</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_3">2.2.3 </div> +<div class="section-number" id="toc_doc_section_3_2_3">3.2.3 </div> <a href="#field-formatting">Field Formatting</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_4">2.2.4 </div> +<div class="section-number" id="toc_doc_section_3_2_4">3.2.4 </div> <a href="#utf-8-and-locale-strings">UTF-8 and Locale Strings</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_5">2.2.5 </div> +<div class="section-number" id="toc_doc_section_3_2_5">3.2.5 </div> <a href="#characters-outside-of-field-definitions">Characters Outside of Field Definitions</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_6">2.2.6 </div> +<div class="section-number" id="toc_doc_section_3_2_6">3.2.6 </div> <a href="#m-is-supported">"%m" Is Supported</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_7">2.2.7 </div> +<div class="section-number" id="toc_doc_section_3_2_7">3.2.7 </div> <a href="#n-is-not-supported">"%n" Is Not Supported</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_8">2.2.8 </div> +<div class="section-number" id="toc_doc_section_3_2_8">3.2.8 </div> <a href="#the-encoding-format-eformat">The Encoding Format (eformat)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_9">2.2.9 </div> +<div class="section-number" id="toc_doc_section_3_2_9">3.2.9 </div> <a href="#content-strings">Content Strings</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_10">2.2.10 </div> +<div class="section-number" id="toc_doc_section_3_2_10">3.2.10 </div> <a href="#printf-like">Argument Validation</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_11">2.2.11 </div> +<div class="section-number" id="toc_doc_section_3_2_11">3.2.11 </div> <a href="#retain">Retaining Parsed Format Information</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_2_12">2.2.12 </div> +<div class="section-number" id="toc_doc_section_3_2_12">3.2.12 </div> <a href="#example">Example</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_3">2.3 </div> +<div class="section-number" id="toc_doc_section_3_3">3.3 </div> <a href="#representing-hierarchy">Representing Hierarchy</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_3_1">2.3.1 </div> +<div class="section-number" id="toc_doc_section_3_3_1">3.3.1 </div> <a href="#containers">Containers</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_3_2">2.3.2 </div> +<div class="section-number" id="toc_doc_section_3_3_2">3.3.2 </div> <a href="#lists-and-instances">Lists and Instances</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_3_3">2.3.3 </div> +<div class="section-number" id="toc_doc_section_3_3_3">3.3.3 </div> <a href="#dtrt-mode">DTRT Mode</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_3_4">2.3.4 </div> +<div class="section-number" id="toc_doc_section_3_3_4">3.3.4 </div> <a href="#markers">Markers</a> </li> </ul> </li> +</ul> +</li> +<li class="tocline0"> +<div class="section-number" id="toc_doc_section_4">4 </div> +<a href="#options">Command-line Arguments</a><ul class="toc top-toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_2_4">2.4 </div> -<a href="#command-line-arguments">Command-line Arguments</a> +<div class="section-number" id="toc_doc_section_4_1">4.1 </div> +<a href="#option-keywords">Option keywords</a> </li> +<li class="tocline1"> +<div class="section-number" id="toc_doc_section_4_2">4.2 </div> +<a href="#brief-options">Brief Options</a> +</li> +<li class="tocline1"> +<div class="section-number" id="toc_doc_section_4_3">4.3 </div> +<a href="#color-mapping">Color Mapping</a> +</li> </ul> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_3">3 </div> +<div class="section-number" id="toc_doc_section_5">5 </div> <a href="#the-libxo-api">The libxo API</a><ul class="toc top-toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1">3.1 </div> +<div class="section-number" id="toc_doc_section_5_1">5.1 </div> <a href="#handles">Handles</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_1">3.1.1 </div> +<div class="section-number" id="toc_doc_section_5_1_1">5.1.1 </div> <a href="#xo_create">xo_create</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_2">3.1.2 </div> +<div class="section-number" id="toc_doc_section_5_1_2">5.1.2 </div> <a href="#xo_create_to_file">xo_create_to_file</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_3">3.1.3 </div> +<div class="section-number" id="toc_doc_section_5_1_3">5.1.3 </div> <a href="#xo_set_writer">xo_set_writer</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_4">3.1.4 </div> +<div class="section-number" id="toc_doc_section_5_1_4">5.1.4 </div> <a href="#xo_set_style">xo_set_style</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_5">3.1.5 </div> +<div class="section-number" id="toc_doc_section_5_1_5">5.1.5 </div> <a href="#xo_get_style">xo_get_style</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_5_1">3.1.5.1 </div> +<div class="section-number" id="toc_doc_section_5_1_5_1">5.1.5.1 </div> <a href="#styles">Output Styles (XO_STYLE_*)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_5_2">3.1.5.2 </div> +<div class="section-number" id="toc_doc_section_5_1_5_2">5.1.5.2 </div> <a href="#xo_set_style_name">xo_set_style_name</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_6">3.1.6 </div> +<div class="section-number" id="toc_doc_section_5_1_6">5.1.6 </div> <a href="#xo_set_flags">xo_set_flags</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_6_1">3.1.6.1 </div> +<div class="section-number" id="toc_doc_section_5_1_6_1">5.1.6.1 </div> <a href="#flags">Flags (XOF_*)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_6_2">3.1.6.2 </div> +<div class="section-number" id="toc_doc_section_5_1_6_2">5.1.6.2 </div> <a href="#xo_clear_flags">xo_clear_flags</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_6_3">3.1.6.3 </div> +<div class="section-number" id="toc_doc_section_5_1_6_3">5.1.6.3 </div> <a href="#xo_set_options">xo_set_options</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_1_7">3.1.7 </div> +<div class="section-number" id="toc_doc_section_5_1_7">5.1.7 </div> <a href="#xo_destroy">xo_destroy</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_2">3.2 </div> +<div class="section-number" id="toc_doc_section_5_2">5.2 </div> <a href="#emitting-content-xo_emit">Emitting Content (xo_emit)</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_2_1">3.2.1 </div> +<div class="section-number" id="toc_doc_section_5_2_1">5.2.1 </div> <a href="#xo_emit_field">Single Field Emitting Functions (xo_emit_field)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_2_2">3.2.2 </div> +<div class="section-number" id="toc_doc_section_5_2_2">5.2.2 </div> <a href="#xo_attr">Attributes (xo_attr)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_2_3">3.2.3 </div> +<div class="section-number" id="toc_doc_section_5_2_3">5.2.3 </div> <a href="#flushing-output-xo_flush">Flushing Output (xo_flush)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_2_4">3.2.4 </div> +<div class="section-number" id="toc_doc_section_5_2_4">5.2.4 </div> <a href="#finishing-output-xo_finish">Finishing Output (xo_finish)</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_3">3.3 </div> +<div class="section-number" id="toc_doc_section_5_3">5.3 </div> <a href="#emitting-hierarchy">Emitting Hierarchy</a><ul class="toc"><li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_3_1">3.3.1 </div> +<div class="section-number" id="toc_doc_section_5_3_1">5.3.1 </div> <a href="#lists-and-instances-2">Lists and Instances</a> </li></ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4">3.4 </div> +<div class="section-number" id="toc_doc_section_5_4">5.4 </div> <a href="#support-functions">Support Functions</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_1">3.4.1 </div> +<div class="section-number" id="toc_doc_section_5_4_1">5.4.1 </div> <a href="#xo_parse_args">Parsing Command-line Arguments (xo_parse_args)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_2">3.4.2 </div> +<div class="section-number" id="toc_doc_section_5_4_2">5.4.2 </div> <a href="#xo_set_program">xo_set_program</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_3">3.4.3 </div> +<div class="section-number" id="toc_doc_section_5_4_3">5.4.3 </div> <a href="#xo_set_version">xo_set_version</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_4">3.4.4 </div> +<div class="section-number" id="toc_doc_section_5_4_4">5.4.4 </div> <a href="#info">Field Information (xo_info_t)</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_5">3.4.5 </div> +<div class="section-number" id="toc_doc_section_5_4_5">5.4.5 </div> <a href="#memory-allocation">Memory Allocation</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_6">3.4.6 </div> +<div class="section-number" id="toc_doc_section_5_4_6">5.4.6 </div> <a href="#LIBXO_OPTIONS">LIBXO_OPTIONS</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_7">3.4.7 </div> +<div class="section-number" id="toc_doc_section_5_4_7">5.4.7 </div> <a href="#errors-warnings-and-messages">Errors, Warnings, and Messages</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_8">3.4.8 </div> +<div class="section-number" id="toc_doc_section_5_4_8">5.4.8 </div> <a href="#xo_error">xo_error</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_4_9">3.4.9 </div> +<div class="section-number" id="toc_doc_section_5_4_9">5.4.9 </div> <a href="#xo_no_setlocale">xo_no_setlocale</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5">3.5 </div> +<div class="section-number" id="toc_doc_section_5_5">5.5 </div> <a href="#emitting-syslog-messages">Emitting syslog Messages</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_1">3.5.1 </div> +<div class="section-number" id="toc_doc_section_5_5_1">5.5.1 </div> <a href="#priority">Priority, Facility, and Flags</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_2">3.5.2 </div> +<div class="section-number" id="toc_doc_section_5_5_2">5.5.2 </div> <a href="#xo_syslog">xo_syslog</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_3">3.5.3 </div> +<div class="section-number" id="toc_doc_section_5_5_3">5.5.3 </div> <a href="#support-functions-2">Support functions</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_3_1">3.5.3.1 </div> +<div class="section-number" id="toc_doc_section_5_5_3_1">5.5.3.1 </div> <a href="#xo_vsyslog">xo_vsyslog</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_3_2">3.5.3.2 </div> +<div class="section-number" id="toc_doc_section_5_5_3_2">5.5.3.2 </div> <a href="#xo_open_log">xo_open_log</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_3_3">3.5.3.3 </div> +<div class="section-number" id="toc_doc_section_5_5_3_3">5.5.3.3 </div> <a href="#xo_close_log">xo_close_log</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_3_4">3.5.3.4 </div> +<div class="section-number" id="toc_doc_section_5_5_3_4">5.5.3.4 </div> <a href="#xo_set_logmask">xo_set_logmask</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_5_3_5">3.5.3.5 </div> +<div class="section-number" id="toc_doc_section_5_5_3_5">5.5.3.5 </div> <a href="#xo_set_syslog_enterprise_id">xo_set_syslog_enterprise_id</a> </li> </ul> @@ -22417,18 +22434,18 @@ jQuery(function ($) { </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_6">3.6 </div> +<div class="section-number" id="toc_doc_section_5_6">5.6 </div> <a href="#creating-custom-encoders">Creating Custom Encoders</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_6_1">3.6.1 </div> +<div class="section-number" id="toc_doc_section_5_6_1">5.6.1 </div> <a href="#loading-encoders">Loading Encoders</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_6_2">3.6.2 </div> +<div class="section-number" id="toc_doc_section_5_6_2">5.6.2 </div> <a href="#encoder-initialization">Encoder Initialization</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_3_6_3">3.6.3 </div> +<div class="section-number" id="toc_doc_section_5_6_3">5.6.3 </div> <a href="#operations">Operations</a> </li> </ul> @@ -22436,143 +22453,143 @@ jQuery(function ($) { </ul> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_4">4 </div> +<div class="section-number" id="toc_doc_section_6">6 </div> <a href="#the-xo-utility">The "xo" Utility</a><ul class="toc top-toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_4_1">4.1 </div> +<div class="section-number" id="toc_doc_section_6_1">6.1 </div> <a href="#command-line-options">Command Line Options</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_4_2">4.2 </div> +<div class="section-number" id="toc_doc_section_6_2">6.2 </div> <a href="#example-2">Example</a> </li> </ul> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_5">5 </div> +<div class="section-number" id="toc_doc_section_7">7 </div> <a href="#xolint">xolint</a> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_6">6 </div> +<div class="section-number" id="toc_doc_section_8">8 </div> <a href="#xohtml">xohtml</a> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_7">7 </div> +<div class="section-number" id="toc_doc_section_9">9 </div> <a href="#xopo">xopo</a> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_8">8 </div> +<div class="section-number" id="toc_doc_section_10">10 </div> <a href="#faqs">FAQs</a><ul class="toc top-toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_1">8.1 </div> +<div class="section-number" id="toc_doc_section_10_1">10.1 </div> <a href="#general">General</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_1_1">8.1.1 </div> +<div class="section-number" id="toc_doc_section_10_1_1">10.1.1 </div> <a href="#can-you-share-the-history-of-libxo">Can you share the history of libxo?</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_1_2">8.1.2 </div> +<div class="section-number" id="toc_doc_section_10_1_2">10.1.2 </div> <a href="#did-the-complex-semantics-of-format-strings-evolve-over-time">Did the complex semantics of format strings evolve over time?</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_1_3">8.1.3 </div> +<div class="section-number" id="toc_doc_section_10_1_3">10.1.3 </div> <a href="#good-field-names">What makes a good field name?</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2">8.2 </div> +<div class="section-number" id="toc_doc_section_10_2">10.2 </div> <a href="#what-does-this-message-mean">What does this message mean?</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_1">8.2.1 </div> +<div class="section-number" id="toc_doc_section_10_2_1">10.2.1 </div> <a href="#a-percent-sign-appearing-in-text-is-a-literal">'A percent sign appearing in text is a literal'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_2">8.2.2 </div> +<div class="section-number" id="toc_doc_section_10_2_2">10.2.2 </div> <a href="#unknown-long-name-for-rolemodifier">'Unknown long name for role/modifier'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_3">8.2.3 </div> +<div class="section-number" id="toc_doc_section_10_2_3">10.2.3 </div> <a href="#last-character-before-field-definition-is-a-field-type">'Last character before field definition is a field type'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_4">8.2.4 </div> +<div class="section-number" id="toc_doc_section_10_2_4">10.2.4 </div> <a href="#encoding-format-uses-different-number-of-arguments">'Encoding format uses different number of arguments'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_5">8.2.5 </div> +<div class="section-number" id="toc_doc_section_10_2_5">10.2.5 </div> <a href="#only-one-field-role-can-be-used">'Only one field role can be used'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_6">8.2.6 </div> +<div class="section-number" id="toc_doc_section_10_2_6">10.2.6 </div> <a href="#potential-missing-slash-after-c-d-n-l-or-t-with-format">'Potential missing slash after C, D, N, L, or T with format'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_7">8.2.7 </div> +<div class="section-number" id="toc_doc_section_10_2_7">10.2.7 </div> <a href="#an-encoding-format-cannot-be-given-roles-dnlt">'An encoding format cannot be given (roles: DNLT)'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_8">8.2.8 </div> +<div class="section-number" id="toc_doc_section_10_2_8">10.2.8 </div> <a href="#format-cannot-be-given-when-content-is-present-roles-cdln">'Format cannot be given when content is present (roles: CDLN)'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_9">8.2.9 </div> +<div class="section-number" id="toc_doc_section_10_2_9">10.2.9 </div> <a href="#field-has-color-without-fg--or-bg--role-c">'Field has color without fg- or bg- (role: C)'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_10">8.2.10 </div> +<div class="section-number" id="toc_doc_section_10_2_10">10.2.10 </div> <a href="#field-has-invalid-color-or-effect-role-c">'Field has invalid color or effect (role: C)'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_11">8.2.11 </div> +<div class="section-number" id="toc_doc_section_10_2_11">10.2.11 </div> <a href="#field-has-humanize-modifier-but-no-format-string">'Field has humanize modifier but no format string'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_12">8.2.12 </div> +<div class="section-number" id="toc_doc_section_10_2_12">10.2.12 </div> <a href="#field-has-hn--modifier-but-not-h-modifier">'Field has hn-* modifier but not 'h' modifier'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_13">8.2.13 </div> +<div class="section-number" id="toc_doc_section_10_2_13">10.2.13 </div> <a href="#value-field-must-have-a-name-as-content">'Value field must have a name (as content)")'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_14">8.2.14 </div> +<div class="section-number" id="toc_doc_section_10_2_14">10.2.14 </div> <a href="#use-hyphens-not-underscores-for-value-field-name">'Use hyphens, not underscores, for value field name'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_15">8.2.15 </div> +<div class="section-number" id="toc_doc_section_10_2_15">10.2.15 </div> <a href="#value-field-name-cannot-start-with-digit">'Value field name cannot start with digit'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_16">8.2.16 </div> +<div class="section-number" id="toc_doc_section_10_2_16">10.2.16 </div> <a href="#value-field-name-should-be-lower-case">'Value field name should be lower case'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_17">8.2.17 </div> +<div class="section-number" id="toc_doc_section_10_2_17">10.2.17 </div> <a href="#value-field-name-should-be-longer-than-two-characters">'Value field name should be longer than two characters'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_18">8.2.18 </div> +<div class="section-number" id="toc_doc_section_10_2_18">10.2.18 </div> <a href="#value-field-name-contains-invalid-character">'Value field name contains invalid character'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_19">8.2.19 </div> +<div class="section-number" id="toc_doc_section_10_2_19">10.2.19 </div> <a href="#decoration-field-contains-invalid-character">'decoration field contains invalid character'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_20">8.2.20 </div> +<div class="section-number" id="toc_doc_section_10_2_20">10.2.20 </div> <a href="#anchor-content-should-be-decimal-width">'Anchor content should be decimal width'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_21">8.2.21 </div> +<div class="section-number" id="toc_doc_section_10_2_21">10.2.21 </div> <a href="#anchor-format-should-be-d">'Anchor format should be "%d"'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_22">8.2.22 </div> +<div class="section-number" id="toc_doc_section_10_2_22">10.2.22 </div> <a href="#anchor-cannot-have-both-format-and-encoding-format">'Anchor cannot have both format and encoding format")'</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_8_2_23">8.2.23 </div> +<div class="section-number" id="toc_doc_section_10_2_23">10.2.23 </div> <a href="#max-width-only-valid-for-strings">'Max width only valid for strings'</a> </li> </ul> @@ -22580,54 +22597,54 @@ jQuery(function ($) { </ul> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_9">9 </div> +<div class="section-number" id="toc_doc_section_11">11 </div> <a href="#howtos-focused-directions">Howtos: Focused Directions</a><ul class="toc top-toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_1">9.1 </div> +<div class="section-number" id="toc_doc_section_11_1">11.1 </div> <a href="#howto-report-bugs">Howto: Report bugs</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_2">9.2 </div> +<div class="section-number" id="toc_doc_section_11_2">11.2 </div> <a href="#howto-install-libxo">Howto: Install libxo</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_3">9.3 </div> +<div class="section-number" id="toc_doc_section_11_3">11.3 </div> <a href="#howto-convert-command-line-applications">Howto: Convert command line applications</a><ul class="toc"> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_3_1">9.3.1 </div> +<div class="section-number" id="toc_doc_section_11_3_1">11.3.1 </div> <a href="#setting-up-the-context">Setting up the context</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_3_2">9.3.2 </div> +<div class="section-number" id="toc_doc_section_11_3_2">11.3.2 </div> <a href="#converting-printf-calls">Converting printf Calls</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_3_3">9.3.3 </div> +<div class="section-number" id="toc_doc_section_11_3_3">11.3.3 </div> <a href="#creating-hierarchy">Creating Hierarchy</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_3_4">9.3.4 </div> +<div class="section-number" id="toc_doc_section_11_3_4">11.3.4 </div> <a href="#converting-error-functions">Converting Error Functions</a> </li> </ul> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_4">9.4 </div> +<div class="section-number" id="toc_doc_section_11_4">11.4 </div> <a href="#howto-use-xo-in-shell-scripts">Howto: Use "xo" in Shell Scripts</a> </li> <li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_5">9.5 </div> +<div class="section-number" id="toc_doc_section_11_5">11.5 </div> <a href="#howto-i18n">Howto: Internationalization (i18n)</a><ul class="toc"><li class="tocline1"> -<div class="section-number" id="toc_doc_section_9_5_1">9.5.1 </div> +<div class="section-number" id="toc_doc_section_11_5_1">11.5.1 </div> <a href="#i18n-and-xo_emit">i18n and xo_emit</a> </li></ul> </li> </ul> </li> <li class="tocline0"> -<div class="section-number" id="toc_doc_section_10">10 </div> +<div class="section-number" id="toc_doc_section_12">12 </div> <a href="#examples">Examples</a><ul class="toc top-toc"><li class="tocline1"> -<div class="section-number" id="toc_doc_section_10_1">10.1 </div> +<div class="section-number" id="toc_doc_section_12_1">12.1 </div> <a href="#unit-test">Unit Test</a> </li></ul> </li> @@ -22642,14 +22659,31 @@ jQuery(function ($) { <a id="overview" href="#overview">Overview</a> </h1> <p id="doc_section_1_p_1">libxo - A Library for Generating Text, XML, JSON, and HTML Output</p> -<p id="doc_section_1_p_2">You want to prepare for the future, but you need to live in the present. You'd love a flying car, but need to get to work today. You want to support features like XML, JSON, and HTML rendering to allow integration with NETCONF, REST, and web browsers, but you need to make text output for command line users. And you don't want multiple code paths that can't help but get out of sync. None of this "if (xml) {... } else {...}" logic. And ifdefs are right out. But you'd really, really like all the fancy features that modern encoding formats can provide. libxo can help.</p> -<p id="doc_section_1_p_3">The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced. The application calls a function "xo_emit" to product output that is described in a format string. A "field descriptor" tells libxo what the field is and what it means. Each field descriptor is placed in braces with a printf-like format string (<a href="#format-strings" title="Format Strings">Section 2.2</a>):</p> +<p id="doc_section_1_p_2">You want to prepare for the future, but you need to live in the present. You'd love a flying car, but need to get to work today. You want to support features like XML, JSON, and HTML rendering to allow integration with NETCONF, REST, and web browsers, but you need to make text output for command line users.</p> +<p id="doc_section_1_p_3">And you don't want multiple code paths that can't help but get out of sync:</p> <div id="doc_figure_u.1"></div> <pre> + /* None of this "if (xml) {... } else {...}" logic */ + if (xml) { + /* some code to make xml*/ + } else { + /* other code to make text */ + /* oops forgot to add something on both clauses! */ + } + + /* And ifdefs are right out. */ + #ifdef MAKE_XML + /* icky */ + #else + /* pooh */ + #endif + </pre> <p id="doc_section_1_p_5">But you'd really, really like all the fancy features that modern encoding formats can provide. libxo can help.</p> +<p id="doc_section_1_p_6">The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced. The application calls a function "xo_emit" to product output that is described in a format string. A "field descriptor" tells libxo what the field is and what it means. Each field descriptor is placed in braces with a printf-like format string (<a href="#format-strings" title="Format Strings">Section 3.2</a>):</p> +<div id="doc_figure_u.2"></div> <pre> xo_emit(" {:lines/%7ju} {:words/%7ju} " "{:characters/%7ju} {d:filename/%s}\n", linect, wordct, charct, file); - </pre> <p id="doc_section_1_p_5">Each field can have a role, with the 'value' role being the default, and the role tells libxo how and when to render that field. Output can then be generated in various style, using the "‑‑libxo" option:</p> -<div id="doc_figure_u.2"></div> <pre> + </pre> <p id="doc_section_1_p_8">Each field can have a role, with the 'value' role being the default, and the role tells libxo how and when to render that field (see <a href="#field-roles" title="Field Roles">Section 3.2.1</a> for details). Modifiers change how the field is rendered in different output styles (see <a href="#field-modifiers" title="Field Modifiers">Section 3.2.2</a> for details. Output can then be generated in various style, using the "‑‑libxo" option:</p> +<div id="doc_figure_u.3"></div> <pre> % wc /etc/motd 25 165 1140 /etc/motd % wc --libxo xml,pretty,warn /etc/motd @@ -22685,160 +22719,164 @@ jQuery(function ($) { <div class="text"> </div> <div class="data" data-tag="filename">/etc/motd</div> </div> - </pre> <p id="doc_section_1_p_7">Section Contents: </p> -<ul><li><a href="#getting-libxo" title="Getting libxo">Section 1.1</a></li></ul> + </pre> <p id="doc_section_1_p_10">Same code path, same format strings, same information, but it's rendered in distinct styles based on run-time flags.</p> +</div> +<hr class="noprint"> <div class="content"> -<h2 id="doc_section_1_1"> +<h1 id="doc_section_2" class="np"> <div class="self-section-number"> -<a href="#doc_section_1_1">1.1</a> </div> +<a href="#doc_section_2">2_</a> </div> <a id="getting-libxo" href="#getting-libxo">Getting libxo</a> -</h2> -<p id="doc_section_1_1_p_1">libxo lives on github as:</p> -<p id="doc_section_1_1_p_2"> <a href="https://github.com/Juniper/libxo">https://github.com/Juniper/libxo</a></p> -<p id="doc_section_1_1_p_3">The latest release of libxo is available at:</p> -<p id="doc_section_1_1_p_4"> <a href="https://github.com/Juniper/libxo/releases">https://github.com/Juniper/libxo/releases</a></p> -<p id="doc_section_1_1_p_5">We are following the branching scheme from <a href="http://nvie.com/posts/a-successful-git-branching-model/">http://nvie.com/posts/a-successful-git-branching-model/</a> which means we will do development under the "develop" branch, and release from the "master" branch. To clone a developer tree, run the following command:</p> -<div id="doc_figure_u.3"></div> <pre> +</h1> +<p id="doc_section_2_p_1">libxo now ships as part of the FreeBSD Operating System (as of -11).</p> +<p id="doc_section_2_p_2">libxo lives on github as:</p> +<p id="doc_section_2_p_3"> <a href="https://github.com/Juniper/libxo">https://github.com/Juniper/libxo</a></p> +<p id="doc_section_2_p_4">The latest release of libxo is available at:</p> +<p id="doc_section_2_p_5"> <a href="https://github.com/Juniper/libxo/releases">https://github.com/Juniper/libxo/releases</a></p> +<p id="doc_section_2_p_6">We are following the branching scheme from <a href="http://nvie.com/posts/a-successful-git-branching-model/">http://nvie.com/posts/a-successful-git-branching-model/</a> which means we will do development under the "develop" branch, and release from the "master" branch. To clone a developer tree, run the following command:</p> +<div id="doc_figure_u.4"></div> <pre> git clone https://github.com/Juniper/libxo.git -b develop - </pre> <p id="doc_section_1_1_p_7">We're using semantic release numbering, as defined in <a href="http://semver.org/spec/v2.0.0.html">http://semver.org/spec/v2.0.0.html</a>.</p> -<p id="doc_section_1_1_p_8">libxo is open source, distributed under the BSD license. It shipped as part of the FreeBSD operating system starting with release 11.0.</p> -<p id="doc_section_1_1_p_9">Issues, problems, and bugs should be directly to the issues page on our github site.</p> -<p id="doc_section_1_1_p_10">Section Contents: </p> + </pre> <p id="doc_section_2_p_8">We're using semantic release numbering, as defined in <a href="http://semver.org/spec/v2.0.0.html">http://semver.org/spec/v2.0.0.html</a>.</p> +<p id="doc_section_2_p_9">libxo is open source, distributed under the BSD license. It shipped as part of the FreeBSD operating system starting with release 11.0.</p> +<p id="doc_section_2_p_10">Issues, problems, and bugs should be directly to the issues page on our github site.</p> +<p id="doc_section_2_p_11">Section Contents: </p> <ul> -<li><a href="#downloading-libxo-source-code" title="Downloading libxo Source Code">Section 1.1.1</a></li> -<li><a href="#building-libxo" title="Building libxo">Section 1.1.2</a></li> +<li><a href="#downloading-libxo-source-code" title="Downloading libxo Source Code">Section 2.1</a></li> +<li><a href="#building-libxo" title="Building libxo">Section 2.2</a></li> </ul> <div class="content"> -<h3 id="doc_section_1_1_1"> +<h2 id="doc_section_2_1"> <div class="self-section-number"> -<a href="#doc_section_1_1_1">1.1.1</a> </div> +<a href="#doc_section_2_1">2.1</a> </div> <a id="downloading-libxo-source-code" href="#downloading-libxo-source-code">Downloading libxo Source Code</a> -</h3> -<p id="doc_section_1_1_1_p_1">You can retrieve the source for libxo in two ways:</p> -<p id="doc_section_1_1_1_p_2">A) Use a "distfile" for a specific release. We use github to maintain our releases. Visit github release page (<a href="https://github.com/Juniper/libxo/releases">https://github.com/Juniper/libxo/releases</a>) to see the list of releases. To download the latest, look for the release with the green "Latest release" button and the green "libxo‑RELEASE.tar.gz" button under that section.</p> -<p id="doc_section_1_1_1_p_3">After downloading that release's distfile, untar it as follows:</p> -<div id="doc_figure_u.4"></div> <pre> +</h2> +<p id="doc_section_2_1_p_1">You can retrieve the source for libxo in two ways:</p> +<p id="doc_section_2_1_p_2">A) Use a "distfile" for a specific release. We use github to maintain our releases. Visit github release page (<a href="https://github.com/Juniper/libxo/releases">https://github.com/Juniper/libxo/releases</a>) to see the list of releases. To download the latest, look for the release with the green "Latest release" button and the green "libxo‑RELEASE.tar.gz" button under that section.</p> +<p id="doc_section_2_1_p_3">After downloading that release's distfile, untar it as follows:</p> +<div id="doc_figure_u.5"></div> <pre> tar -zxf libxo-RELEASE.tar.gz cd libxo-RELEASE - </pre> <p id="doc_section_1_1_1_p_5">[Note: for Solaris users, your "tar" command lacks the "‑z" flag, so you'll need to substitute "gzip -dc "file" | tar xf -" instead of "tar -zxf "file"".]</p> -<p id="doc_section_1_1_1_p_6">B) Use the current build from github. This gives you the most recent source code, which might be less stable than a specific release. To build libxo from the git repo:</p> -<div id="doc_figure_u.5"></div> <pre> + </pre> <p id="doc_section_2_1_p_5">[Note: for Solaris users, your "tar" command lacks the "‑z" flag, so you'll need to substitute "gzip -dc "file" | tar xf -" instead of "tar -zxf "file"".]</p> +<p id="doc_section_2_1_p_6">B) Use the current build from github. This gives you the most recent source code, which might be less stable than a specific release. To build libxo from the git repo:</p> +<div id="doc_figure_u.6"></div> <pre> git clone https://github.com/Juniper/libxo.git cd libxo - </pre> <p id="doc_section_1_1_1_p_8">_BE AWARE_: The github repository does _not_ contain the files generated by "autoreconf", with the notable exception of the "m4" directory. Since these files (depcomp, configure, missing, install-sh, etc) are generated files, we keep them out of the source code repository.</p> -<p id="doc_section_1_1_1_p_9">This means that if you download the a release distfile, these files will be ready and you'll just need to run "configure", but if you download the source code from svn, then you'll need to run "autoreconf" by hand. This step is done for you by the "setup.sh" script, described in the next section.</p> + </pre> <p id="doc_section_2_1_p_8">_BE AWARE_: The github repository does _not_ contain the files generated by "autoreconf", with the notable exception of the "m4" directory. Since these files (depcomp, configure, missing, install-sh, etc) are generated files, we keep them out of the source code repository.</p> +<p id="doc_section_2_1_p_9">This means that if you download the a release distfile, these files will be ready and you'll just need to run "configure", but if you download the source code from svn, then you'll need to run "autoreconf" by hand. This step is done for you by the "setup.sh" script, described in the next section.</p> </div> <div class="content"> -<h3 id="doc_section_1_1_2"> +<h2 id="doc_section_2_2"> <div class="self-section-number"> -<a href="#doc_section_1_1_2">1.1.2</a> </div> +<a href="#doc_section_2_2">2.2</a> </div> <a id="building-libxo" href="#building-libxo">Building libxo</a> -</h3> -<p id="doc_section_1_1_2_p_1">To build libxo, you'll need to set up the build, run the "configure" script, run the "make" command, and run the regression tests.</p> -<p id="doc_section_1_1_2_p_2">The following is a summary of the commands needed. These commands are explained in detail in the rest of this section.</p> -<div id="doc_figure_u.6"></div> <pre> +</h2> +<p id="doc_section_2_2_p_1">To build libxo, you'll need to set up the build, run the "configure" script, run the "make" command, and run the regression tests.</p> +<p id="doc_section_2_2_p_2">The following is a summary of the commands needed. These commands are explained in detail in the rest of this section.</p> *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706081304.v58D41Ce086153>