diff --git a/Makefile.am b/Makefile.am index 25024d11a9ad..286bef97b786 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,7 +38,14 @@ GH_PAGES_DIR = gh-pages/ GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz -upload: dist upload-docs +XOHTML_FILES = \ + ${top_srcdir}/xohtml/xohtml.css \ + ${top_srcdir}/xohtml/xohtml.js \ + ${top_srcdir}/xohtml/external/jquery.js \ + ${top_srcdir}/xohtml/external/jquery.qtip.css \ + ${top_srcdir}/xohtml/external/jquery.qtip.js + +upload: dist upload-docs upload-xohtml-files @echo "Remember to run:" @echo " gt tag ${PACKAGE_VERSION}" @@ -56,6 +63,18 @@ upload-docs: docs libxo-manual.html ${PACKAGE_VERSION} \ && git push origin gh-pages ) ; true +upload-xohtml-files: + @echo "Uploading xohtml files ... " + @-[ -d ${GH_PAGES_DIR} ] \ + && echo "Updating xohtml files on gh-pages ..." \ + && mkdir -p ${GH_PAGES_DIR_VER}/xohtml \ + && cp ${XOHTML_FILES} ${GH_PAGES_DIR_VER}/xohtml \ + && (cd ${GH_PAGES_DIR} \ + && git add ${PACKAGE_VERSION}/xohtml \ + && git commit -m 'new xohtml files' \ + ${PACKAGE_VERSION}/xohtml \ + && git push origin gh-pages ) ; true + pkgconfigdir=$(libdir)/pkgconfig pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc diff --git a/configure.ac b/configure.ac index 1cf91469a025..fab8c886706a 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.8.1], [phil@juniper.net]) +AC_INIT([libxo], [0.8.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 ef9def7c38f4..b56ddabbab89 100644 --- a/doc/libxo-manual.html +++ b/doc/libxo-manual.html @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "June 2017"; + content: "August 2017"; } @top-center { @@ -22011,7 +22011,7 @@ jQuery(function ($) { -June 14, 2017 +August 3, 2017

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

diff --git a/libxo/libxo.3 b/libxo/libxo.3 index 4e2488cd5f57..f07962036e07 100644 --- a/libxo/libxo.3 +++ b/libxo/libxo.3 @@ -311,3 +311,13 @@ to use an alternative set of low-level output functions. .Xr xo_set_style 3 , .Xr xo_set_writer 3 , .Xr xo_format 5 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/libxo.c b/libxo/libxo.c index 2b8ba68bd25e..84e9c01a428f 100644 --- a/libxo/libxo.c +++ b/libxo/libxo.c @@ -137,7 +137,7 @@ static const char xo_default_format[] = "%s"; #define XO_INDENT_BY 2 /* Amount to indent when pretty printing */ #define XO_DEPTH 128 /* Default stack depth */ -#define XO_MAX_ANCHOR_WIDTH (8*1024) /* Anything wider is just sillyb */ +#define XO_MAX_ANCHOR_WIDTH (8*1024) /* Anything wider is just silly */ #define XO_FAILURE_NAME "failure" @@ -5071,16 +5071,60 @@ xo_find_width (xo_handle_t *xop, xo_field_info_t *xfip, bp[vlen] = '\0'; width = strtol(bp, &cp, 0); - if (width == LONG_MIN || width == LONG_MAX - || bp == cp || *cp != '\0' ) { + if (width == LONG_MIN || width == LONG_MAX || bp == cp || *cp != '\0') { width = 0; xo_failure(xop, "invalid width for anchor: '%s'", bp); } } else if (flen) { - if (flen != 2 || strncmp("%d", fmt, flen) != 0) - xo_failure(xop, "invalid width format: '%*.*s'", flen, flen, fmt); - if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) - width = va_arg(xop->xo_vap, int); + /* + * We really expect the format for width to be "{:/%d}" or + * "{:/%u}", so if that's the case, we just grab our width off + * the argument list. But we need to avoid optimized logic if + * there's a custom formatter. + */ + if (xop->xo_formatter == NULL && flen == 2 + && strncmp("%d", fmt, flen) == 0) { + if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) + width = va_arg(xop->xo_vap, int); + } else if (xop->xo_formatter == NULL && flen == 2 + && strncmp("%u", fmt, flen) == 0) { + if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) + width = va_arg(xop->xo_vap, unsigned); + } else { + /* + * So we have a format and it's not a simple one like + * "{:/%d}". That means we need to format the field, + * extract the value from the formatted output, and then + * discard that output. + */ + int anchor_was_set = FALSE; + xo_buffer_t *xbp = &xop->xo_data; + ssize_t start_offset = xo_buf_offset(xbp); + bp = xo_buf_cur(xbp); /* Save start of the string */ + cp = NULL; + + if (XOIF_ISSET(xop, XOIF_ANCHOR)) { + XOIF_CLEAR(xop, XOIF_ANCHOR); + anchor_was_set = TRUE; + } + + ssize_t rc = xo_do_format_field(xop, xbp, fmt, flen, 0); + if (rc >= 0) { + xo_buf_append(xbp, "", 1); /* Append a NUL */ + + width = strtol(bp, &cp, 0); + if (width == LONG_MIN || width == LONG_MAX + || bp == cp || *cp != '\0') { + width = 0; + xo_failure(xop, "invalid width for anchor: '%s'", bp); + } + } + + /* Reset the cur pointer to where we found it */ + xbp->xb_curp = xbp->xb_bufp + start_offset; + if (anchor_was_set) + XOIF_SET(xop, XOIF_ANCHOR); + } } return width; @@ -5107,9 +5151,6 @@ static void xo_anchor_start (xo_handle_t *xop, xo_field_info_t *xfip, const char *value, ssize_t vlen) { - if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) - return; - if (XOIF_ISSET(xop, XOIF_ANCHOR)) xo_failure(xop, "the anchor already recording is discarded"); @@ -5129,9 +5170,6 @@ static void xo_anchor_stop (xo_handle_t *xop, xo_field_info_t *xfip, const char *value, ssize_t vlen) { - if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) - return; - if (!XOIF_ISSET(xop, XOIF_ANCHOR)) { xo_failure(xop, "no start anchor"); return; diff --git a/libxo/xo_attr.3 b/libxo/xo_attr.3 index c71377fd17eb..9e61acd3656c 100644 --- a/libxo/xo_attr.3 +++ b/libxo/xo_attr.3 @@ -58,3 +58,13 @@ already emitted in other form. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_create.3 b/libxo/xo_create.3 index bfbadc4e6ed6..03d51764b8ae 100644 --- a/libxo/xo_create.3 +++ b/libxo/xo_create.3 @@ -65,3 +65,13 @@ resources associated with the default handle. .Xr xo_emit 3 , .Xr xo_set_options 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_emit.3 b/libxo/xo_emit.3 index 155ea75d1fdf..eceb38e0aa83 100644 --- a/libxo/xo_emit.3 +++ b/libxo/xo_emit.3 @@ -102,3 +102,13 @@ then the number of display columns consumed by the output will be returned. .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_emit_err.3 b/libxo/xo_emit_err.3 index bb1ca640c6e7..eae44b746c28 100644 --- a/libxo/xo_emit_err.3 +++ b/libxo/xo_emit_err.3 @@ -70,3 +70,13 @@ parameter. .Xr xo_format 5 , .Xr xo_err 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_emit_f.3 b/libxo/xo_emit_f.3 index 087954631516..2edfa79ac9c0 100644 --- a/libxo/xo_emit_f.3 +++ b/libxo/xo_emit_f.3 @@ -109,3 +109,13 @@ for details. .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_err.3 b/libxo/xo_err.3 index 532899ab85ff..87cf2010a8a1 100644 --- a/libxo/xo_err.3 +++ b/libxo/xo_err.3 @@ -72,3 +72,13 @@ parameter. .Xr xo_emit 3 , .Xr xo_emit_err 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_error.3 b/libxo/xo_error.3 index e5c99e9dd923..0330af4142da 100644 --- a/libxo/xo_error.3 +++ b/libxo/xo_error.3 @@ -39,3 +39,13 @@ calls. .Xr printf 3 , .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_finish.3 b/libxo/xo_finish.3 index 221b1c1779b4..f9c6b3de62e2 100644 --- a/libxo/xo_finish.3 +++ b/libxo/xo_finish.3 @@ -37,3 +37,13 @@ especially for the non-TEXT output styles. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_flush.3 b/libxo/xo_flush.3 index e43bae0057e7..a785c68f12ec 100644 --- a/libxo/xo_flush.3 +++ b/libxo/xo_flush.3 @@ -33,3 +33,13 @@ function is used for this. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_format.5 b/libxo/xo_format.5 index b1829c8941dc..5265359866bb 100644 --- a/libxo/xo_format.5 +++ b/libxo/xo_format.5 @@ -965,3 +965,13 @@ names to make that difference more obvious. .Xr libxo 3 , .Xr xolint 1 , .Xr xo_emit 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_message.3 b/libxo/xo_message.3 index 36f014884999..ce979a51dc95 100644 --- a/libxo/xo_message.3 +++ b/libxo/xo_message.3 @@ -66,3 +66,13 @@ and .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_no_setlocale.3 b/libxo/xo_no_setlocale.3 index f91abc005107..da3e8a343fab 100644 --- a/libxo/xo_no_setlocale.3 +++ b/libxo/xo_no_setlocale.3 @@ -41,3 +41,13 @@ function. .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_open_container.3 b/libxo/xo_open_container.3 index e765089a7f69..16cd9c999a17 100644 --- a/libxo/xo_open_container.3 +++ b/libxo/xo_open_container.3 @@ -186,3 +186,13 @@ and the name recorded do not match. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_open_list.3 b/libxo/xo_open_list.3 index 6d65b8f15afc..e4d3080eeb63 100644 --- a/libxo/xo_open_list.3 +++ b/libxo/xo_open_list.3 @@ -156,3 +156,13 @@ are rendered as multiple leaf elements. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_open_marker.3 b/libxo/xo_open_marker.3 index e7356ba6e6f6..2df3bff1535f 100644 --- a/libxo/xo_open_marker.3 +++ b/libxo/xo_open_marker.3 @@ -103,3 +103,13 @@ properly. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_options.7 b/libxo/xo_options.7 index 5e86668d009f..297dcba92a41 100644 --- a/libxo/xo_options.7 +++ b/libxo/xo_options.7 @@ -145,3 +145,12 @@ The following are three example invocations of .Sh SEE ALSO .Xr libxo 3 , .Xr xo_format 5 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . diff --git a/libxo/xo_parse_args.3 b/libxo/xo_parse_args.3 index 487b50bafb9b..b014e608a0d3 100644 --- a/libxo/xo_parse_args.3 +++ b/libxo/xo_parse_args.3 @@ -150,3 +150,13 @@ must be maintained by the caller. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_allocator.3 b/libxo/xo_set_allocator.3 index c20a0f5230e5..c0e731ec2131 100644 --- a/libxo/xo_set_allocator.3 +++ b/libxo/xo_set_allocator.3 @@ -52,3 +52,13 @@ functions are used. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_flags.3 b/libxo/xo_set_flags.3 index 52997c5ec1c1..a4c5754656cb 100644 --- a/libxo/xo_set_flags.3 +++ b/libxo/xo_set_flags.3 @@ -137,3 +137,13 @@ handle. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_info.3 b/libxo/xo_set_info.3 index 8ea06570a68e..c9c653f7597b 100644 --- a/libxo/xo_set_info.3 +++ b/libxo/xo_set_info.3 @@ -100,3 +100,13 @@ and "data-help" attributes: .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_options.3 b/libxo/xo_set_options.3 index 5b7c8eda72a5..bb44c9ca8207 100644 --- a/libxo/xo_set_options.3 +++ b/libxo/xo_set_options.3 @@ -29,3 +29,13 @@ The options are identical to those listed in .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_style.3 b/libxo/xo_set_style.3 index 8e34033a5953..6cac9cdc5319 100644 --- a/libxo/xo_set_style.3 +++ b/libxo/xo_set_style.3 @@ -51,3 +51,13 @@ The name can be any of the styles: "text", "xml", "json", or "html". .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_syslog_enterprise_id.3 b/libxo/xo_set_syslog_enterprise_id.3 index da2eed73a939..79eda02dd568 100644 --- a/libxo/xo_set_syslog_enterprise_id.3 +++ b/libxo/xo_set_syslog_enterprise_id.3 @@ -34,3 +34,13 @@ https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers .Sh SEE ALSO .Xr xo_syslog 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_version.3 b/libxo/xo_set_version.3 index 5f9394d5c6d6..271d2357a200 100644 --- a/libxo/xo_set_version.3 +++ b/libxo/xo_set_version.3 @@ -32,3 +32,13 @@ is in use. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_set_writer.3 b/libxo/xo_set_writer.3 index 2f93bd94a44f..22c8ee91083b 100644 --- a/libxo/xo_set_writer.3 +++ b/libxo/xo_set_writer.3 @@ -54,3 +54,13 @@ flush any pending data associated with the opaque pointer. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/libxo/xo_syslog.3 b/libxo/xo_syslog.3 index db92d3693c53..c56c1dcc64c8 100644 --- a/libxo/xo_syslog.3 +++ b/libxo/xo_syslog.3 @@ -77,3 +77,13 @@ function names. .Xr xo_set_syslog_enterprise_id 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/tests/core/saved/test_01.E.out b/tests/core/saved/test_01.E.out index 40d9ec67f5eb..a4ed657c46fa 100644 --- a/tests/core/saved/test_01.E.out +++ b/tests/core/saved/test_01.E.out @@ -1,5 +1,11 @@ op create: [] [] [0] op open_container: [top] [] [0x810] +op content: [address] [0x0] [0] +op content: [port] [1] [0] +op content: [address] [0x0] [0] +op content: [port] [1] [0] +op content: [address] [0x0] [0] +op content: [port] [1] [0] op content: [used-percent] [12] [0] op content: [kve_start] [0xdeadbeef] [0x8] op content: [kve_end] [0xcabb1e] [0x8] diff --git a/tests/core/saved/test_01.H.out b/tests/core/saved/test_01.H.out index 7622c97a31ff..ebe75e6ccc8a 100644 --- a/tests/core/saved/test_01.H.out +++ b/tests/core/saved/test_01.H.out @@ -1,2 +1,2 @@ -
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42 +
anchor
0x0
..
1
anchor
0x0
..
1
anchor
0x0
..
1
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42
Connecting to
my-box
.
example.com
...
Item
Total Sold
In Stock
On Order
SKU
gum
1412
54
10
GRO-000-415
rope
85
4
2
HRD-000-212
ladder
0
2
1
HRD-000-517
bolt
4123
144
42
HRD-000-632
water
17
14
2
GRO-000-2331
Item
'
gum
':
Total sold
:
1412.0
In stock
:
54
On order
:
10
SKU
:
GRO-000-415
Item
'
rope
':
Total sold
:
85.0
In stock
:
4
On order
:
2
SKU
:
HRD-000-212
Item
'
ladder
':
Total sold
:
0
In stock
:
2
On order
:
1
SKU
:
HRD-000-517
Item
'
bolt
':
Total sold
:
4123.0
In stock
:
144
On order
:
42
SKU
:
HRD-000-632
Item
'
water
':
Total sold
:
17.0
In stock
:
14
On order
:
2
SKU
:
GRO-000-2331
Item
'
fish
':
Total sold
:
1321.0
In stock
:
45
On order
:
1
SKU
:
GRO-000-533
Item
:
gum
Item
:
rope
Item
:
ladder
Item
:
bolt
Item
:
water
X
X
X
X
X
X
X
X
X
X
Cost
:
425
X
X
Cost
:
455
links
user
group
3
this
/some/file
1
user
group
\ No newline at end of file diff --git a/tests/core/saved/test_01.HIPx.out b/tests/core/saved/test_01.HIPx.out index 94c387ea8d08..d96b855f475e 100644 --- a/tests/core/saved/test_01.HIPx.out +++ b/tests/core/saved/test_01.HIPx.out @@ -1,3 +1,24 @@ +
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
df
12
diff --git a/tests/core/saved/test_01.HP.out b/tests/core/saved/test_01.HP.out index 044bd4430496..3253aa056d2d 100644 --- a/tests/core/saved/test_01.HP.out +++ b/tests/core/saved/test_01.HP.out @@ -1,3 +1,24 @@ +
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
df
12
diff --git a/tests/core/saved/test_01.J.out b/tests/core/saved/test_01.J.out index 897a7d28958e..ad73058ca687 100644 --- a/tests/core/saved/test_01.J.out +++ b/tests/core/saved/test_01.J.out @@ -1,2 +1,2 @@ -{"top": {"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} +{"top": {"address":"0x0","port":1,"address":"0x0","port":1,"address":"0x0","port":1,"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} } diff --git a/tests/core/saved/test_01.JP.out b/tests/core/saved/test_01.JP.out index 885f30e59f99..6aeef1640f1c 100644 --- a/tests/core/saved/test_01.JP.out +++ b/tests/core/saved/test_01.JP.out @@ -1,5 +1,11 @@ { "top": { + "address": "0x0", + "port": 1, + "address": "0x0", + "port": 1, + "address": "0x0", + "port": 1, "used-percent": 12, "kve_start": "0xdeadbeef", "kve_end": "0xcabb1e", diff --git a/tests/core/saved/test_01.T.out b/tests/core/saved/test_01.T.out index 5a4673f7d8bc..d45427089dce 100644 --- a/tests/core/saved/test_01.T.out +++ b/tests/core/saved/test_01.T.out @@ -1,3 +1,6 @@ +anchor 0x0..1 +anchor 0x0..1 +anchor 0x0..1 df 12% testing argument modifier my-box.example.com... testing argument modifier with encoding to .example.com... diff --git a/tests/core/saved/test_01.X.out b/tests/core/saved/test_01.X.out index 6c5afaca81ae..226a4a4e0e6f 100644 --- a/tests/core/saved/test_01.X.out +++ b/tests/core/saved/test_01.X.out @@ -1 +1 @@ -120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gumropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file +
0x0
1
0x0
1
0x0
1120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gumropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file diff --git a/tests/core/saved/test_01.XP.out b/tests/core/saved/test_01.XP.out index 2aa52ace6e65..1e1be56ec009 100644 --- a/tests/core/saved/test_01.XP.out +++ b/tests/core/saved/test_01.XP.out @@ -1,4 +1,10 @@ +
0x0
+ 1 +
0x0
+ 1 +
0x0
+ 1 12 0xdeadbeef 0xcabb1e diff --git a/tests/core/saved/test_02.E.out b/tests/core/saved/test_02.E.out index c5a0bec18115..6cc40e4d5da2 100644 --- a/tests/core/saved/test_02.E.out +++ b/tests/core/saved/test_02.E.out @@ -34,7 +34,7 @@ op content: [unknown] [1010] [0] op content: [unknown] [1010] [0] op content: [min] [15] [0x20] op content: [cur] [20] [0x20] -op content: [max] [30] [0] +op content: [max] [125] [0] op content: [min] [15] [0] op content: [cur] [20] [0] op content: [max] [125] [0] diff --git a/tests/core/saved/test_02.J.out b/tests/core/saved/test_02.J.out index 2cb2abcb8726..cafe7713c3ff 100644 --- a/tests/core/saved/test_02.J.out +++ b/tests/core/saved/test_02.J.out @@ -1,2 +1,2 @@ -{"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":30,"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": {"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.out b/tests/core/saved/test_02.JP.out index 930d8876fba3..9e40703c6133 100644 --- a/tests/core/saved/test_02.JP.out +++ b/tests/core/saved/test_02.JP.out @@ -34,7 +34,7 @@ "unknown": 1010, "min": 15, "cur": 20, - "max": 30, + "max": 125, "min": 15, "cur": 20, "max": 125, diff --git a/tests/core/saved/test_02.X.out b/tests/core/saved/test_02.X.out index 30421ea52d1e..49e9355514e2 100644 --- a/tests/core/saved/test_02.X.out +++ b/tests/core/saved/test_02.X.out @@ -2,6 +2,6 @@ abcdef: Bad file descriptor improper use of profanity; ten yard penalty; first down abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down -2030400123410203050Boston64640646401011101010101520301520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more errors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down +2030400123410203050Boston646406464010111010101015201251520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more errors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
\ No newline at end of file diff --git a/tests/core/saved/test_02.XP.out b/tests/core/saved/test_02.XP.out index e70e6ef7bd5f..e5172d35fd8e 100644 --- a/tests/core/saved/test_02.XP.out +++ b/tests/core/saved/test_02.XP.out @@ -39,7 +39,7 @@ 1010 15 20 - 30 + 125 15 20 125 diff --git a/tests/core/test_01.c b/tests/core/test_01.c index 26c272492ecb..15948a376025 100644 --- a/tests/core/test_01.c +++ b/tests/core/test_01.c @@ -80,6 +80,10 @@ main (int argc, char **argv) xo_open_container_h(NULL, "top"); + xo_emit("anchor {[:/%d}{:address/%p}..{:port/%u}{]:}\n", 18, NULL, 1); + xo_emit("anchor {[:18}{:address/%p}..{:port/%u}{]:}\n", NULL, 1); + xo_emit("anchor {[:/18}{:address/%p}..{:port/%u}{]:}\n", NULL, 1); + xo_emit("df {:used-percent/%5.0f}{U:%%}\n", (double) 12); xo_emit("{e:kve_start/%#jx}", (uintmax_t) 0xdeadbeef); diff --git a/tests/xo/saved/xo_01.H.out b/tests/xo/saved/xo_01.H.out index dd82a1ccc309..6d115c9abfae 100644 --- a/tests/xo/saved/xo_01.H.out +++ b/tests/xo/saved/xo_01.H.out @@ -1 +1 @@ -
Item
one
is
number
001
,
color
:
red
Item
two
is
number
002
,
color
:
blue
Item
three
is
number
003
,
color
:
green
Item
four
is
number
004
,
color
:
yellow
\ No newline at end of file +
Item
one
is
number
001
,
color
:
red
Item
two
is
number
002
,
color
:
blue
Item
three
is
number
003
,
color
:
green
Item
four
is
number
004
,
color
:
yellow
0xdeadbeef
..
1
0xdeadbeef
..
1
0xdeadbeef
..
1
0xdeadbeef
..
1
\ No newline at end of file diff --git a/tests/xo/saved/xo_01.HIPx.out b/tests/xo/saved/xo_01.HIPx.out index 12e36b1999a8..66ba7b6a4d80 100644 --- a/tests/xo/saved/xo_01.HIPx.out +++ b/tests/xo/saved/xo_01.HIPx.out @@ -49,4 +49,28 @@
:
yellow
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
diff --git a/tests/xo/saved/xo_01.HP.out b/tests/xo/saved/xo_01.HP.out index de9193668906..2bda085da4f2 100644 --- a/tests/xo/saved/xo_01.HP.out +++ b/tests/xo/saved/xo_01.HP.out @@ -49,4 +49,28 @@
:
yellow
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
diff --git a/tests/xo/saved/xo_01.J.out b/tests/xo/saved/xo_01.J.out index 86ce4efb23e2..7bf42260ffad 100644 --- a/tests/xo/saved/xo_01.J.out +++ b/tests/xo/saved/xo_01.J.out @@ -1 +1 @@ -"top": {"item": {"name":"one","value":1,"color":"red"}, "item": {"name":"two","value":2,"color":"blue"}, "item": {"name":"three","value":3,"color":"green"}, "item": {"name":"four","value":4,"color":"yellow"}} +"top": {"item": {"name":"one","value":1,"color":"red"}, "item": {"name":"two","value":2,"color":"blue"}, "item": {"name":"three","value":3,"color":"green"}, "item": {"name":"four","value":4,"color":"yellow"}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}} diff --git a/tests/xo/saved/xo_01.JP.out b/tests/xo/saved/xo_01.JP.out index 5a25b179dd8f..95ac0e244e99 100644 --- a/tests/xo/saved/xo_01.JP.out +++ b/tests/xo/saved/xo_01.JP.out @@ -18,5 +18,21 @@ "name": "four", "value": 4, "color": "yellow" + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 } } diff --git a/tests/xo/saved/xo_01.T.out b/tests/xo/saved/xo_01.T.out index ed2ea355a82d..8b67427be4a0 100644 --- a/tests/xo/saved/xo_01.T.out +++ b/tests/xo/saved/xo_01.T.out @@ -2,3 +2,7 @@ Item one is number 001, color: red Item two is number 002, color: blue Item three is number 003, color: green Item four is number 004, color: yellow + 0xdeadbeef..1 + 0xdeadbeef..1 + 0xdeadbeef..1 + 0xdeadbeef..1 diff --git a/tests/xo/saved/xo_01.X.out b/tests/xo/saved/xo_01.X.out index 7539566bdd8f..ffe77fa3cfcd 100644 --- a/tests/xo/saved/xo_01.X.out +++ b/tests/xo/saved/xo_01.X.out @@ -1 +1 @@ -one1redtwo2bluethree3greenfour4yellow \ No newline at end of file +one1redtwo2bluethree3greenfour4yellow
0xdeadbeef
1
0xdeadbeef
1
0xdeadbeef
1
0xdeadbeef
1
\ No newline at end of file diff --git a/tests/xo/saved/xo_01.XP.out b/tests/xo/saved/xo_01.XP.out index 7f069c8b51a0..a9d3951f3eb9 100644 --- a/tests/xo/saved/xo_01.XP.out +++ b/tests/xo/saved/xo_01.XP.out @@ -19,4 +19,20 @@ 4 yellow + +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
diff --git a/tests/xo/xo_01.sh b/tests/xo/xo_01.sh index 8de9410d5f68..504f1755311c 100755 --- a/tests/xo/xo_01.sh +++ b/tests/xo/xo_01.sh @@ -24,4 +24,10 @@ for i in one:1:red two:2:blue three:3:green four:4:yellow ; do NF=--not-first done -${XO} --close top \ No newline at end of file +XOAN="${XO} --wrap anchor --not-first --warn --depth 1" +${XOAN} "{[:18}{:address/%p}..{:foo/%u}{]:}\n" 0xdeadbeef 1 +${XOAN} "{[:/18}{:address/%p}..{:foo/%u}{]:}\n" 0xdeadbeef 1 +${XOAN} "{[:/%d}{:address/%p}..{:foo/%u}{]:}\n" 18 0xdeadbeef 1 +${XOAN} "{[:/%s}{:address/%p}..{:foo/%u}{]:}\n" 18 0xdeadbeef 1 + +${XO} --close top diff --git a/xo/xo.1 b/xo/xo.1 index 610296921fc8..55a67176da90 100644 --- a/xo/xo.1 +++ b/xo/xo.1 @@ -188,3 +188,13 @@ prepend data to the XPath values used for HTML output style. .Xr libxo 3 , .Xr xo_emit 3 , .Xr xo_options 7 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/xohtml/xohtml.1 b/xohtml/xohtml.1 index 0108c62a550b..7ae12ddbde1d 100644 --- a/xohtml/xohtml.1 +++ b/xohtml/xohtml.1 @@ -19,7 +19,8 @@ .Op Fl "b " .Op Fl "c" " .Op Fl "f" -.Op Ar command argument... +.Op Fl "w" +.Op Ar command [argument ...] .Sh DESCRIPTION .Nm is a tool for preparing @@ -69,6 +70,12 @@ command is used directly. .It Ic -f Ar file | Ic --file Ar file Output is saved to the given file, rather than to the standard output descriptor. +.It Ic -w | --web +Uses the official +.Nm libxo +website URL as the source path for the CSS and Javascript files +referenced in the output of +.Nm xohtml . .El .Pp .Sh EXAMPLES diff --git a/xohtml/xohtml.sh.in b/xohtml/xohtml.sh.in index f6c2fdbc99ff..aeb5d7baa806 100644 --- a/xohtml/xohtml.sh.in +++ b/xohtml/xohtml.sh.in @@ -10,8 +10,10 @@ # BASE=@XO_SHAREDIR@ +VERSION=@LIBXO_VERSION@ CMD=cat DONE= +WEB=http://juniper.github.io/libxo/${VERSION}/xohtml do_help () { echo "xohtml: wrap libxo-enabled output in HTML" @@ -41,6 +43,11 @@ while [ -z "$DONE" -a ! -z "$1" ]; do shift; exec > "$FILE"; ;; + -w|--web) + shift; + BASE="${WEB}"; + ;; + -*) do_help ;; diff --git a/xolint/xolint.1 b/xolint/xolint.1 index 11b59755aaa3..247536f33b00 100644 --- a/xolint/xolint.1 +++ b/xolint/xolint.1 @@ -77,3 +77,13 @@ line that contains the error: .Sh SEE ALSO .Xr libxo 3 , .Xr xo_emit 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + diff --git a/xopo/xopo.1 b/xopo/xopo.1 index 38104217d8ac..1634202476a2 100644 --- a/xopo/xopo.1 +++ b/xopo/xopo.1 @@ -75,3 +75,13 @@ Display version information .Sh SEE ALSO .Xr libxo 3 , .Xr xo_format 5 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . +