From 7501704dc9dc7337e621db87ada8901a496766d9 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 4 Jul 2002 18:56:17 +0000 Subject: 2002-07-04 Jeff Johnston * 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. --- newlib/libc/stdio/vfprintf.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'newlib/libc/stdio/vfprintf.c') diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 27cc6d911..889a7a083 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 -<>, <>, <> and <> are (respectively) -variants of <>, <>, <> and <>. They differ -only in allowing their caller to pass the variable argument list as a -<> object (initialized by <>) rather than directly -accepting a variable number of arguments. +<>, <>, <>, <> and <> are +(respectively) variants of <>, <>, <>, <>, +and <>. They differ only in allowing their caller to pass the +variable argument list as a <> object (initialized by <>) +rather than directly accepting a variable number of arguments. RETURNS The return values are consistent with the corresponding functions: -<> returns the number of bytes in the output string, +<>/<> returns the number of bytes in the output string, save that the concluding <> is not counted. <> and <> return the number of characters transmitted. -If an error occurs, <> and <> return <>. No -error returns occur for <>. +If an error occurs, <> and <> return <> and +<> returns -1. No error returns occur for <>. PORTABILITY ANSI C requires all three functions. -- cgit v1.2.3