Main index | Section 3 | Options |
#include <libxo/xo.h>
xo_emit() uses the default output handle, as described in libxo(3), where xo_emit_h() uses an explicit handle. xo_emit_hv() accepts a va_list for additional flexibility.
xo_emit(" {:lines/%7ju} {:words/%7ju} " "{:characters/%7ju} {d:filename/%s}0, linect, wordct, charct, file);Output can then be generated in various style, using the "--libxo" option:
% wc /etc/motd 25 165 1140 /etc/motd % wc --libxo xml,pretty,warn /etc/motd <wc> <file> <lines>25</lines> <words>165</words> <characters>1140</characters> <filename>/etc/motd</filename> </file> </wc> % wc --libxo json,pretty,warn /etc/motd { "wc": { "file": [ { "lines": 25, "words": 165, "characters": 1140, "filename": "/etc/motd" } ] } } % wc --libxo html,pretty,warn /etc/motd <div class="line"> <div class="text"> </div> <div class="data" data-tag="lines"> 25</div> <div class="text"> </div> <div class="data" data-tag="words"> 165</div> <div class="text"> </div> <div class="data" data-tag="characters"> 1140</div> <div class="text"> </div> <div class="data" data-tag="filename">/etc/motd</div> </div>
LIBXO (3) | December 4, 2014 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.