diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-04 18:56:17 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-04 18:56:17 +0000 |
commit | 7501704dc9dc7337e621db87ada8901a496766d9 (patch) | |
tree | 8b0549b249b4f5fd48d0ee389d5db48beea55491 /newlib/libc/stdio/vfprintf.c | |
parent | 5cff62d6561dc63ef30b57d7ee415e6e1acdfb70 (diff) | |
download | newlib-7501704dc9dc7337e621db87ada8901a496766d9.zip newlib-7501704dc9dc7337e621db87ada8901a496766d9.tar.gz newlib-7501704dc9dc7337e621db87ada8901a496766d9.tar.bz2 |
2002-07-04 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/Makefile.am: Add asprintf.c and vasprintf.c.
* libc/stdio/Makefile.in: Regenerated.
* libc/stdio/asprintf.c: New file.
* libc/stdio/vasprintf.c: Ditto.
* libc/stdio/fvwrite.c: Add code to dynamically reallocate
the buffer for asprintf support.
* libc/stdio/sprintf.c: Add asprintf documentation.
* libc/stdio/vfprintf.c: Add vasprintf documentation.
* libc/include/stdio.h: Add new prototypes.
Diffstat (limited to 'newlib/libc/stdio/vfprintf.c')
-rw-r--r-- | newlib/libc/stdio/vfprintf.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 27cc6d9..889a7a0 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -17,12 +17,15 @@ ANSI_SYNOPSIS int vprintf(const char *<[fmt]>, va_list <[list]>); int vfprintf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>); int vsprintf(char *<[str]>, const char *<[fmt]>, va_list <[list]>); + int vasprintf(char **<[strp]>, const char *<[fmt]>, va_list <[list]>); int vsnprintf(char *<[str]>, size_t <[size]>, const char *<[fmt]>, va_list <[list]>); int _vprintf_r(void *<[reent]>, const char *<[fmt]>, va_list <[list]>); int _vfprintf_r(void *<[reent]>, FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>); + int _vasprintf_r(void *<[reent]>, char **<[str]>, const char *<[fmt]>, + va_list <[list]>); int _vsprintf_r(void *<[reent]>, char *<[str]>, const char *<[fmt]>, va_list <[list]>); int _vsnprintf_r(void *<[reent]>, char *<[str]>, size_t <[size]>, const char *<[fmt]>, @@ -40,6 +43,11 @@ TRAD_SYNOPSIS char *<[fmt]>; va_list <[list]>; + int vasprintf(<[strp]>, <[fmt]>, <[list]>) + char **<[strp]>; + char *<[fmt]>; + va_list <[list]>; + int vsprintf(<[str]>, <[fmt]>, <[list]>) char *<[str]>; char *<[fmt]>; @@ -62,6 +70,12 @@ TRAD_SYNOPSIS char *<[fmt]>; va_list <[list]>; + int _vasprintf_r(<[reent]>, <[strp]>, <[fmt]>, <[list]>) + char *<[reent]>; + char **<[strp]>; + char *<[fmt]>; + va_list <[list]>; + int _vsprintf_r(<[reent]>, <[str]>, <[fmt]>, <[list]>) char *<[reent]>; char *<[str]>; @@ -76,19 +90,19 @@ TRAD_SYNOPSIS va_list <[list]>; DESCRIPTION -<<vprintf>>, <<vfprintf>>, <<vsprintf>> and <<vsnprintf>> are (respectively) -variants of <<printf>>, <<fprintf>>, <<sprintf>> and <<snprintf>>. They differ -only in allowing their caller to pass the variable argument list as a -<<va_list>> object (initialized by <<va_start>>) rather than directly -accepting a variable number of arguments. +<<vprintf>>, <<vfprintf>>, <<vasprintf>>, <<vsprintf>> and <<vsnprintf>> are +(respectively) variants of <<printf>>, <<fprintf>>, <<saprintf>>, <<sprintf>>, +and <<snprintf>>. They differ only in allowing their caller to pass the +variable argument list as a <<va_list>> object (initialized by <<va_start>>) +rather than directly accepting a variable number of arguments. RETURNS The return values are consistent with the corresponding functions: -<<vsprintf>> returns the number of bytes in the output string, +<<vasprintf>>/<<vsprintf>> returns the number of bytes in the output string, save that the concluding <<NULL>> is not counted. <<vprintf>> and <<vfprintf>> return the number of characters transmitted. -If an error occurs, <<vprintf>> and <<vfprintf>> return <<EOF>>. No -error returns occur for <<vsprintf>>. +If an error occurs, <<vprintf>> and <<vfprintf>> return <<EOF>> and +<<vasprintf>> returns -1. No error returns occur for <<vsprintf>>. PORTABILITY ANSI C requires all three functions. |