summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/stdio.h
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2007-05-04 02:55:16 +0000
committerEric Blake <eblake@redhat.com>2007-05-04 02:55:16 +0000
commitb9db5292223d1e716a126b5db8a69391ba4ef73e (patch)
tree15865fe52e65c81bee2654b162c38aeed9743c29 /newlib/libc/include/stdio.h
parentfb3937fade3487b7bd181bc6ab50c74637b6757f (diff)
downloadcygnal-b9db5292223d1e716a126b5db8a69391ba4ef73e.tar.gz
cygnal-b9db5292223d1e716a126b5db8a69391ba4ef73e.tar.bz2
cygnal-b9db5292223d1e716a126b5db8a69391ba4ef73e.zip
Add support for asnprintf, and improve *printf documentation.
* libc/stdio/Makefile.am (ELIX_SOURCES): Rename... (ELIX_2_SOURCES): ...to this. (ELIX_4_SOURCES): Add new variable. Build asnprintf. (GENERAL_SOURCES): Move dprintf to ELIX_4_SOURCES. (CHEWOUT_FILES): Include diprintf in documentation. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/diprintf.c: Improve documentation. * libc/stdio/dprintf.c: Likewise. * libc/stdio/siprintf.c: Likewise. * libc/stdio/sprintf.c: Likewise. * libc/stdio/vfprintf.c: Likewise. * libc/stdio/viprintf.c: Likewise. * libc/stdio/vsniprintf.c: Consolidate documentation. * libc/stdio/asiprintf.c: Refer to documentation. * libc/stdio/asprintf.c: Likewise. * libc/stdio/fiprintf.c: Likewise. * libc/stdio/fprintf.c: Likewise. * libc/stdio/iprintf.c: Likewise. * libc/stdio/printf.c: Likewise. * libc/stdio/sniprintf.c: Likewise. * libc/stdio/vdiprintf.c: Likewise. * libc/stdio/vdprintf.c: Likewise. * libc/stdio/vsiprintf.c: Likewise. * libc/stdio/fvwrite.c (__sfvwrite_r): Handle asnprintf. * libc/stdio/asniprintf.c (asniprintf, _asniprintf_r): New file. * libc/stdio/asnprintf.c (asnprintf, _asnprintf_r): New file. * libc/stdio/vasniprintf.c (vasniprintf, _vasniprintf_r): New file. * libc/stdio/vasnprintf.c (vasnprintf, _vasnprintf_r): New file. * libc/stdio/vdprintf.c (_vdprintf_r): Rewrite to avoid malloc in typical case. * libc/stdio/vdiprintf.c (_vdiprintf_r): Likewise. * libc/include/stdio.h: Add prototypes for new functions; sort existing functions.
Diffstat (limited to 'newlib/libc/include/stdio.h')
-rw-r--r--newlib/libc/include/stdio.h58
1 files changed, 37 insertions, 21 deletions
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
index 03334fe12..7c5247021 100644
--- a/newlib/libc/include/stdio.h
+++ b/newlib/libc/include/stdio.h
@@ -238,6 +238,10 @@ off_t _EXFUN(ftello, ( FILE *));
#ifndef _REENT_ONLY
int _EXFUN(asiprintf, (char **, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
+char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...)
+ _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
+char * _EXFUN(asnprintf, (char *, size_t *, const char *, ...)
+ _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(asprintf, (char **, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
#ifndef dprintf
@@ -266,16 +270,16 @@ int _EXFUN(sniprintf, (char *, size_t, const char *, ...)
char * _EXFUN(tempnam, (const char *, const char *));
int _EXFUN(vasiprintf, (char **, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
+char * _EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
+char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(vasprintf, (char **, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vdiprintf, (int, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vdprintf, (int, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
-int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
-int _EXFUN(vsnprintf, (char *, size_t, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vfiscanf, (FILE *, const char *, __VALIST)
@@ -284,18 +288,22 @@ int _EXFUN(vfscanf, (FILE *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
int _EXFUN(viprintf, (const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 1, 0))));
-int _EXFUN(vsiprintf, (char *, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(viscanf, (const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
int _EXFUN(vscanf, (const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
+int _EXFUN(vsiprintf, (char *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vsiscanf, (const char *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
+int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
+int _EXFUN(vsnprintf, (char *, size_t, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(vsscanf, (const char *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
-#endif
-#endif
+#endif /* !_REENT_ONLY */
+#endif /* !__STRICT_ANSI__ */
/*
* Routines in POSIX 1003.1.
@@ -319,7 +327,7 @@ int _EXFUN(ftrylockfile, (FILE *));
void _EXFUN(funlockfile, (FILE *));
int _EXFUN(putc_unlocked, (int, FILE *));
int _EXFUN(putchar_unlocked, (int));
-#endif
+#endif /* ! __STRICT_ANSI__ */
/*
* Recursive versions of the above.
@@ -327,6 +335,10 @@ int _EXFUN(putchar_unlocked, (int));
int _EXFUN(_asiprintf_r, (struct _reent *, char **, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
+char * _EXFUN(_asniprintf_r, (struct _reent *, char *, size_t *, const char *, ...)
+ _ATTRIBUTE ((__format__ (__printf__, 4, 5))));
+char * _EXFUN(_asnprintf_r, (struct _reent *, char *, size_t *, const char *, ...)
+ _ATTRIBUTE ((__format__ (__printf__, 4, 5))));
int _EXFUN(_asprintf_r, (struct _reent *, char **, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(_diprintf_r, (struct _reent *, int, const char *, ...)
@@ -394,6 +406,10 @@ char * _EXFUN(_tmpnam_r, (struct _reent *, char *));
int _EXFUN(_ungetc_r, (struct _reent *, int, FILE *));
int _EXFUN(_vasiprintf_r, (struct _reent *, char **, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
+char * _EXFUN(_vasniprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 4, 0))));
+char * _EXFUN(_vasnprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 4, 0))));
int _EXFUN(_vasprintf_r, (struct _reent *, char **, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(_vdiprintf_r, (struct _reent *, int, const char *, __VALIST)
@@ -402,32 +418,32 @@ int _EXFUN(_vdprintf_r, (struct _reent *, int, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(_vfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
+int _EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
int _EXFUN(_vfprintf_r, (struct _reent *, FILE *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
+int _EXFUN(_vfscanf_r, (struct _reent *, FILE *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
int _EXFUN(_viprintf_r, (struct _reent *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
+int _EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
int _EXFUN(_vprintf_r, (struct _reent *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
+int _EXFUN(_vscanf_r, (struct _reent *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
int _EXFUN(_vsiprintf_r, (struct _reent *, char *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
-int _EXFUN(_vsprintf_r, (struct _reent *, char *, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
+int _EXFUN(_vsiscanf_r, (struct _reent *, const char *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
int _EXFUN(_vsniprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 4, 0))));
int _EXFUN(_vsnprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 4, 0))));
-int _EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
-int _EXFUN(_vfscanf_r, (struct _reent *, FILE *, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
-int _EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
-int _EXFUN(_vscanf_r, (struct _reent *, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
+int _EXFUN(_vsprintf_r, (struct _reent *, char *, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(_vsscanf_r, (struct _reent *, const char *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
-int _EXFUN(_vsiscanf_r, (struct _reent *, const char *, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));
ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));