summaryrefslogtreecommitdiff
path: root/include/printf.h
Commit message (Collapse)AuthorAgeFilesLines
* include: General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326192
* The register_printf_render_std() function expects regular string.Pawel Jakub Dawidek2012-07-041-1/+1
| | | | | | | | | Change argument type from 'const unsigned char *' to 'const char *'. MFC after: 2 weeks Notes: svn path=/head/; revision=238111
* Include stdio.h, so we can include printf.h in any order, as it needs FILE.Pawel Jakub Dawidek2011-03-061-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=219343
* Add nested include of <wchar.h>Poul-Henning Kamp2006-03-021-0/+2
| | | | Notes: svn path=/head/; revision=156208
* Remove spurious "union arg" from printf.hPoul-Henning Kamp2006-02-041-2/+0
| | | | | | | Make sure to always print something in the alternate time format. Notes: svn path=/head/; revision=155300
* Make the %V{is} extension handle a NULL pointer like %s does: output "(null)"Poul-Henning Kamp2006-01-251-4/+12
| | | | | | | | | | | | | | | | 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: svn path=/head/; revision=154815
* Add an extensible version of our *printf(3) implementation to libcPoul-Henning Kamp2005-12-161-0/+155
on probationary terms: it may go away again if it transpires it is a bad idea. This extensible printf version will only be used if either environment variable USE_XPRINTF is defined or one of the extension functions are called. or the global variable __use_xprintf is set greater than zero. In all other cases our traditional printf implementation will be used. The extensible version is slower than the default printf, mostly because less opportunity for combining I/O operation exists when faced with extensions. The default printf on the other hand is a bad case of spaghetti code. The extension API has a GLIBC compatible part and a FreeBSD version of same. The FreeBSD version exists because the GLIBC version may run afoul of our FILE * locking in multithreaded programs and it even further eliminate the opportunities for combining I/O operations. Include three demo extensions which can be enabled if desired: time (%T), hexdump (%H) and strvis (%V). %T can format time_t (%T), struct timeval (%lT) and struct timespec (%llT) in one of two human readable duration formats: "%.3llT" -> "20349.245" "%#.3llT" -> "5h39m9.245" %H will hexdump a sequence of bytes and takes a pointer and a length argument. The width specifies number of bytes per line. "%4H" -> "65 72 20 65" "%+4H" -> "0000 65 72 20 65" "%#4H" -> "65 72 20 65 |er e|" "%+#4H" -> "0000 65 72 20 65 |er e|" %V will dump a string in strvis format. "%V" -> "Hello\tWor\377ld" (C-style) "%0V" -> "Hello\011Wor\377ld" (octal) "%+V" -> "Hello%09Wor%FFld" (http-style) Tests, comments, bugreports etc are most welcome. Notes: svn path=/head/; revision=153486