[Toybox] RFC: od toy

Andre Renaud andre at bluewatersys.com
Tue Jun 26 14:06:51 PDT 2012


Hi,
I've started to do an implementation of 'od' - it is most of the way
there, but I'm not particularly happy with the method I've used for
determining which 'printf' format string and which data alignment to
use. At the moment I'm essentially reparsing the -t XX parameters each
time you want to print a new character, which has pretty hideous
performance (and currently doesn't support the -to2o4 syntax). I'm
debating about pre-parsing these, and then a list of function
pointers. This would also require me to have ~20 tiny stub functions,
which basically just do a printf with a different format string & data
type, and return the length of data that they've consumed (or possibly
iterate over an entire line, I haven't decided).

Does anyone have any comments about an alternative method to do this?

Thanks,
Andre

-- 
Bluewater Systems - An Aiotec Company

Andre Renaud
andre at bluewatersys.com          5 Amuri Park, 404 Barbadoes St
www.bluewatersys.com            PO Box 13 889, Christchurch 8013
www.aiotec.co.nz                New Zealand
Phone: +64 3 3779127            Freecall: Australia 1800 148 751
Fax:   +64 3 3779135            USA 1800 261 2934
-------------- next part --------------
A non-text attachment was scrubbed...
Name: od.c
Type: text/x-csrc
Size: 5693 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120627/7ec94e1d/attachment-0003.c>


More information about the Toybox mailing list