diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-09 19:51:18 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-09 19:51:18 +0000 |
commit | 36ac7bee0f6b0be35eafd74e0fc865edd2352197 (patch) | |
tree | b557dfbf03da9612bc09906fa3fb7559f556fed8 /libc/stdio/_stdio.h | |
parent | f1459b13206cee20f322a53bb659a8735e2c8de0 (diff) |
Factor out the core of vprintf() into separate function
vprintf_internal, so that:
* vprintf() does locking and __STDIO_STREAM_TRANS_TO_WRITE thing,
then calls vprintf_internal
* vsnprintf, vdprintf.c, vasprintf.c use
vprintf_internal directly
This makes sprintf faster (since it doesn't do any locking)
and stops it from pulling in fseek in static compile.
Diffstat (limited to 'libc/stdio/_stdio.h')
-rw-r--r-- | libc/stdio/_stdio.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index 74b891a03..e1fc26785 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -15,6 +15,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <stdarg.h> #include <unistd.h> #ifdef __UCLIBC_HAS_WCHAR__ #include <wchar.h> @@ -431,6 +432,18 @@ extern size_t _wstdio_fwrite(const wchar_t *__restrict ws, #endif /**********************************************************************/ + +extern int _vfprintf_internal (FILE * __restrict stream, + register const char * __restrict format, + va_list arg) attribute_hidden; + +#ifdef __UCLIBC_HAS_WCHAR__ +extern int _vfwprintf_internal (FILE * __restrict stream, + register const wchar_t * __restrict format, + va_list arg) attribute_hidden; +#endif + +/**********************************************************************/ /* Only use the macro below if you know fp is a valid FILE for a valid fd. * This is _not_ true for custom streams! */ #define __FILENO_UNLOCKED(fp) ((fp)->__filedes) |