#include <string.h>
#include <unistd.h>
+extern int __vfprintf (FILE *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg) attribute_hidden;
+
+extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, __gnuc_va_list __arg)
+ __THROW __attribute__ ((__format__ (__printf__, 3, 0))) attribute_hidden;
+
+extern int __vfwprintf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg) attribute_hidden;
+
#ifdef __UCLIBC_HAS_WCHAR__
#include <wchar.h>
#endif
#include "_stdio.h"
#include <stdarg.h>
-int fprintf(FILE * __restrict stream, const char * __restrict format, ...)
+int attribute_hidden __fprintf(FILE * __restrict stream, const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vfprintf(stream, format, arg);
+ rv = __vfprintf(stream, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__fprintf,fprintf)
/* u_radix[i] <-> u_spec[i+2] for unsigned entries only */
static const char u_radix[] = "\x02\x08\x10\x10\x10\x0a";
-int vfprintf(FILE * __restrict op, register const char * __restrict fmt,
+int attribute_hidden __vfprintf(FILE * __restrict op, register const char * __restrict fmt,
va_list ap)
{
union {
return i;
}
+strong_alias(__vfprintf,vfprintf)
#include "_stdio.h"
#include <stdarg.h>
-int printf(const char * __restrict format, ...)
+int attribute_hidden __printf(const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vfprintf(stdout, format, arg);
+ rv = __vfprintf(stdout, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__printf,printf)
#warning Skipping snprintf since no vsnprintf!
#else
-int snprintf(char *__restrict buf, size_t size,
+int attribute_hidden __snprintf(char *__restrict buf, size_t size,
const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vsnprintf(buf, size, format, arg);
+ rv = __vsnprintf(buf, size, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__snprintf,snprintf)
#endif
#warning Skipping sprintf since no vsnprintf!
#else
-int sprintf(char *__restrict buf, const char * __restrict format, ...)
+int attribute_hidden __sprintf(char *__restrict buf, const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vsnprintf(buf, SIZE_MAX, format, arg);
+ rv = __vsnprintf(buf, SIZE_MAX, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__sprintf,sprintf)
#endif
*buf = NULL;
if ((f = open_memstream(buf, &size)) != NULL) {
- rv = vfprintf(f, format, arg);
+ rv = __vfprintf(f, format, arg);
fclose(f);
if (rv < 0) {
free(*buf);
int rv;
va_copy(arg2, arg);
- rv = vsnprintf(NULL, 0, format, arg2);
+ rv = __vsnprintf(NULL, 0, format, arg2);
va_end(arg2);
*buf = NULL;
if (rv >= 0) {
if ((*buf = malloc(++rv)) != NULL) {
- if ((rv = vsnprintf(*buf, rv, format, arg)) < 0) {
+ if ((rv = __vsnprintf(*buf, rv, format, arg)) < 0) {
free(*buf);
*buf = NULL;
}
return rv;
#endif /* __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ */
-strong_alias(__vasprintf,vasprintf)
}
+strong_alias(__vasprintf,vasprintf)
#endif
#endif
f.__nextopen = NULL;
- rv = vfprintf(&f, format, arg);
+ rv = __vfprintf(&f, format, arg);
#ifdef __STDIO_BUFFERS
/* If not buffering, then fflush is unnecessary. */
#ifdef L_vfprintf
+#define HIDDEN_VFPRINTF __vfprintf
#define VFPRINTF vfprintf
#define FMT_TYPE char
#define OUTNSTR _outnstr
#else /* L_vfprintf */
+#define HIDDEN_VFPRINTF __vfwprintf
#define VFPRINTF vfwprintf
#define FMT_TYPE wchar_t
#define OUTNSTR _outnwcs
return 0;
}
-int VFPRINTF (FILE * __restrict stream,
+int attribute_hidden HIDDEN_VFPRINTF (FILE * __restrict stream,
register const FMT_TYPE * __restrict format,
va_list arg)
{
return count;
}
+strong_alias(HIDDEN_VFPRINTF,VFPRINTF)
#endif
/**********************************************************************/
int vprintf(const char * __restrict format, va_list arg)
{
- return vfprintf(stdout, format, arg);
+ return __vfprintf(stdout, format, arg);
}
#ifdef __STDIO_BUFFERS
-int vsnprintf(char *__restrict buf, size_t size,
+int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
FILE f;
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_ENABLE_PUTC(&f);
- rv = vfprintf(&f, format, arg);
+ rv = __vfprintf(&f, format, arg);
if (size) {
if (f.__bufpos == f.__bufend) {
--f.__bufpos;
}
return rv;
}
+strong_alias(__vsnprintf,vsnprintf)
#elif defined(__USE_OLD_VFPRINTF__)
unsigned char *bufpos;
} __FILE_vsnprintf;
-int vsnprintf(char *__restrict buf, size_t size,
+int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
__FILE_vsnprintf f;
#endif
f.f.__nextopen = NULL;
- rv = vfprintf((FILE *) &f, format, arg);
+ rv = __vfprintf((FILE *) &f, format, arg);
if (size) {
if (f.bufpos == f.bufend) {
--f.bufpos;
}
return rv;
}
+strong_alias(__vsnprintf,vsnprintf)
#elif defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__)
#undef COOKIE
-int vsnprintf(char *__restrict buf, size_t size,
+int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
FILE f;
#endif
f.__nextopen = NULL;
- rv = vfprintf(&f, format, arg);
+ rv = __vfprintf(&f, format, arg);
return rv;
}
+strong_alias(__vsnprintf,vsnprintf)
#else
#warning Skipping vsnprintf since no buffering, no custom streams, and not old vfprintf!
int vsprintf(char *__restrict buf, const char * __restrict format,
va_list arg)
{
- return vsnprintf(buf, SIZE_MAX, format, arg);
+ return __vsnprintf(buf, SIZE_MAX, format, arg);
}
#endif
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_DISABLE_PUTC(&f);
- rv = vfwprintf(&f, format, arg);
+ rv = __vfwprintf(&f, format, arg);
/* NOTE: Return behaviour differs from snprintf... */
if (f.__bufpos == f.__bufend) {
int vwprintf(const wchar_t * __restrict format, va_list arg)
{
- return vfwprintf(stdout, format, arg);
+ return __vfwprintf(stdout, format, arg);
}
int rv;
va_start(arg, format);
- rv = vfwprintf(stdout, format, arg);
+ rv = __vfwprintf(stdout, format, arg);
va_end(arg);
return rv;