Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Shafer committed Jun 3, 2021
2 parents 6a0667b + ba3eed4 commit ba01cd3
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bin/Zaliases
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set top_src=`pwd`
alias Zautoreconf "(cd $top_src ; autoreconf --install)"

set ZENV=""

switch ( `uname` )
case FreeBSD*:
set ZENV="MAKE=gmake "
Expand Down
5 changes: 5 additions & 0 deletions doc/field-roles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ Labels are text that appears before a value::

xo_emit("{Lwc:Cost}{:cost/%u}\n", cost);

If a label needs to include a slash, it must be escaped using two
backslashes, one for the C compiler and one for libxo::

xo_emit("{Lc:Low\\/warn level}{:level/%s}\n", level);

.. index:: Field Roles; Note
.. _note-role:

Expand Down
7 changes: 7 additions & 0 deletions libxo/xo_format.5
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ Labels are text that appears before a value.
.Bd -literal -offset indent
xo_emit("{Lwc:Cost}{:cost/%u}\\n", cost);
.Ed
.Pp
If a label needs to include a slash, it must be escaped using two
backslashes, one for the C compiler and one for
.Nm libxo .
.Bd -literal -offset indent
xo_emit("{Lc:Low\\\\/warn level}{:level/%s}\\n", level);
.Ed
.Ss "The Note Role ({N:})"
Notes are text that appears after a value.
.Bd -literal -offset indent
Expand Down
1 change: 1 addition & 0 deletions tests/core/saved/test_02.E.out
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ op content: [bytes] [2] [0x2004]
op content: [bytes] [3] [0x2004]
op content: [bytes] [4] [0x2004]
op close_leaf_list: [bytes] [] [0]
op content: [granularity-lw] [155] [0]
op content: [mbuf-current] [10] [0]
op content: [mbuf-cache] [20] [0]
op content: [mbuf-total] [30] [0]
Expand Down
2 changes: 1 addition & 1 deletion tests/core/saved/test_02.H.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
</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
</div></div><div class="line"><div class="text"> </div><div class="data" data-tag="lines"> 20</div><div class="text"> </div><div class="data" data-tag="words"> 30</div><div class="text"> </div><div class="data" data-tag="characters"> 40</div><div class="text"> </div><div class="data" data-tag="filename">file</div></div><div class="line"><div class="data" data-tag="bytes">0</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="data" data-tag="bytes">1</div><div class="padding"> </div><div class="note">byte</div></div><div class="line"><div class="data" data-tag="bytes">2</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="data" data-tag="bytes">3</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="data" data-tag="bytes">4</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="data" data-tag="mbuf-current">10</div><div class="text">/</div><div class="data" data-tag="mbuf-cache">20</div><div class="text">/</div><div class="data" data-tag="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">50</div><div class="padding"> </div><div class="text"> from </div><div class="data" data-tag="location">Boston</div></div><div class="line"><div class="data" data-tag="memory" data-units="k">64</div><div class="text"> left out of </div><div class="data" data-tag="total" data-units="kb">640</div></div><div class="line"><div class="data" data-tag="memory" data-units="k">64</div><div class="text"> left out of </div><div class="data" data-tag="total" data-units="kilobytes">640</div></div><div class="line"><div class="title">beforeworkingafter:</div></div><div class="line"><div class="data" data-tag="some">string</div><div class="decoration">:</div><div class="padding"> </div><div class="data" data-tag="ten">10</div><div class="data" data-tag="eleven">11</div></div><div class="line"><div class="data" data-tag="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">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">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="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">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="max">125</div><div class="text">)</div></div><div class="line"><div class="text">(</div><div class="data" data-tag="min">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="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">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="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-number="21">21</div><div class="text">, </div><div class="data" data-tag="val2" data-number="58368">57 K</div><div class="text">, </div><div class="data" data-tag="val3" data-number="100663296">96M</div><div class="text">, </div><div class="data" data-tag="val4" data-number="44470272">44M</div><div class="text">, </div><div class="data" data-tag="val5" data-number="1342172800">1.2G</div></div><div class="line"><div class="data" data-tag="flag">one</div><div class="text"> </div><div class="data" data-tag="flag">two</div><div class="text"> </div><div class="data" data-tag="flag">three</div></div><div class="line"><div class="data" data-tag="works">(null)</div></div><div class="line"><div class="text">1:</div><div class="data" data-tag="t1"> 1000</div><div class="text"> 2:</div><div class="data" data-tag="t2">test5000 </div><div class="text"> 3:</div><div class="data" data-tag="t3"> ten-longx</div><div class="text"> 4:</div><div class="data" data-tag="t4">xtest </div></div><div class="line"><div class="error">this is an error</div></div><div class="line"><div class="error">two more errors</div></div><div class="line"><div class="warning">this is an warning</div></div><div class="line"><div class="warning">two more warnings</div></div><div class="line"><div class="label">V1/V2 packets</div><div class="text">: </div><div class="data" data-tag="count">10</div></div><div class="line"><div class="data" data-tag="test">0004</div><div class="text"> </div><div class="label">tries</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"> </div><div class="data" data-tag="lines"> 20</div><div class="text"> </div><div class="data" data-tag="words"> 30</div><div class="text"> </div><div class="data" data-tag="characters"> 40</div><div class="text"> </div><div class="data" data-tag="filename">file</div></div><div class="line"><div class="data" data-tag="bytes">0</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="data" data-tag="bytes">1</div><div class="padding"> </div><div class="note">byte</div></div><div class="line"><div class="data" data-tag="bytes">2</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="data" data-tag="bytes">3</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="data" data-tag="bytes">4</div><div class="padding"> </div><div class="note">bytes</div></div><div class="line"><div class="label">Low/warn granularity</div><div class="decoration">:</div><div class="padding"> </div><div class="data" data-tag="granularity-lw" data-units="mAh">155</div><div class="padding"> </div></div><div class="line"><div class="data" data-tag="mbuf-current">10</div><div class="text">/</div><div class="data" data-tag="mbuf-cache">20</div><div class="text">/</div><div class="data" data-tag="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">50</div><div class="padding"> </div><div class="text"> from </div><div class="data" data-tag="location">Boston</div></div><div class="line"><div class="data" data-tag="memory" data-units="k">64</div><div class="text"> left out of </div><div class="data" data-tag="total" data-units="kb">640</div></div><div class="line"><div class="data" data-tag="memory" data-units="k">64</div><div class="text"> left out of </div><div class="data" data-tag="total" data-units="kilobytes">640</div></div><div class="line"><div class="title">beforeworkingafter:</div></div><div class="line"><div class="data" data-tag="some">string</div><div class="decoration">:</div><div class="padding"> </div><div class="data" data-tag="ten">10</div><div class="data" data-tag="eleven">11</div></div><div class="line"><div class="data" data-tag="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">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">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="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">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="max">125</div><div class="text">)</div></div><div class="line"><div class="text">(</div><div class="data" data-tag="min">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="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">15</div><div class="text">/</div><div class="data" data-tag="cur">20</div><div class="text">/</div><div class="data" data-tag="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-number="21">21</div><div class="text">, </div><div class="data" data-tag="val2" data-number="58368">57 K</div><div class="text">, </div><div class="data" data-tag="val3" data-number="100663296">96M</div><div class="text">, </div><div class="data" data-tag="val4" data-number="44470272">44M</div><div class="text">, </div><div class="data" data-tag="val5" data-number="1342172800">1.2G</div></div><div class="line"><div class="data" data-tag="flag">one</div><div class="text"> </div><div class="data" data-tag="flag">two</div><div class="text"> </div><div class="data" data-tag="flag">three</div></div><div class="line"><div class="data" data-tag="works">(null)</div></div><div class="line"><div class="text">1:</div><div class="data" data-tag="t1"> 1000</div><div class="text"> 2:</div><div class="data" data-tag="t2">test5000 </div><div class="text"> 3:</div><div class="data" data-tag="t3"> ten-longx</div><div class="text"> 4:</div><div class="data" data-tag="t4">xtest </div></div><div class="line"><div class="error">this is an error</div></div><div class="line"><div class="error">two more errors</div></div><div class="line"><div class="warning">this is an warning</div></div><div class="line"><div class="warning">two more warnings</div></div><div class="line"><div class="label">V1/V2 packets</div><div class="text">: </div><div class="data" data-tag="count">10</div></div><div class="line"><div class="data" data-tag="test">0004</div><div class="text"> </div><div class="label">tries</div></div><div class="line"><div class="message">improper use of profanity; ten yard penalty; first down
</div></div><div class="line"><div class="error">Shut 'er down, Clancey! She's a-pumpin' mud! &lt;&gt;!,"!&lt;&gt;
</div></div><div class="line"><div class="error">err message (1)</div></div><div class="line"><div class="error">err message (2)
</div></div><div class="line"><div class="error">err message (1)
Expand Down
7 changes: 7 additions & 0 deletions tests/core/saved/test_02.HIPx.out
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
<div class="padding"> </div>
<div class="note">bytes</div>
</div>
<div class="line">
<div class="label">Low/warn granularity</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="granularity-lw" data-units="mAh" data-xpath="/top/data[name = 'em0 '][name = 'em0']/granularity-lw">155</div>
<div class="padding"> </div>
</div>
<div class="line">
<div class="data" data-tag="mbuf-current" data-xpath="/top/data[name = 'em0 '][name = 'em0']/mbuf-current">10</div>
<div class="text">/</div>
Expand Down
7 changes: 7 additions & 0 deletions tests/core/saved/test_02.HP.out
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
<div class="padding"> </div>
<div class="note">bytes</div>
</div>
<div class="line">
<div class="label">Low/warn granularity</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="granularity-lw" data-units="mAh">155</div>
<div class="padding"> </div>
</div>
<div class="line">
<div class="data" data-tag="mbuf-current">10</div>
<div class="text">/</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/core/saved/test_02.J.out
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"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"}, "error": {"message":"err message (1)"}, "error": {"message":"err message (2)\n"}, "error": {"message":"err message (1)\n"}, "error": {"message":"err message (2)\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],"granularity-lw":155,"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"}, "error": {"message":"err message (1)"}, "error": {"message":"err message (2)\n"}, "error": {"message":"err message (1)\n"}, "error": {"message":"err message (2)\n"}}}}
1 change: 1 addition & 0 deletions tests/core/saved/test_02.JP.out
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
3,
4
],
"granularity-lw": 155,
"mbuf-current": 10,
"mbuf-cache": 20,
"mbuf-total": 30,
Expand Down
1 change: 1 addition & 0 deletions tests/core/saved/test_02.JPu.out
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
3,
4
],
"granularity_lw": 155,
"mbuf_current": 10,
"mbuf_cache": 20,
"mbuf_total": 30,
Expand Down
1 change: 1 addition & 0 deletions tests/core/saved/test_02.T.out
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ improper use of profanity; ten yard penalty; first down
2 bytes
3 bytes
4 bytes
Low/warn granularity: 155 mAh
10/20/30 mbufs <&> in use (current/cache/total)
50 miles from Boston
64k left out of 640kb
Expand Down
2 changes: 1 addition & 1 deletion tests/core/saved/test_02.X.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
</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
</message><lines>20</lines><words>30</words><characters>40</characters><bytes>0</bytes><bytes>1</bytes><bytes>2</bytes><bytes>3</bytes><bytes>4</bytes><mbuf-current>10</mbuf-current><mbuf-cache>20</mbuf-cache><mbuf-total>30</mbuf-total><distance units="miles">50</distance><location>Boston</location><memory units="k">64</memory><total units="kb">640</total><memory units="k">64</memory><total units="kilobytes">640</total><ten>10</ten><eleven>11</eleven><unknown>1010</unknown><unknown>1010</unknown><min>15</min><cur>20</cur><max>125</max><min>15</min><cur>20</cur><max>125</max><min>15</min><cur>20</cur><max>125</max><min>15</min><cur>20</cur><max>125</max><val1>21</val1><val2>58368</val2><val3>100663296</val3><val4>44470272</val4><val5>1342172800</val5><flag>one</flag><flag>two</flag><flag>three</flag><works>null</works><empty-tag></empty-tag><t1>1000</t1><t2>test5000</t2><t3>ten-longx</t3><t4>xtest</t4><__error><message>this is an error</message></__error><__error><message>two more errors</message></__error><__warning><message>this is an warning</message></__warning><__warning><message>two more warnings</message></__warning><count>10</count><test>4</test><message>improper use of profanity; ten yard penalty; first down
</message><lines>20</lines><words>30</words><characters>40</characters><bytes>0</bytes><bytes>1</bytes><bytes>2</bytes><bytes>3</bytes><bytes>4</bytes><granularity-lw units="mAh">155</granularity-lw><mbuf-current>10</mbuf-current><mbuf-cache>20</mbuf-cache><mbuf-total>30</mbuf-total><distance units="miles">50</distance><location>Boston</location><memory units="k">64</memory><total units="kb">640</total><memory units="k">64</memory><total units="kilobytes">640</total><ten>10</ten><eleven>11</eleven><unknown>1010</unknown><unknown>1010</unknown><min>15</min><cur>20</cur><max>125</max><min>15</min><cur>20</cur><max>125</max><min>15</min><cur>20</cur><max>125</max><min>15</min><cur>20</cur><max>125</max><val1>21</val1><val2>58368</val2><val3>100663296</val3><val4>44470272</val4><val5>1342172800</val5><flag>one</flag><flag>two</flag><flag>three</flag><works>null</works><empty-tag></empty-tag><t1>1000</t1><t2>test5000</t2><t3>ten-longx</t3><t4>xtest</t4><__error><message>this is an error</message></__error><__error><message>two more errors</message></__error><__warning><message>this is an warning</message></__warning><__warning><message>two more warnings</message></__warning><count>10</count><test>4</test><message>improper use of profanity; ten yard penalty; first down
</message><error><message>Shut 'er down, Clancey! She's a-pumpin' mud! &lt;&gt;!,"!&lt;&gt;
</message></error><error><message>err message (1)</message></error><error><message>err message (2)
</message></error><error><message>err message (1)
Expand Down
Loading

0 comments on commit ba01cd3

Please sign in to comment.