summaryrefslogtreecommitdiff
path: root/libc/stdio
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/stdio
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/stdio')
-rw-r--r--libc/stdio/_READ.c5
-rw-r--r--libc/stdio/__fsetlocking.c5
-rw-r--r--libc/stdio/_cs_funcs.c23
-rw-r--r--libc/stdio/_flushlbf.c2
-rw-r--r--libc/stdio/_fopen.c10
-rw-r--r--libc/stdio/_fpmaxtostr.c4
-rw-r--r--libc/stdio/_fwrite.c11
-rw-r--r--libc/stdio/_stdio.c7
-rw-r--r--libc/stdio/_stdio.h70
-rw-r--r--libc/stdio/_trans2w.c4
-rw-r--r--libc/stdio/_uintmaxtostr.c10
-rw-r--r--libc/stdio/_wfwrite.c10
-rw-r--r--libc/stdio/asprintf.c9
-rw-r--r--libc/stdio/clearerr.c7
-rw-r--r--libc/stdio/ctermid.c4
-rw-r--r--libc/stdio/dprintf.c4
-rw-r--r--libc/stdio/fclose.c11
-rw-r--r--libc/stdio/fcloseall.c2
-rw-r--r--libc/stdio/fdopen.c9
-rw-r--r--libc/stdio/feof.c7
-rw-r--r--libc/stdio/ferror.c7
-rw-r--r--libc/stdio/fflush.c20
-rw-r--r--libc/stdio/fgetc.c41
-rw-r--r--libc/stdio/fgetpos.c4
-rw-r--r--libc/stdio/fgetpos64.c2
-rw-r--r--libc/stdio/fgets.c23
-rw-r--r--libc/stdio/fgetwc.c28
-rw-r--r--libc/stdio/fgetws.c15
-rw-r--r--libc/stdio/fileno.c19
-rw-r--r--libc/stdio/fmemopen.c9
-rw-r--r--libc/stdio/fopen.c7
-rw-r--r--libc/stdio/fopen64.c1
-rw-r--r--libc/stdio/fopencookie.c5
-rw-r--r--libc/stdio/fprintf.c10
-rw-r--r--libc/stdio/fputc.c34
-rw-r--r--libc/stdio/fputs.c25
-rw-r--r--libc/stdio/fputwc.c16
-rw-r--r--libc/stdio/fputws.c25
-rw-r--r--libc/stdio/fread.c23
-rw-r--r--libc/stdio/freopen.c2
-rw-r--r--libc/stdio/fseeko.c18
-rw-r--r--libc/stdio/fseeko64.c2
-rw-r--r--libc/stdio/fsetpos.c4
-rw-r--r--libc/stdio/fsetpos64.c2
-rw-r--r--libc/stdio/ftello.c18
-rw-r--r--libc/stdio/ftello64.c2
-rw-r--r--libc/stdio/fwprintf.c4
-rw-r--r--libc/stdio/fwrite.c18
-rw-r--r--libc/stdio/getchar.c10
-rw-r--r--libc/stdio/getdelim.c8
-rw-r--r--libc/stdio/getline.c9
-rw-r--r--libc/stdio/gets.c5
-rw-r--r--libc/stdio/getw.c4
-rw-r--r--libc/stdio/getwchar.c13
-rw-r--r--libc/stdio/old_vfprintf.c23
-rw-r--r--libc/stdio/open_memstream.c17
-rw-r--r--libc/stdio/perror.c10
-rw-r--r--libc/stdio/popen.c36
-rw-r--r--libc/stdio/printf.c9
-rw-r--r--libc/stdio/putchar.c10
-rw-r--r--libc/stdio/puts.c7
-rw-r--r--libc/stdio/putw.c6
-rw-r--r--libc/stdio/putwchar.c14
-rw-r--r--libc/stdio/remove.c11
-rw-r--r--libc/stdio/rewind.c9
-rw-r--r--libc/stdio/scanf.c114
-rw-r--r--libc/stdio/setbuf.c4
-rw-r--r--libc/stdio/setbuffer.c4
-rw-r--r--libc/stdio/setlinebuf.c4
-rw-r--r--libc/stdio/setvbuf.c5
-rw-r--r--libc/stdio/snprintf.c9
-rw-r--r--libc/stdio/sprintf.c9
-rw-r--r--libc/stdio/swprintf.c4
-rw-r--r--libc/stdio/tempnam.c4
-rw-r--r--libc/stdio/tmpfile.c11
-rw-r--r--libc/stdio/tmpnam.c4
-rw-r--r--libc/stdio/ungetc.c5
-rw-r--r--libc/stdio/ungetwc.c5
-rw-r--r--libc/stdio/vasprintf.c22
-rw-r--r--libc/stdio/vdprintf.c12
-rw-r--r--libc/stdio/vfprintf.c51
-rw-r--r--libc/stdio/vprintf.c4
-rw-r--r--libc/stdio/vsnprintf.c23
-rw-r--r--libc/stdio/vsprintf.c4
-rw-r--r--libc/stdio/vswprintf.c9
-rw-r--r--libc/stdio/vwprintf.c4
-rw-r--r--libc/stdio/wprintf.c4
87 files changed, 640 insertions, 474 deletions
diff --git a/libc/stdio/_READ.c b/libc/stdio/_READ.c
index e27309c11..0c7febb3c 100644
--- a/libc/stdio/_READ.c
+++ b/libc/stdio/_READ.c
@@ -5,10 +5,11 @@
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
-#define read __read
-
#include "_stdio.h"
+libc_hidden_proto(read)
+libc_hidden_proto(abort)
+
/* Given a reading stream without its end-of-file indicator set and
* with no buffered input or ungots, read at most 'bufsize' bytes
* into 'buf' (which may be the stream's __bufstart).
diff --git a/libc/stdio/__fsetlocking.c b/libc/stdio/__fsetlocking.c
index 5b6070cc3..74f253626 100644
--- a/libc/stdio/__fsetlocking.c
+++ b/libc/stdio/__fsetlocking.c
@@ -15,7 +15,7 @@
* glibc treats invalid locking_mode args as FSETLOCKING_INTERNAL.
*/
-int attribute_hidden __fsetlocking_internal(FILE *stream, int locking_mode)
+int __fsetlocking(FILE *stream, int locking_mode)
{
#ifdef __UCLIBC_HAS_THREADS__
int current = 1 + (stream->__user_locking & 1);
@@ -44,4 +44,5 @@ int attribute_hidden __fsetlocking_internal(FILE *stream, int locking_mode)
#endif
}
-strong_alias(__fsetlocking_internal,__fsetlocking)
+libc_hidden_proto(__fsetlocking)
+libc_hidden_def(__fsetlocking)
diff --git a/libc/stdio/_cs_funcs.c b/libc/stdio/_cs_funcs.c
index ef92048c0..38a8351e5 100644
--- a/libc/stdio/_cs_funcs.c
+++ b/libc/stdio/_cs_funcs.c
@@ -7,20 +7,29 @@
#include "_stdio.h"
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(close)
+#ifdef __UCLIBC_HAS_LFS__
+libc_hidden_proto(lseek64)
+#else
+libc_hidden_proto(lseek)
+#endif
+
/**********************************************************************/
#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
/**********************************************************************/
ssize_t attribute_hidden _cs_read(void *cookie, char *buf, size_t bufsize)
{
- return __read(*((int *) cookie), buf, bufsize);
+ return read(*((int *) cookie), buf, bufsize);
}
/**********************************************************************/
ssize_t attribute_hidden _cs_write(void *cookie, const char *buf, size_t bufsize)
{
- return __write(*((int *) cookie), (char *) buf, bufsize);
+ return write(*((int *) cookie), (char *) buf, bufsize);
}
/**********************************************************************/
@@ -30,9 +39,9 @@ int attribute_hidden _cs_seek(void *cookie, register __offmax_t *pos, int whence
__offmax_t res;
#ifdef __UCLIBC_HAS_LFS__
- res = __lseek64(*((int *) cookie), *pos, whence);
+ res = lseek64(*((int *) cookie), *pos, whence);
#else
- res = __lseek(*((int *) cookie), *pos, whence);
+ res = lseek(*((int *) cookie), *pos, whence);
#endif
return (res >= 0) ? ((*pos = res), 0) : ((int) res);
@@ -42,7 +51,7 @@ int attribute_hidden _cs_seek(void *cookie, register __offmax_t *pos, int whence
int attribute_hidden _cs_close(void *cookie)
{
- return __close(*((int *) cookie));
+ return close(*((int *) cookie));
}
/**********************************************************************/
@@ -54,9 +63,9 @@ int attribute_hidden __stdio_seek(FILE *stream, register __offmax_t *pos, int wh
__offmax_t res;
#ifdef __UCLIBC_HAS_LFS__
- res = __lseek64(stream->__filedes, *pos, whence);
+ res = lseek64(stream->__filedes, *pos, whence);
#else
- res = __lseek(stream->__filedes, *pos, whence);
+ res = lseek(stream->__filedes, *pos, whence);
#endif
return (res >= 0) ? ((*pos = res), 0) : ((int) res);
diff --git a/libc/stdio/_flushlbf.c b/libc/stdio/_flushlbf.c
index 31ed2fc55..8a551a746 100644
--- a/libc/stdio/_flushlbf.c
+++ b/libc/stdio/_flushlbf.c
@@ -8,6 +8,8 @@
#include "_stdio.h"
#include <stdio_ext.h>
+libc_hidden_proto(fflush_unlocked)
+
/* Solaris function --
* Flush all line buffered (writing) streams.
*/
diff --git a/libc/stdio/_fopen.c b/libc/stdio/_fopen.c
index b4f4d46c7..02051eff9 100644
--- a/libc/stdio/_fopen.c
+++ b/libc/stdio/_fopen.c
@@ -5,10 +5,12 @@
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
-#define isatty __isatty
-
#include "_stdio.h"
+libc_hidden_proto(isatty)
+libc_hidden_proto(open)
+libc_hidden_proto(fcntl)
+
/*
* Cases:
* fopen64 : filename != NULL, stream == NULL, filedes == -2
@@ -121,7 +123,7 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
/* NOTE: fopencookie needs changing if the basic check changes! */
if (((i & (((int) fname_or_mode) + 1)) != i) /* Basic agreement? */
|| (((open_mode & ~((__mode_t) fname_or_mode)) & O_APPEND)
- && __fcntl(filedes, F_SETFL, O_APPEND)) /* Need O_APPEND. */
+ && fcntl(filedes, F_SETFL, O_APPEND)) /* Need O_APPEND. */
) {
goto DO_EINVAL;
}
@@ -130,7 +132,7 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
& O_LARGEFILE) );
} else {
__STDIO_WHEN_LFS( if (filedes < -1) open_mode |= O_LARGEFILE );
- if ((stream->__filedes = __open(((const char *) fname_or_mode),
+ if ((stream->__filedes = open(((const char *) fname_or_mode),
open_mode, 0666)) < 0) {
goto FREE_STREAM;
}
diff --git a/libc/stdio/_fpmaxtostr.c b/libc/stdio/_fpmaxtostr.c
index 99fc9a9dd..03fe6b1db 100644
--- a/libc/stdio/_fpmaxtostr.c
+++ b/libc/stdio/_fpmaxtostr.c
@@ -11,6 +11,8 @@
#include <locale.h>
#include <bits/uClibc_fpmax.h>
+libc_hidden_proto(memset)
+
typedef size_t (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len,
intptr_t buf);
@@ -417,7 +419,7 @@ ssize_t attribute_hidden _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info
if (mode == 'f') {
round += exp;
if (round < -1) {
- __memset(buf, '0', DECIMAL_DIG); /* OK, since 'f' -> decimal case. */
+ memset(buf, '0', DECIMAL_DIG); /* OK, since 'f' -> decimal case. */
exp = -1;
round = -1;
}
diff --git a/libc/stdio/_fwrite.c b/libc/stdio/_fwrite.c
index 600b15e6d..1e0f7ceee 100644
--- a/libc/stdio/_fwrite.c
+++ b/libc/stdio/_fwrite.c
@@ -5,11 +5,12 @@
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
-#define memrchr __memrchr
-#define memchr __memchr
-
#include "_stdio.h"
+libc_hidden_proto(memchr)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memrchr)
+
#ifdef __STDIO_BUFFERS
/* Either buffer data or (commit buffer if necessary and) write. */
@@ -35,7 +36,7 @@ size_t attribute_hidden __stdio_fwrite(const unsigned char * __restrict buffer,
if (pending > bytes) {
pending = bytes;
}
- __memcpy(stream->__bufpos, buffer, pending);
+ memcpy(stream->__bufpos, buffer, pending);
stream->__bufpos += pending;
__STDIO_STREAM_VALIDATE(stream);
return bytes;
@@ -43,7 +44,7 @@ size_t attribute_hidden __stdio_fwrite(const unsigned char * __restrict buffer,
/* RETRY: */
if (bytes <= __STDIO_STREAM_BUFFER_WAVAIL(stream)) {
- __memcpy(stream->__bufpos, buffer, bytes);
+ memcpy(stream->__bufpos, buffer, bytes);
stream->__bufpos += bytes;
if (__STDIO_STREAM_IS_LBF(stream)
&& memrchr(buffer, '\n', bytes) /* Search backwards. */
diff --git a/libc/stdio/_stdio.c b/libc/stdio/_stdio.c
index 54319118f..6454b3f3b 100644
--- a/libc/stdio/_stdio.c
+++ b/libc/stdio/_stdio.c
@@ -5,10 +5,11 @@
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
-#define isatty __isatty
-
#include "_stdio.h"
+libc_hidden_proto(memcpy)
+libc_hidden_proto(isatty)
+
/* This is pretty much straight from uClibc, but with one important
* difference.
*
@@ -169,7 +170,7 @@ void attribute_hidden __stdio_init_mutex(pthread_mutex_t *m)
static const pthread_mutex_t __stdio_mutex_initializer
= PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
- __memcpy(m, &__stdio_mutex_initializer, sizeof(__stdio_mutex_initializer));
+ memcpy(m, &__stdio_mutex_initializer, sizeof(__stdio_mutex_initializer));
}
#endif
diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h
index 0badc9fd1..d6b68b3bb 100644
--- a/libc/stdio/_stdio.h
+++ b/libc/stdio/_stdio.h
@@ -18,36 +18,8 @@
#include <stdlib.h>
#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 __vfscanf (FILE *__restrict __s, __const char *__restrict __format,
- __gnuc_va_list __arg)
- __attribute__ ((__format__ (__scanf__, 2, 0))) attribute_hidden;
-
-extern int __vsscanf (__const char *__restrict __s,
- __const char *__restrict __format, __gnuc_va_list __arg)
- __THROW __attribute__ ((__format__ (__scanf__, 2, 0))) attribute_hidden;
-
#ifdef __UCLIBC_HAS_WCHAR__
#include <wchar.h>
-
-extern int __vfwprintf (__FILE *__restrict __s,
- __const wchar_t *__restrict __format,
- __gnuc_va_list __arg) attribute_hidden;
-
-extern int __vfwscanf (__FILE *__restrict __s,
- __const wchar_t *__restrict __format,
- __gnuc_va_list __arg) attribute_hidden;
-
-extern int __vswscanf (__const wchar_t *__restrict __s,
- __const wchar_t *__restrict __format,
- __gnuc_va_list __arg) __THROW attribute_hidden;
#endif
#ifdef __UCLIBC_HAS_THREADS__
@@ -287,8 +259,6 @@ extern int __stdio_trans2w(FILE *__restrict stream) attribute_hidden;
extern int __stdio_trans2r_o(FILE *__restrict stream, int oflag) attribute_hidden;
extern int __stdio_trans2w_o(FILE *__restrict stream, int oflag) attribute_hidden;
-extern int __setvbuf (FILE *__restrict __stream, char *__restrict __buf,
- int __modes, size_t __n) __THROW attribute_hidden;
/**********************************************************************/
#ifdef __STDIO_BUFFERS
@@ -376,46 +346,11 @@ extern int __setvbuf (FILE *__restrict __stream, char *__restrict __buf,
#endif /* __STDIO_BUFFERS */
/**********************************************************************/
-extern int __fputs_unlocked(const char *__restrict s, FILE *__restrict stream) attribute_hidden;
-
-extern int __putchar_unlocked(int c);
-
-
-extern size_t __fwrite_unlocked(const void *__restrict ptr, size_t size,
- size_t nmemb, FILE *__restrict stream) attribute_hidden;
-
-extern size_t __fread_unlocked(void *__restrict ptr, size_t size,
- size_t nmemb, FILE *__restrict stream) attribute_hidden;
-
-extern int __fputc_unlocked_internal(int c, FILE *stream) attribute_hidden;
-
-extern int __fflush_unlocked(FILE *stream) attribute_hidden;
-
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);
-extern int __ferror_unlocked(FILE *stream);
-
-extern int __fgetc_unlocked_internal(FILE *stream) attribute_hidden;
-extern int __getc_unlocked(FILE *stream) attribute_hidden;
-extern char *__fgets_unlocked(char *__restrict s, int n,
- FILE * __restrict stream) attribute_hidden;
-
-extern int __fileno_unlocked(FILE *stream) attribute_hidden;
-
-extern int __getchar_unlocked(void) attribute_hidden;
-
-extern int __fseek(FILE *stream, long int offset, int whence) attribute_hidden;
-extern long int __ftell(FILE *stream) attribute_hidden;
-#ifdef __UCLIBC_HAS_LFS__
-extern int __fseeko64(FILE *stream, __off64_t offset, int whence) attribute_hidden;
-extern __off64_t __ftello64(FILE *stream) attribute_hidden;
-#endif
-
#ifdef __STDIO_HAS_OPENLIST
/* Uses an implementation hack!!! */
-#define __STDIO_FLUSH_LBF_STREAMS __fflush_unlocked((FILE *) &_stdio_openlist)
+#define __STDIO_FLUSH_LBF_STREAMS fflush_unlocked((FILE *) &_stdio_openlist)
#else
#define __STDIO_FLUSH_LBF_STREAMS ((void)0)
#endif
@@ -453,9 +388,6 @@ extern FILE *_stdio_fopen(intptr_t fname_or_mode,
#ifdef __UCLIBC_HAS_WCHAR__
extern size_t _wstdio_fwrite(const wchar_t *__restrict ws, size_t n,
FILE *__restrict stream) attribute_hidden;
-
-extern wint_t __fgetwc_unlocked(register FILE *stream) attribute_hidden;
-extern wint_t __fputwc_unlocked(wchar_t wc, FILE *stream) attribute_hidden;
#endif
/**********************************************************************/
diff --git a/libc/stdio/_trans2w.c b/libc/stdio/