From a6d0508dd8c4beb88be6d5ca4b35e12db40e8312 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 25 Jan 2006 12:45:24 +0000 Subject: Make the %V{is} extension handle a NULL pointer like %s does: output "(null)" Add %M{essage} extension which prints an errno value as the corresponding string if possible or numerically otherwise. It is not currently possible to do the syslog(3) like %m extension because errno would need to get capatured on entry to the first function in the printf family, so %M requires you to supply errno as an argument. Add %Q{uote} extension which will print a string in double quotes with appropriate back-slash escapes (only) if necessary. --- include/printf.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/printf.h b/include/printf.h index d16ad6e..59fa282 100644 --- a/include/printf.h +++ b/include/printf.h @@ -124,16 +124,28 @@ int register_printf_function(int spec, printf_function *render, printf_arginfo_f int register_printf_render(int spec, printf_render *render, printf_arginfo_function *arginfo); int register_printf_render_std(const unsigned char *specs); +/* vprintf_errno.c */ +printf_arginfo_function __printf_arginfo_errno; +printf_render __printf_render_errno; + /* vprintf_float.c */ printf_arginfo_function __printf_arginfo_float; printf_render __printf_render_float; +/* vprintf_hexdump.c */ +printf_arginfo_function __printf_arginfo_hexdump; +printf_render __printf_render_hexdump; + /* vprintf_int.c */ printf_arginfo_function __printf_arginfo_ptr; printf_arginfo_function __printf_arginfo_int; printf_render __printf_render_ptr; printf_render __printf_render_int; +/* vprintf_quoute.c */ +printf_arginfo_function __printf_arginfo_quote; +printf_render __printf_render_quote; + /* vprintf_str.c */ printf_arginfo_function __printf_arginfo_chr; printf_render __printf_render_chr; @@ -144,10 +156,6 @@ printf_render __printf_render_str; printf_arginfo_function __printf_arginfo_time; printf_render __printf_render_time; -/* vprintf_hexdump.c */ -printf_arginfo_function __printf_arginfo_hexdump; -printf_render __printf_render_hexdump; - /* vprintf_vis.c */ printf_arginfo_function __printf_arginfo_vis; printf_render __printf_render_vis; -- cgit v1.1