Adds custom printf formats
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 15 Oct 2013 20:52:18 +0000 (13:52 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 22 Jan 2014 22:22:53 +0000 (14:22 -0800)
commit3b94610c73cd389a5fb9bb2f720ede0b13f8134a
treef2959db39de53a0ea62c1fe7f66d7ab9e21b1df1
parent4ef4edc7c40db86a45a272b73c83dd98ffcd21ed
Adds custom printf formats

The specifier %r will print the contents of errstr, installed by
default.  Any others need to be manually installed.

For example:
register_printf_specifier('i', printf_ipaddr, printf_ipaddr_info);

See tests/printf-ext.c for some examples.

If you want to add your own, add them to parlib/printf-ext.c.  Check out
the comments for ipaddr and ipaddr_info for details.  Once you get the
hang of it, it's pretty simple.

Also, some letters can't have a specifier installed onto it, such as %I
and other special chars.
tests/printf-ext.c [new file with mode: 0644]
user/eipconvtest.c [deleted file]
user/parlib/include/printf-ext.h [new file with mode: 0644]
user/parlib/printf-ext.c [new file with mode: 0644]
user/parlib/vcore.c