summaryrefslogtreecommitdiff
path: root/include/printf.h
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2006-01-25 12:45:24 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2006-01-25 12:45:24 +0000
commit6dbacee284ac789077c3f2a181437ff5a7ebb3b8 (patch)
tree8b1b9e153704a2e4059c4a81c88f8bdaa0817a60 /include/printf.h
parentea7075eb64ed5f24cd0eca7b7d4e47fb264e8e36 (diff)
downloadsrc-test2-6dbacee284ac789077c3f2a181437ff5a7ebb3b8.tar.gz
src-test2-6dbacee284ac789077c3f2a181437ff5a7ebb3b8.zip
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.
Notes
Notes: svn path=/head/; revision=154815
Diffstat (limited to 'include/printf.h')
-rw-r--r--include/printf.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/printf.h b/include/printf.h
index d16ad6e778cd..59fa282cf359 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;