diff options
Diffstat (limited to 'newlib/libc/stdio/iprintf.c')
-rw-r--r-- | newlib/libc/stdio/iprintf.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/newlib/libc/stdio/iprintf.c b/newlib/libc/stdio/iprintf.c index c9a026424..4b698ad7f 100644 --- a/newlib/libc/stdio/iprintf.c +++ b/newlib/libc/stdio/iprintf.c @@ -15,6 +15,44 @@ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +/* +FUNCTION +<<iprintf>>---write formatted output (integer only) + +INDEX + iprintf + +ANSI_SYNOPSIS + #include <stdio.h> + + int iprintf(const char *<[format]>, ...); + +TRAD_SYNOPSIS + #include <stdio.h> + + int iprintf(<[format]> [, <[arg]>, ...]) + char *<[format]>; + +DESCRIPTION +<<iprintf>> is a restricted version of <<printf>>: it has the same +arguments and behavior, save that it cannot perform any floating-point +formatting: the <<f>>, <<g>>, <<G>>, <<e>>, and <<F>> type specifiers +are not recognized. + +RETURNS + <<iprintf>> returns the number of bytes in the output string, + save that the concluding <<NULL>> is not counted. + <<iprintf>> returns when the end of the format string is + encountered. If an error occurs, <<iprintf>> + returns <<EOF>>. + +PORTABILITY +<<iprintf>> is not required by ANSI C. + +Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, +<<lseek>>, <<read>>, <<sbrk>>, <<write>>. +*/ + #include <_ansi.h> #include <reent.h> #include <stdio.h> @@ -40,7 +78,7 @@ iprintf(fmt, va_alist) int ret; va_list ap; - _REENT_SMALL_CHECK_INIT (_REENT); + _REENT_SMALL_CHECK_INIT (_stdout_r (_REENT)); #ifdef _HAVE_STDC va_start (ap, fmt); #else @@ -67,7 +105,7 @@ _iprintf_r(ptr, fmt, va_alist) int ret; va_list ap; - _REENT_SMALL_CHECK_INIT (ptr); + _REENT_SMALL_CHECK_INIT (_stdout_r (ptr)); #ifdef _HAVE_STDC va_start (ap, fmt); #else |