summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2006-01-25 12:45:24 +0000
committerphk <phk@FreeBSD.org>2006-01-25 12:45:24 +0000
commita6d0508dd8c4beb88be6d5ca4b35e12db40e8312 (patch)
tree8b1b9e153704a2e4059c4a81c88f8bdaa0817a60 /include
parentb52efc57bec49fd584f1580087664aff15a10168 (diff)
downloadFreeBSD-src-a6d0508dd8c4beb88be6d5ca4b35e12db40e8312.zip
FreeBSD-src-a6d0508dd8c4beb88be6d5ca4b35e12db40e8312.tar.gz
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.
Diffstat (limited to 'include')
-rw-r--r--include/printf.h16
1 files changed, 12 insertions, 4 deletions
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;
OpenPOWER on IntegriCloud