aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Shafer <phil@FreeBSD.org>2019-05-06 20:15:00 +0000
committerPhil Shafer <phil@FreeBSD.org>2019-05-06 20:15:00 +0000
commit9e479b34558cf3511b48949f314de96011a16895 (patch)
treecff3b3b0a774146b5e51c295352ce18fbe6b2939
parent8daa90e98c625e7920bce78cf8d29bc133b64f54 (diff)
downloadsrc-9e479b34558cf3511b48949f314de96011a16895.tar.gz
src-9e479b34558cf3511b48949f314de96011a16895.zip
Import libxo 1.0.4vendor/Juniper/libxo/1.0.4
Notes
Notes: svn path=/vendor/Juniper/libxo/dist/; revision=347205 svn path=/vendor/Juniper/libxo/1.0.4/; revision=347206; tag=vendor/Juniper/libxo/1.0.4
-rw-r--r--configure.ac2
-rw-r--r--doc/libxo-manual.html2
-rw-r--r--libxo/libxo.c4
-rw-r--r--libxo/xo_explicit.h2
-rw-r--r--tests/core/saved/test_02.E.err1
-rw-r--r--tests/core/saved/test_02.E.out4
-rw-r--r--tests/core/saved/test_02.H.err1
-rw-r--r--tests/core/saved/test_02.H.out2
-rw-r--r--tests/core/saved/test_02.HIPx.err1
-rw-r--r--tests/core/saved/test_02.HIPx.out118
-rw-r--r--tests/core/saved/test_02.HP.err1
-rw-r--r--tests/core/saved/test_02.HP.out2
-rw-r--r--tests/core/saved/test_02.J.err1
-rw-r--r--tests/core/saved/test_02.J.out2
-rw-r--r--tests/core/saved/test_02.JP.err1
-rw-r--r--tests/core/saved/test_02.JP.out4
-rw-r--r--tests/core/saved/test_02.T.err1
-rw-r--r--tests/core/saved/test_02.T.out2
-rw-r--r--tests/core/saved/test_02.X.err1
-rw-r--r--tests/core/saved/test_02.X.out2
-rw-r--r--tests/core/saved/test_02.XP.err1
-rw-r--r--tests/core/saved/test_02.XP.out4
-rw-r--r--tests/core/test_01.c2
-rw-r--r--tests/core/test_02.c8
-rw-r--r--xo/xo.c2
25 files changed, 101 insertions, 70 deletions
diff --git a/configure.ac b/configure.ac
index 03affa949211..852fed5818c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@
#
AC_PREREQ(2.2)
-AC_INIT([libxo], [1.0.2], [phil@juniper.net])
+AC_INIT([libxo], [1.0.4], [phil@juniper.net])
AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
# Support silent build rules. Requires at least automake-1.11.
diff --git a/doc/libxo-manual.html b/doc/libxo-manual.html
index f65bdd18b4ac..485faece05bf 100644
--- a/doc/libxo-manual.html
+++ b/doc/libxo-manual.html
@@ -22011,7 +22011,7 @@ jQuery(function ($) {
</tr>
<tr>
<td class="header left"></td>
-<td class="header right">April 2, 2019</td>
+<td class="header right">April 24, 2019</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>
diff --git a/libxo/libxo.c b/libxo/libxo.c
index 8666e3b4a269..a70768814c1b 100644
--- a/libxo/libxo.c
+++ b/libxo/libxo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2018, Juniper Networks, Inc.
+ * Copyright (c) 2014-2019, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
@@ -600,7 +600,7 @@ xo_no_setlocale (void)
static const char *
xo_xml_leader_len (xo_handle_t *xop, const char *name, xo_ssize_t nlen)
{
- if (isalpha(name[0]) || name[0] == '_')
+ if (name == NULL || isalpha(name[0]) || name[0] == '_')
return "";
xo_failure(xop, "invalid XML tag name: '%.*s'", nlen, name);
diff --git a/libxo/xo_explicit.h b/libxo/xo_explicit.h
index e2133e75f70e..2611cf13ce72 100644
--- a/libxo/xo_explicit.h
+++ b/libxo/xo_explicit.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Juniper Networks, Inc.
+ * Copyright (c) 2019, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
diff --git a/tests/core/saved/test_02.E.err b/tests/core/saved/test_02.E.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.E.err
+++ b/tests/core/saved/test_02.E.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.E.out b/tests/core/saved/test_02.E.out
index 6cc40e4d5da2..499b5abc7105 100644
--- a/tests/core/saved/test_02.E.out
+++ b/tests/core/saved/test_02.E.out
@@ -1,6 +1,10 @@
op create: [] [] [0]
op open_container: [top] [] [0x40010]
op open_container: [data] [] [0x40010]
+op string: [name] [em0] [0x1080]
+op string: [flags] [0x8843] [0x18]
+op string: [name] [em0] [0x1088]
+op string: [flags] [0x8843] [0x18]
op string: [what] [braces] [0]
op string: [length] [abcdef] [0]
op content: [fd] [-1] [0]
diff --git a/tests/core/saved/test_02.H.err b/tests/core/saved/test_02.H.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.H.err
+++ b/tests/core/saved/test_02.H.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.H.out b/tests/core/saved/test_02.H.out
index f1387a645a4e..66a158502766 100644
--- a/tests/core/saved/test_02.H.out
+++ b/tests/core/saved/test_02.H.out
@@ -1,4 +1,4 @@
-<div class="line"><div class="text">We are </div><div class="text">{emit}</div><div class="text">{ting}</div><div class="text"> some </div><div class="data" data-tag="what">braces</div></div><div class="line"><div class="message">abcdef
+<div class="line"><div class="data" data-tag="name">em0 </div><div class="data">em0 </div><div class="text">We are </div><div class="text">{emit}</div><div class="text">{ting}</div><div class="text"> some </div><div class="data" data-tag="what">braces</div></div><div class="line"><div class="message">abcdef
</div></div><div class="line"><div class="message">abcdef: Bad file descriptor
</div></div><div class="line"><div class="message">improper use of profanity; ten yard penalty; first down
</div></div><div class="line"><div class="text">length </div><div class="data" data-tag="length">abcdef</div></div><div class="line"><div class="text">close </div><div class="data" data-tag="fd">-1</div><div class="text"> returned </div><div class="data" data-tag="error">Bad file descriptor</div><div class="text"> </div><div class="data" data-tag="test">good</div></div><div class="line"><div class="text">close </div><div class="data" data-tag="fd">-1</div><div class="text"> returned </div><div class="data" data-tag="error">Bad fi</div><div class="text"> </div><div class="data" data-tag="test">good</div></div><div class="line"><div class="message">improper use of profanity; ten yard penalty; first down
diff --git a/tests/core/saved/test_02.HIPx.err b/tests/core/saved/test_02.HIPx.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.HIPx.err
+++ b/tests/core/saved/test_02.HIPx.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.HIPx.out b/tests/core/saved/test_02.HIPx.out
index 7af26b39c1ae..e2b51086d9b6 100644
--- a/tests/core/saved/test_02.HIPx.out
+++ b/tests/core/saved/test_02.HIPx.out
@@ -1,9 +1,11 @@
<div class="line">
+ <div class="data" data-tag="name" data-xpath="/top/data/name">em0 </div>
+ <div class="data">em0 </div>
<div class="text">We are </div>
<div class="text">{emit}</div>
<div class="text">{ting}</div>
<div class="text"> some </div>
- <div class="data" data-tag="what" data-xpath="/top/data/what">braces</div>
+ <div class="data" data-tag="what" data-xpath="/top/data[name = 'em0 '][name = 'em0']/what">braces</div>
</div>
<div class="line">
<div class="message">abcdef
@@ -19,23 +21,23 @@
</div>
<div class="line">
<div class="text">length </div>
- <div class="data" data-tag="length" data-xpath="/top/data/length">abcdef</div>
+ <div class="data" data-tag="length" data-xpath="/top/data[name = 'em0 '][name = 'em0']/length">abcdef</div>
</div>
<div class="line">
<div class="text">close </div>
- <div class="data" data-tag="fd" data-xpath="/top/data/fd">-1</div>
+ <div class="data" data-tag="fd" data-xpath="/top/data[name = 'em0 '][name = 'em0']/fd">-1</div>
<div class="text"> returned </div>
- <div class="data" data-tag="error" data-xpath="/top/data/error">Bad file descriptor</div>
+ <div class="data" data-tag="error" data-xpath="/top/data[name = 'em0 '][name = 'em0']/error">Bad file descriptor</div>
<div class="text"> </div>
- <div class="data" data-tag="test" data-xpath="/top/data/test">good</div>
+ <div class="data" data-tag="test" data-xpath="/top/data[name = 'em0 '][name = 'em0']/test">good</div>
</div>
<div class="line">
<div class="text">close </div>
- <div class="data" data-tag="fd" data-xpath="/top/data/fd">-1</div>
+ <div class="data" data-tag="fd" data-xpath="/top/data[name = 'em0 '][name = 'em0']/fd">-1</div>
<div class="text"> returned </div>
- <div class="data" data-tag="error" data-xpath="/top/data/error">Bad fi</div>
+ <div class="data" data-tag="error" data-xpath="/top/data[name = 'em0 '][name = 'em0']/error">Bad fi</div>
<div class="text"> </div>
- <div class="data" data-tag="test" data-xpath="/top/data/test">good</div>
+ <div class="data" data-tag="test" data-xpath="/top/data[name = 'em0 '][name = 'em0']/test">good</div>
</div>
<div class="line">
<div class="message">improper use of profanity; ten yard penalty; first down
@@ -43,155 +45,155 @@
</div>
<div class="line">
<div class="text"> </div>
- <div class="data" data-tag="lines" data-xpath="/top/data/lines"> 20</div>
+ <div class="data" data-tag="lines" data-xpath="/top/data[name = 'em0 '][name = 'em0']/lines"> 20</div>
<div class="text"> </div>
- <div class="data" data-tag="words" data-xpath="/top/data/words"> 30</div>
+ <div class="data" data-tag="words" data-xpath="/top/data[name = 'em0 '][name = 'em0']/words"> 30</div>
<div class="text"> </div>
- <div class="data" data-tag="characters" data-xpath="/top/data/characters"> 40</div>
+ <div class="data" data-tag="characters" data-xpath="/top/data[name = 'em0 '][name = 'em0']/characters"> 40</div>
<div class="text"> </div>
- <div class="data" data-tag="filename" data-xpath="/top/data/filename">file</div>
+ <div class="data" data-tag="filename" data-xpath="/top/data[name = 'em0 '][name = 'em0']/filename">file</div>
</div>
<div class="line">
- <div class="data" data-tag="bytes" data-xpath="/top/data/bytes">0</div>
+ <div class="data" data-tag="bytes" data-xpath="/top/data[name = 'em0 '][name = 'em0']/bytes">0</div>
<div class="padding"> </div>
<div class="note">bytes</div>
</div>
<div class="line">
- <div class="data" data-tag="bytes" data-xpath="/top/data/bytes">1</div>
+ <div class="data" data-tag="bytes" data-xpath="/top/data[name = 'em0 '][name = 'em0']/bytes">1</div>
<div class="padding"> </div>
<div class="note">byte</div>
</div>
<div class="line">
- <div class="data" data-tag="bytes" data-xpath="/top/data/bytes">2</div>
+ <div class="data" data-tag="bytes" data-xpath="/top/data[name = 'em0 '][name = 'em0']/bytes">2</div>
<div class="padding"> </div>
<div class="note">bytes</div>
</div>
<div class="line">
- <div class="data" data-tag="bytes" data-xpath="/top/data/bytes">3</div>
+ <div class="data" data-tag="bytes" data-xpath="/top/data[name = 'em0 '][name = 'em0']/bytes">3</div>
<div class="padding"> </div>
<div class="note">bytes</div>
</div>
<div class="line">
- <div class="data" data-tag="bytes" data-xpath="/top/data/bytes">4</div>
+ <div class="data" data-tag="bytes" data-xpath="/top/data[name = 'em0 '][name = 'em0']/bytes">4</div>
<div class="padding"> </div>
<div class="note">bytes</div>
</div>
<div class="line">
- <div class="data" data-tag="mbuf-current" data-xpath="/top/data/mbuf-current">10</div>
+ <div class="data" data-tag="mbuf-current" data-xpath="/top/data[name = 'em0 '][name = 'em0']/mbuf-current">10</div>
<div class="text">/</div>
- <div class="data" data-tag="mbuf-cache" data-xpath="/top/data/mbuf-cache">20</div>
+ <div class="data" data-tag="mbuf-cache" data-xpath="/top/data[name = 'em0 '][name = 'em0']/mbuf-cache">20</div>
<div class="text">/</div>
- <div class="data" data-tag="mbuf-total" data-xpath="/top/data/mbuf-total">30</div>
+ <div class="data" data-tag="mbuf-total" data-xpath="/top/data[name = 'em0 '][name = 'em0']/mbuf-total">30</div>
<div class="text"> </div>
<div class="note">mbufs &lt;&amp;&gt; in use (current/cache/total)</div>
</div>
<div class="line">
- <div class="data" data-tag="distance" data-units="miles" data-xpath="/top/data/distance">50</div>
+ <div class="data" data-tag="distance" data-units="miles" data-xpath="/top/data[name = 'em0 '][name = 'em0']/distance">50</div>
<div class="padding"> </div>
<div class="text"> from </div>
- <div class="data" data-tag="location" data-xpath="/top/data/location">Boston</div>
+ <div class="data" data-tag="location" data-xpath="/top/data[name = 'em0 '][name = 'em0']/location">Boston</div>
</div>
<div class="line">
- <div class="data" data-tag="memory" data-units="k" data-xpath="/top/data/memory">64</div>
+ <div class="data" data-tag="memory" data-units="k" data-xpath="/top/data[name = 'em0 '][name = 'em0']/memory">64</div>
<div class="text"> left out of </div>
- <div class="data" data-tag="total" data-units="kb" data-xpath="/top/data/total">640</div>
+ <div class="data" data-tag="total" data-units="kb" data-xpath="/top/data[name = 'em0 '][name = 'em0']/total">640</div>
</div>
<div class="line">
- <div class="data" data-tag="memory" data-units="k" data-xpath="/top/data/memory">64</div>
+ <div class="data" data-tag="memory" data-units="k" data-xpath="/top/data[name = 'em0 '][name = 'em0']/memory">64</div>
<div class="text"> left out of </div>
- <div class="data" data-tag="total" data-units="kilobytes" data-xpath="/top/data/total">640</div>
+ <div class="data" data-tag="total" data-units="kilobytes" data-xpath="/top/data[name = 'em0 '][name = 'em0']/total">640</div>
</div>
<div class="line">
<div class="title">beforeworkingafter:</div>
</div>
<div class="line">
- <div class="data" data-tag="some" data-xpath="/top/data/some">string</div>
+ <div class="data" data-tag="some" data-xpath="/top/data[name = 'em0 '][name = 'em0']/some">string</div>
<div class="decoration">:</div>
<div class="padding"> </div>
- <div class="data" data-tag="ten" data-xpath="/top/data/ten">10</div>
- <div class="data" data-tag="eleven" data-xpath="/top/data/eleven">11</div>
+ <div class="data" data-tag="ten" data-xpath="/top/data[name = 'em0 '][name = 'em0']/ten">10</div>
+ <div class="data" data-tag="eleven" data-xpath="/top/data[name = 'em0 '][name = 'em0']/eleven">11</div>
</div>
<div class="line">
- <div class="data" data-tag="unknown" data-xpath="/top/data/unknown">1010</div>
+ <div class="data" data-tag="unknown" data-xpath="/top/data[name = 'em0 '][name = 'em0']/unknown">1010</div>
<div class="text"> </div>
<div class="note">packets here/there/everywhere</div>
</div>
<div class="line">
- <div class="data" data-tag="unknown" data-xpath="/top/data/unknown">1010</div>
+ <div class="data" data-tag="unknown" data-xpath="/top/data[name = 'em0 '][name = 'em0']/unknown">1010</div>
<div class="text"> </div>
<div class="note">packets here/there/everywhere</div>
</div>
<div class="line">
<div class="text">(</div>
<div class="padding"> </div>
- <div class="data" data-tag="min" data-xpath="/top/data/min">15</div>
+ <div class="data" data-tag="min" data-xpath="/top/data[name = 'em0 '][name = 'em0']/min">15</div>
<div class="text">/</div>
- <div class="data" data-tag="cur" data-xpath="/top/data/cur">20</div>
+ <div class="data" data-tag="cur" data-xpath="/top/data[name = 'em0 '][name = 'em0']/cur">20</div>
<div class="text">/</div>
- <div class="data" data-tag="max" data-xpath="/top/data/max">125</div>
+ <div class="data" data-tag="max" data-xpath="/top/data[name = 'em0 '][name = 'em0']/max">125</div>
<div class="text">)</div>
</div>
<div class="line">
<div class="text">(</div>
<div class="padding"> </div>
- <div class="data" data-tag="min" data-xpath="/top/data/min">15</div>
+ <div class="data" data-tag="min" data-xpath="/top/data[name = 'em0 '][name = 'em0']/min">15</div>
<div class="text">/</div>
- <div class="data" data-tag="cur" data-xpath="/top/data/cur">20</div>
+ <div class="data" data-tag="cur" data-xpath="/top/data[name = 'em0 '][name = 'em0']/cur">20</div>
<div class="text">/</div>
- <div class="data" data-tag="max" data-xpath="/top/data/max">125</div>
+ <div class="data" data-tag="max" data-xpath="/top/data[name = 'em0 '][name = 'em0']/max">125</div>
<div class="text">)</div>
</div>
<div class="line">
<div class="text">(</div>
- <div class="data" data-tag="min" data-xpath="/top/data/min">15</div>
+ <div class="data" data-tag="min" data-xpath="/top/data[name = 'em0 '][name = 'em0']/min">15</div>
<div class="text">/</div>
- <div class="data" data-tag="cur" data-xpath="/top/data/cur">20</div>
+ <div class="data" data-tag="cur" data-xpath="/top/data[name = 'em0 '][name = 'em0']/cur">20</div>
<div class="text">/</div>
- <div class="data" data-tag="max" data-xpath="/top/data/max">125</div>
+ <div class="data" data-tag="max" data-xpath="/top/data[name = 'em0 '][name = 'em0']/max">125</div>
<div class="padding"> </div>
<div class="text">)</div>
</div>
<div class="line">
<div class="text">(</div>
- <div class="data" data-tag="min" data-xpath="/top/data/min">15</div>
+ <div class="data" data-tag="min" data-xpath="/top/data[name = 'em0 '][name = 'em0']/min">15</div>
<div class="text">/</div>
- <div class="data" data-tag="cur" data-xpath="/top/data/cur">20</div>
+ <div class="data" data-tag="cur" data-xpath="/top/data[name = 'em0 '][name = 'em0']/cur">20</div>
<div class="text">/</div>
- <div class="data" data-tag="max" data-xpath="/top/data/max">125</div>
+ <div class="data" data-tag="max" data-xpath="/top/data[name = 'em0 '][name = 'em0']/max">125</div>
<div class="padding"> </div>
<div class="text">)</div>
</div>
<div class="line">
<div class="text">Humanize: </div>
- <div class="data" data-tag="val1" data-xpath="/top/data/val1" data-number="21">21</div>
+ <div class="data" data-tag="val1" data-xpath="/top/data[name = 'em0 '][name = 'em0']/val1" data-number="21">21</div>
<div class="text">, </div>
- <div class="data" data-tag="val2" data-xpath="/top/data/val2" data-number="58368">57 K</div>
+ <div class="data" data-tag="val2" data-xpath="/top/data[name = 'em0 '][name = 'em0']/val2" data-number="58368">57 K</div>
<div class="text">, </div>
- <div class="data" data-tag="val3" data-xpath="/top/data/val3" data-number="100663296">96M</div>
+ <div class="data" data-tag="val3" data-xpath="/top/data[name = 'em0 '][name = 'em0']/val3" data-number="100663296">96M</div>
<div class="text">, </div>
- <div class="data" data-tag="val4" data-xpath="/top/data/val4" data-number="44470272">44M</div>
+ <div class="data" data-tag="val4" data-xpath="/top/data[name = 'em0 '][name = 'em0']/val4" data-number="44470272">44M</div>
<div class="text">, </div>
- <div class="data" data-tag="val5" data-xpath="/top/data/val5" data-number="1342172800">1.2G</div>
+ <div class="data" data-tag="val5" data-xpath="/top/data[name = 'em0 '][name = 'em0']/val5" data-number="1342172800">1.2G</div>
</div>
<div class="line">
- <div class="data" data-tag="flag" data-xpath="/top/data/flag">one</div>
+ <div class="data" data-tag="flag" data-xpath="/top/data[name = 'em0 '][name = 'em0']/flag">one</div>
<div class="text"> </div>
- <div class="data" data-tag="flag" data-xpath="/top/data/flag">two</div>
+ <div class="data" data-tag="flag" data-xpath="/top/data[name = 'em0 '][name = 'em0']/flag">two</div>
<div class="text"> </div>
- <div class="data" data-tag="flag" data-xpath="/top/data/flag">three</div>
+ <div class="data" data-tag="flag" data-xpath="/top/data[name = 'em0 '][name = 'em0']/flag">three</div>
</div>
<div class="line">
- <div class="data" data-tag="works" data-xpath="/top/data/works">(null)</div>
+ <div class="data" data-tag="works" data-xpath="/top/data[name = 'em0 '][name = 'em0']/works">(null)</div>
</div>
<div class="line">
<div class="text">1:</div>
- <div class="data" data-tag="t1" data-xpath="/top/data/t1"> 1000</div>
+ <div class="data" data-tag="t1" data-xpath="/top/data[name = 'em0 '][name = 'em0']/t1"> 1000</div>
<div class="text"> 2:</div>
- <div class="data" data-tag="t2" data-xpath="/top/data/t2">test5000 </div>
+ <div class="data" data-tag="t2" data-xpath="/top/data[name = 'em0 '][name = 'em0']/t2">test5000 </div>
<div class="text"> 3:</div>
- <div class="data" data-tag="t3" data-xpath="/top/data/t3"> ten-longx</div>
+ <div class="data" data-tag="t3" data-xpath="/top/data[name = 'em0 '][name = 'em0']/t3"> ten-longx</div>
<div class="text"> 4:</div>
- <div class="data" data-tag="t4" data-xpath="/top/data/t4">xtest </div>
+ <div class="data" data-tag="t4" data-xpath="/top/data[name = 'em0 '][name = 'em0']/t4">xtest </div>
</div>
<div class="line">
<div class="error">this is an error</div>
@@ -208,10 +210,10 @@
<div class="line">
<div class="label">V1/V2 packets</div>
<div class="text">: </div>
- <div class="data" data-tag="count" data-xpath="/top/data/count">10</div>
+ <div class="data" data-tag="count" data-xpath="/top/data[name = 'em0 '][name = 'em0']/count">10</div>
</div>
<div class="line">
- <div class="data" data-tag="test" data-xpath="/top/data/test">0004</div>
+ <div class="data" data-tag="test" data-xpath="/top/data[name = 'em0 '][name = 'em0']/test">0004</div>
<div class="text"> </div>
<div class="label">tries</div>
</div>
diff --git a/tests/core/saved/test_02.HP.err b/tests/core/saved/test_02.HP.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.HP.err
+++ b/tests/core/saved/test_02.HP.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.HP.out b/tests/core/saved/test_02.HP.out
index f7c9d9b44feb..2a4b954c94ed 100644
--- a/tests/core/saved/test_02.HP.out
+++ b/tests/core/saved/test_02.HP.out
@@ -1,4 +1,6 @@
<div class="line">
+ <div class="data" data-tag="name">em0 </div>
+ <div class="data">em0 </div>
<div class="text">We are </div>
<div class="text">{emit}</div>
<div class="text">{ting}</div>
diff --git a/tests/core/saved/test_02.J.err b/tests/core/saved/test_02.J.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.J.err
+++ b/tests/core/saved/test_02.J.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.J.out b/tests/core/saved/test_02.J.out
index 65732c5c28d7..d6d175339c74 100644
--- a/tests/core/saved/test_02.J.out
+++ b/tests/core/saved/test_02.J.out
@@ -1 +1 @@
-{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}}}
+{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}}}
diff --git a/tests/core/saved/test_02.JP.err b/tests/core/saved/test_02.JP.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.JP.err
+++ b/tests/core/saved/test_02.JP.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.JP.out b/tests/core/saved/test_02.JP.out
index 9e40703c6133..cf211401be6f 100644
--- a/tests/core/saved/test_02.JP.out
+++ b/tests/core/saved/test_02.JP.out
@@ -1,6 +1,10 @@
{
"top": {
"data": {
+ "name": "em0",
+ "flags": "0x8843",
+ "name": "em0",
+ "flags": "0x8843",
"what": "braces",
"length": "abcdef",
"fd": -1,
diff --git a/tests/core/saved/test_02.T.err b/tests/core/saved/test_02.T.err
index 80fabe31c770..bae8367624fa 100644
--- a/tests/core/saved/test_02.T.err
+++ b/tests/core/saved/test_02.T.err
@@ -1 +1,2 @@
+test_02.test: key field emitted after normal value field: 'name'
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
diff --git a/tests/core/saved/test_02.T.out b/tests/core/saved/test_02.T.out
index d65e7c50e9b9..5b22c1615bb2 100644
--- a/tests/core/saved/test_02.T.out
+++ b/tests/core/saved/test_02.T.out
@@ -1,4 +1,4 @@
-We are {emit}{ting} some braces
+em0 em0 We are {emit}{ting} some braces
abcdef
abcdef: Bad file descriptor
improper use of profanity; ten yard penalty; first down
diff --git a/tests/core/saved/test_02.X.err b/tests/core/saved/test_02.X.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.X.err
+++ b/tests/core/saved/test_02.X.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.X.out b/tests/core/saved/test_02.X.out
index 49e9355514e2..2eb122d00c8c 100644
--- a/tests/core/saved/test_02.X.out
+++ b/tests/core/saved/test_02.X.out
@@ -1,4 +1,4 @@
-<top><data><what>braces</what><message>abcdef
+<top><data><name>em0</name><flags>0x8843</flags><name>em0</name><flags>0x8843</flags><what>braces</what><message>abcdef
</message><message>abcdef: Bad file descriptor
</message><message>improper use of profanity; ten yard penalty; first down
</message><length>abcdef</length><fd>-1</fd><error>Bad file descriptor</error><test>good</test><fd>-1</fd><error>Bad fi</error><test>good</test><message>improper use of profanity; ten yard penalty; first down
diff --git a/tests/core/saved/test_02.XP.err b/tests/core/saved/test_02.XP.err
index e69de29bb2d1..4bd358b88132 100644
--- a/tests/core/saved/test_02.XP.err
+++ b/tests/core/saved/test_02.XP.err
@@ -0,0 +1 @@
+test_02.test: key field emitted after normal value field: 'name'
diff --git a/tests/core/saved/test_02.XP.out b/tests/core/saved/test_02.XP.out
index e5172d35fd8e..9c18c5edca4f 100644
--- a/tests/core/saved/test_02.XP.out
+++ b/tests/core/saved/test_02.XP.out
@@ -1,5 +1,9 @@
<top>
<data>
+ <name>em0</name>
+ <flags>0x8843</flags>
+ <name>em0</name>
+ <flags>0x8843</flags>
<what>braces</what>
<message>abcdef
</message>
diff --git a/tests/core/test_01.c b/tests/core/test_01.c
index dfadc754cab3..2957472464b7 100644
--- a/tests/core/test_01.c
+++ b/tests/core/test_01.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Juniper Networks, Inc.
+ * Copyright (c) 2014-2019, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
diff --git a/tests/core/test_02.c b/tests/core/test_02.c
index cf98d34f1f4b..b3d5ca92e201 100644
--- a/tests/core/test_02.c
+++ b/tests/core/test_02.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Juniper Networks, Inc.
+ * Copyright (c) 2014-2019, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
@@ -48,6 +48,12 @@ main (int argc, char **argv)
xo_open_container("data");
+ xo_emit("{kt:name/%-*.*s}{eq:flags/0x%x}",
+ 5, 5, "em0", 34883);
+
+ xo_emit("{d:/%-*.*s}{etk:name}{eq:flags/0x%x}",
+ 5, 5, "em0", "em0", 34883);
+
xo_emit("We are {{emit}}{{ting}} some {:what}\n", "braces");
xo_message("abcdef");
diff --git a/xo/xo.c b/xo/xo.c
index f74a1b25f56a..d17c738cb54f 100644
--- a/xo/xo.c
+++ b/xo/xo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2018, Juniper Networks, Inc.
+ * Copyright (c) 2014-2019, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise