summaryrefslogtreecommitdiffstats
path: root/libc/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdio')
-rw-r--r--libc/stdio/_READ.c2
-rw-r--r--libc/stdio/_WRITE.c2
-rw-r--r--libc/stdio/_adjust_pos.c2
-rw-r--r--libc/stdio/_cs_funcs.c14
-rw-r--r--libc/stdio/_fopen.c2
-rw-r--r--libc/stdio/_fpmaxtostr.c4
-rw-r--r--libc/stdio/_fwrite.c2
-rw-r--r--libc/stdio/_load_inttype.c2
-rw-r--r--libc/stdio/_rfill.c2
-rw-r--r--libc/stdio/_stdio.h38
-rw-r--r--libc/stdio/_store_inttype.c2
-rw-r--r--libc/stdio/_trans2r.c4
-rw-r--r--libc/stdio/_trans2w.c4
-rw-r--r--libc/stdio/_wcommit.c2
-rw-r--r--libc/stdio/old_vfprintf.c6
-rw-r--r--libc/stdio/scanf.c21
-rw-r--r--libc/stdio/vfprintf.c23
17 files changed, 65 insertions, 67 deletions
diff --git a/libc/stdio/_READ.c b/libc/stdio/_READ.c
index 7d3c38ce6..013ca0281 100644
--- a/libc/stdio/_READ.c
+++ b/libc/stdio/_READ.c
@@ -20,7 +20,7 @@
* NOT THREADSAFE! Assumes stream already locked if necessary.
*/
-size_t __stdio_READ(register FILE *stream,
+size_t attribute_hidden __stdio_READ(register FILE *stream,
unsigned char *buf, size_t bufsize)
{
ssize_t rv = 0;
diff --git a/libc/stdio/_WRITE.c b/libc/stdio/_WRITE.c
index d300d3919..877d055f7 100644
--- a/libc/stdio/_WRITE.c
+++ b/libc/stdio/_WRITE.c
@@ -28,7 +28,7 @@
* NOT THREADSAFE! Assumes stream already locked if necessary.
*/
-size_t __stdio_WRITE(register FILE *stream,
+size_t attribute_hidden __stdio_WRITE(register FILE *stream,
register const unsigned char *buf, size_t bufsize)
{
size_t todo;
diff --git a/libc/stdio/_adjust_pos.c b/libc/stdio/_adjust_pos.c
index bc48d32b7..bc6e90555 100644
--- a/libc/stdio/_adjust_pos.c
+++ b/libc/stdio/_adjust_pos.c
@@ -16,7 +16,7 @@
* If position is unrepresentable, set errno to EOVERFLOW.
*/
-int __stdio_adjust_position(register FILE * __restrict stream,
+int attribute_hidden __stdio_adjust_position(register FILE * __restrict stream,
register __offmax_t *pos)
{
__offmax_t oldpos;
diff --git a/libc/stdio/_cs_funcs.c b/libc/stdio/_cs_funcs.c
index fd81a6f95..9df93f227 100644
--- a/libc/stdio/_cs_funcs.c
+++ b/libc/stdio/_cs_funcs.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
+/* Copyright (C) 2004-2005 Manuel Novoa III <mjn3@codepoet.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
@@ -11,21 +11,21 @@
#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
/**********************************************************************/
-ssize_t _cs_read(void *cookie, char *buf, size_t bufsize)
+ssize_t attribute_hidden _cs_read(void *cookie, char *buf, size_t bufsize)
{
return read(*((int *) cookie), buf, bufsize);
}
/**********************************************************************/
-ssize_t _cs_write(void *cookie, const char *buf, size_t bufsize)
+ssize_t attribute_hidden _cs_write(void *cookie, const char *buf, size_t bufsize)
{
return write(*((int *) cookie), (char *) buf, bufsize);
}
/**********************************************************************/
-int _cs_seek(void *cookie, register __offmax_t *pos, int whence)
+int attribute_hidden _cs_seek(void *cookie, register __offmax_t *pos, int whence)
{
__offmax_t res;
@@ -40,7 +40,7 @@ int _cs_seek(void *cookie, register __offmax_t *pos, int whence)
/**********************************************************************/
-int _cs_close(void *cookie)
+int attribute_hidden _cs_close(void *cookie)
{
return close(*((int *) cookie));
}
@@ -49,7 +49,7 @@ int _cs_close(void *cookie)
#else
/**********************************************************************/
-int __stdio_seek(FILE *stream, register __offmax_t *pos, int whence)
+int attribute_hidden __stdio_seek(FILE *stream, register __offmax_t *pos, int whence)
{
__offmax_t res;
diff --git a/libc/stdio/_fopen.c b/libc/stdio/_fopen.c
index bba8cfdfd..508c36d1c 100644
--- a/libc/stdio/_fopen.c
+++ b/libc/stdio/_fopen.c
@@ -27,7 +27,7 @@
/* Internal function -- reentrant (locks open file list) */
-FILE *_stdio_fopen(intptr_t fname_or_mode,
+FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
register const char * __restrict mode,
register FILE * __restrict stream, int filedes)
{
diff --git a/libc/stdio/_fpmaxtostr.c b/libc/stdio/_fpmaxtostr.c
index b9aacdca8..9ffa5493e 100644
--- a/libc/stdio/_fpmaxtostr.c
+++ b/libc/stdio/_fpmaxtostr.c
@@ -19,7 +19,7 @@ typedef size_t (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len,
*
* Function:
*
- * size_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
+ * ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
* __fp_outfunc_t fp_outfunc);
*
* This is derived from the old _dtostr, whic I wrote for uClibc to provide
@@ -198,7 +198,7 @@ static const __fpmax_t exp16_table[] = {
#define FPO_STR_WIDTH (0x80 | ' ');
#define FPO_STR_PREC 'p'
-ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
+ssize_t attribute_hidden _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
__fp_outfunc_t fp_outfunc)
{
#ifdef __UCLIBC_HAS_HEXADECIMAL_FLOATS__
diff --git a/libc/stdio/_fwrite.c b/libc/stdio/_fwrite.c
index a706ba7e6..d9d0bc2a8 100644
--- a/libc/stdio/_fwrite.c
+++ b/libc/stdio/_fwrite.c
@@ -11,7 +11,7 @@
/* Either buffer data or (commit buffer if necessary and) write. */
-size_t __stdio_fwrite(const unsigned char * __restrict buffer,
+size_t attribute_hidden __stdio_fwrite(const unsigned char * __restrict buffer,
size_t bytes,
register FILE * __restrict stream)
{
diff --git a/libc/stdio/_load_inttype.c b/libc/stdio/_load_inttype.c
index 2dd559a53..e4dc61e9c 100644
--- a/libc/stdio/_load_inttype.c
+++ b/libc/stdio/_load_inttype.c
@@ -8,7 +8,7 @@
#include "_stdio.h"
#include <printf.h>
-uintmax_t _load_inttype(int desttype, register const void *src, int uflag)
+uintmax_t attribute_hidden _load_inttype(int desttype, register const void *src, int uflag)
{
if (uflag >= 0) { /* unsigned */
#if LONG_MAX != INT_MAX
diff --git a/libc/stdio/_rfill.c b/libc/stdio/_rfill.c
index 145c1d78e..d61b1a9f9 100644
--- a/libc/stdio/_rfill.c
+++ b/libc/stdio/_rfill.c
@@ -19,7 +19,7 @@
* Side effects are those of _stdio_READ.
*/
-size_t __stdio_rfill(register FILE *__restrict stream)
+size_t attribute_hidden __stdio_rfill(register FILE *__restrict stream)
{
size_t rv;
diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h
index c167b177e..1ed349533 100644
--- a/libc/stdio/_stdio.h
+++ b/libc/stdio/_stdio.h
@@ -1,6 +1,6 @@
-/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
+/* Copyright (C) 2004-2005 Manuel Novoa III <mjn3@codepoet.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
@@ -59,10 +59,10 @@
/**********************************************************************/
#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
-extern __ssize_t _cs_read(void *cookie, char *buf, size_t bufsize);
-extern __ssize_t _cs_write(void *cookie, const char *buf, size_t bufsize);
-extern int _cs_seek(void *cookie, __offmax_t *pos, int whence);
-extern int _cs_close(void *cookie);
+extern __ssize_t _cs_read(void *cookie, char *buf, size_t bufsize) attribute_hidden;
+extern __ssize_t _cs_write(void *cookie, const char *buf, size_t bufsize) attribute_hidden;
+extern int _cs_seek(void *cookie, __offmax_t *pos, int whence) attribute_hidden;
+extern int _cs_close(void *cookie) attribute_hidden;
#define __STDIO_STREAM_RESET_GCS(S) \
(S)->__cookie = &((S)->__filedes); \
@@ -87,7 +87,7 @@ extern int _cs_close(void *cookie);
#else /* __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ */
-extern int __stdio_seek(FILE *stream, register __offmax_t *pos, int whence);
+extern int __stdio_seek(FILE *stream, register __offmax_t *pos, int whence) attribute_hidden;
#define __STDIO_STREAM_RESET_GCS(S) ((void)0)
@@ -249,13 +249,13 @@ extern int __stdio_seek(FILE *stream, register __offmax_t *pos, int whence);
/* Assume stream in valid writing state. Do not reset writing flag
* or disble putc macro unless error. */
/* Should we assume that buffer is not empty to avoid a check? */
-extern size_t __stdio_wcommit(FILE *__restrict stream);
+extern size_t __stdio_wcommit(FILE *__restrict stream) attribute_hidden;
/* Remember to fail if at EOF! */
-extern size_t __stdio_rfill(FILE *__restrict stream);
+extern size_t __stdio_rfill(FILE *__restrict stream) attribute_hidden;
extern size_t __stdio_fwrite(const unsigned char *__restrict buffer,
- size_t bytes, FILE *__restrict stream);
+ size_t bytes, FILE *__restrict stream) attribute_hidden;
#else
#define __stdio_fwrite(B,N,S) __stdio_WRITE((S),(B),(N))
@@ -263,14 +263,14 @@ extern size_t __stdio_fwrite(const unsigned char *__restrict buffer,
#endif
extern size_t __stdio_WRITE(FILE *stream, const unsigned char *buf,
- size_t bufsize);
-extern size_t __stdio_READ(FILE *stream, unsigned char *buf, size_t bufsize);
+ size_t bufsize) attribute_hidden;
+extern size_t __stdio_READ(FILE *stream, unsigned char *buf, size_t bufsize) attribute_hidden;
-extern int __stdio_trans2r(FILE *__restrict stream);
-extern int __stdio_trans2w(FILE *__restrict stream);
+extern int __stdio_trans2r(FILE *__restrict stream) attribute_hidden;
+extern int __stdio_trans2w(FILE *__restrict stream) attribute_hidden;
-extern int __stdio_trans2r_o(FILE *__restrict stream, int oflag);
-extern int __stdio_trans2w_o(FILE *__restrict stream, int oflag);
+extern int __stdio_trans2r_o(FILE *__restrict stream, int oflag) attribute_hidden;
+extern int __stdio_trans2w_o(FILE *__restrict stream, int oflag) attribute_hidden;
/**********************************************************************/
#ifdef __STDIO_BUFFERS
@@ -374,7 +374,7 @@ extern int __fputc_unlocked(int c, FILE *stream);
extern int __fflush_unlocked(FILE *stream);
-extern int __stdio_adjust_position(FILE *__restrict stream, __offmax_t *pos);
+extern int __stdio_adjust_position(FILE *__restrict stream, __offmax_t *pos) attribute_hidden;
extern void __clearerr_unlocked(FILE *stream);
extern int __feof_unlocked(FILE *stream);
@@ -427,8 +427,8 @@ extern size_t _stdio_fread(unsigned char *buffer, size_t bytes,
FILE *stream);
extern FILE *_stdio_fopen(intptr_t fname_or_mode,
- const char *__restrict mode,
- FILE *__restrict stream, int filedes);
+ const char *__restrict mode,
+ FILE *__restrict stream, int filedes) attribute_hidden;
#ifdef __UCLIBC_HAS_WCHAR__
extern size_t _wstdio_fwrite(const wchar_t *__restrict ws, size_t n,
diff --git a/libc/stdio/_store_inttype.c b/libc/stdio/_store_inttype.c
index 228e90619..82fb894c6 100644
--- a/libc/stdio/_store_inttype.c
+++ b/libc/stdio/_store_inttype.c
@@ -28,7 +28,7 @@
/* We assume int may be short or long, but short and long are different. */
-void _store_inttype(register void *dest, int desttype, uintmax_t val)
+void attribute_hidden _store_inttype(register void *dest, int desttype, uintmax_t val)
{
if (desttype == __PA_FLAG_CHAR) { /* assume char not int */
*((unsigned char *) dest) = val;
diff --git a/libc/stdio/_trans2r.c b/libc/stdio/_trans2r.c
index 9afb75428..1f3930070 100644
--- a/libc/stdio/_trans2r.c
+++ b/libc/stdio/_trans2r.c
@@ -22,9 +22,9 @@
*/
#ifdef __UCLIBC_HAS_WCHAR__
-int __stdio_trans2r_o(FILE * __restrict stream, int oflag)
+int attribute_hidden __stdio_trans2r_o(FILE * __restrict stream, int oflag)
#else
-int __stdio_trans2r(FILE * __restrict stream)
+int attribute_hidden __stdio_trans2r(FILE * __restrict stream)
#endif
{
__STDIO_STREAM_VALIDATE(stream);
diff --git a/libc/stdio/_trans2w.c b/libc/stdio/_trans2w.c
index 7ab3403c0..e85f45a24 100644
--- a/libc/stdio/_trans2w.c
+++ b/libc/stdio/_trans2w.c
@@ -21,9 +21,9 @@
*/
#ifdef __UCLIBC_HAS_WCHAR__
-int __stdio_trans2w_o(FILE * __restrict stream, int oflag)
+int attribute_hidden __stdio_trans2w_o(FILE * __restrict stream, int oflag)
#else
-int __stdio_trans2w(FILE * __restrict stream)
+int attribute_hidden __stdio_trans2w(FILE * __restrict stream)
#endif
{
__STDIO_STREAM_VALIDATE(stream);
diff --git a/libc/stdio/_wcommit.c b/libc/stdio/_wcommit.c
index 71720e83f..a0b3219b1 100644
--- a/libc/stdio/_wcommit.c
+++ b/libc/stdio/_wcommit.c
@@ -14,7 +14,7 @@
* Side effects are those of _stdio_WRITE
*/
-size_t __stdio_wcommit(register FILE * __restrict stream)
+size_t attribute_hidden __stdio_wcommit(register FILE * __restrict stream)
{
size_t bufsize;
diff --git a/libc/stdio/old_vfprintf.c b/libc/stdio/old_vfprintf.c
index 23cb10f94..8caa3d66d 100644
--- a/libc/stdio/old_vfprintf.c
+++ b/libc/stdio/old_vfprintf.c
@@ -217,7 +217,7 @@ typedef void (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len,
intptr_t buf);
extern size_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
- __fp_outfunc_t fp_outfunc);
+ __fp_outfunc_t fp_outfunc) attribute_hidden;
static void _charpad(FILE * __restrict stream, int padchar, size_t numpad)
{
@@ -261,8 +261,8 @@ static const char spec[] = "+-#0 ";
/**********************************************************************/
-extern void _store_inttype(void *dest, int desttype, uintmax_t val);
-extern uintmax_t _load_inttype(int desttype, const void *src, int uflag);
+extern void _store_inttype(void *dest, int desttype, uintmax_t val) attribute_hidden;
+extern uintmax_t _load_inttype(int desttype, const void *src, int uflag) attribute_hidden;
/*
* In order to ease translation to what arginfo and _print_info._flags expect,
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c
index feaec3b44..d99896893 100644
--- a/libc/stdio/scanf.c
+++ b/libc/stdio/scanf.c
@@ -46,7 +46,6 @@
#define _ISOC99_SOURCE /* for LLONG_MAX primarily... */
#define _GNU_SOURCE
-#define _STDIO_UTILITY
#include <features.h>
#include "_stdio.h"
#include <stdlib.h>
@@ -661,16 +660,16 @@ typedef struct {
/**********************************************************************/
extern void __init_scan_cookie(register struct scan_cookie *sc,
- register FILE *fp);
-extern int __scan_getc(register struct scan_cookie *sc);
-extern void __scan_ungetc(register struct scan_cookie *sc);
+ register FILE *fp) attribute_hidden;
+extern int __scan_getc(register struct scan_cookie *sc) attribute_hidden;
+extern void __scan_ungetc(register struct scan_cookie *sc) attribute_hidden;
#ifdef __UCLIBC_HAS_FLOATS__
extern int __scan_strtold(long double *ld, struct scan_cookie *sc);
#endif /* __UCLIBC_HAS_FLOATS__ */
-extern int __psfs_parse_spec(psfs_t *psfs);
-extern int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc);
+extern int __psfs_parse_spec(psfs_t *psfs) attribute_hidden;
+extern int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc) attribute_hidden;
/**********************************************************************/
#ifdef L___scan_cookie
@@ -682,7 +681,7 @@ extern int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc);
static const char decpt_str[] = ".";
#endif
-void __init_scan_cookie(register struct scan_cookie *sc,
+void attribute_hidden __init_scan_cookie(register struct scan_cookie *sc,
register FILE *fp)
{
sc->fp = fp;
@@ -723,7 +722,7 @@ void __init_scan_cookie(register struct scan_cookie *sc,
}
-int __scan_getc(register struct scan_cookie *sc)
+int attribute_hidden __scan_getc(register struct scan_cookie *sc)
{
int c;
@@ -771,7 +770,7 @@ int __scan_getc(register struct scan_cookie *sc)
return sc->cc = sc->ungot_char;
}
-void __scan_ungetc(register struct scan_cookie *sc)
+void attribute_hidden __scan_ungetc(register struct scan_cookie *sc)
{
++sc->width;
if (sc->ungot_flag == 2) { /* last was EOF */
@@ -797,7 +796,7 @@ static const unsigned char qual_chars[] = QUAL_CHARS;
static const unsigned char spec_ranges[] = SPEC_RANGES;
static const unsigned short spec_allowed[] = SPEC_ALLOWED_FLAGS;
-int __psfs_parse_spec(register psfs_t *psfs)
+int attribute_hidden __psfs_parse_spec(register psfs_t *psfs)
{
const unsigned char *p;
const unsigned char *fmt0 = psfs->fmt;
@@ -1756,7 +1755,7 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
static const unsigned char spec_base[] = SPEC_BASE;
static const unsigned char nil_string[] = "(nil)";
-int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
+int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
{
unsigned char *b;
const unsigned char *p;
diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c
index 10114f061..73bbe63d3 100644
--- a/libc/stdio/vfprintf.c
+++ b/libc/stdio/vfprintf.c
@@ -91,7 +91,6 @@
#define _ISOC99_SOURCE /* for ULLONG primarily... */
#define _GNU_SOURCE
-#define _STDIO_UTILITY /* We're using _uintmaxtostr. */
#include <features.h>
#include "_stdio.h"
#include <stdlib.h>
@@ -414,16 +413,16 @@ typedef size_t (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len,
intptr_t buf);
extern ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
- __fp_outfunc_t fp_outfunc);
+ __fp_outfunc_t fp_outfunc) attribute_hidden;
#endif
-extern int _ppfs_init(ppfs_t *ppfs, const char *fmt0); /* validates */
-extern void _ppfs_prepargs(ppfs_t *ppfs, va_list arg); /* sets posargptrs */
-extern void _ppfs_setargs(ppfs_t *ppfs); /* sets argptrs for current spec */
-extern int _ppfs_parsespec(ppfs_t *ppfs); /* parses specifier */
+extern int _ppfs_init(ppfs_t *ppfs, const char *fmt0) attribute_hidden; /* validates */
+extern void _ppfs_prepargs(ppfs_t *ppfs, va_list arg) attribute_hidden; /* sets posargptrs */
+extern void _ppfs_setargs(ppfs_t *ppfs) attribute_hidden; /* sets argptrs for current spec */
+extern int _ppfs_parsespec(ppfs_t *ppfs) attribute_hidden; /* parses specifier */
-extern void _store_inttype(void *dest, int desttype, uintmax_t val);
-extern uintmax_t _load_inttype(int desttype, const void *src, int uflag);
+extern void _store_inttype(void *dest, int desttype, uintmax_t val) attribute_hidden;
+extern uintmax_t _load_inttype(int desttype, const void *src, int uflag) attribute_hidden;
/**********************************************************************/
#ifdef L_parse_printf_format
@@ -498,7 +497,7 @@ size_t parse_printf_format(register const char *template,
/**********************************************************************/
#ifdef L__ppfs_init
-int _ppfs_init(register ppfs_t *ppfs, const char *fmt0)
+int attribute_hidden _ppfs_init(register ppfs_t *ppfs, const char *fmt0)
{
int r;
@@ -588,7 +587,7 @@ int _ppfs_init(register ppfs_t *ppfs, const char *fmt0)
#endif
/**********************************************************************/
#ifdef L__ppfs_prepargs
-void _ppfs_prepargs(register ppfs_t *ppfs, va_list arg)
+void attribute_hidden _ppfs_prepargs(register ppfs_t *ppfs, va_list arg)
{
int i;
@@ -607,7 +606,7 @@ void _ppfs_prepargs(register ppfs_t *ppfs, va_list arg)
/**********************************************************************/
#ifdef L__ppfs_setargs
-void _ppfs_setargs(register ppfs_t *ppfs)
+void attribute_hidden _ppfs_setargs(register ppfs_t *ppfs)
{
#ifdef __va_arg_ptr
register void **p = ppfs->argptr;
@@ -821,7 +820,7 @@ printf_arginfo_function *_custom_printf_arginfo[MAX_USER_SPEC];
printf_function _custom_printf_handler[MAX_USER_SPEC];
#endif /* __UCLIBC_HAS_GLIBC_CUSTOM_PRINTF__ */
-extern int _ppfs_parsespec(ppfs_t *ppfs)
+int attribute_hidden _ppfs_parsespec(ppfs_t *ppfs)
{
register const char *fmt;
register const char *p;